0

I have wcf-service which is available on http://195.50.152.240:23/monitoring.svc/ address. Also I have special server that must use my wcf-service, but when I set url above as wcf-service source, special server is addressing by another url such as http://195.50.152.240:23/monitoring.svc/AnalyticalServer/ws. The problem is that how to forward request from special server to my WCF-service?

I don't know anything about special server, only know that it transforms request (wireshark rules) WCF-service is hosted by IIS 8.5 Specifying endpoints in WCF's web.config didn't help. I'm getting errors like " Cannot obtain Metadata from http://195.50.152.240:23/monitoring.svc/AnalyticalServer/ws If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address."

UPDATE:

Web.config snippet:

<system.serviceModel>
    <services>
      <service name="AnalyticalServer.WebService">
        <endpoint address="/AnalyticalServer/ws"
                 binding="basicHttpBinding"
                 contract="AnalyticalServer.AnalyticalServerWS" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:23/AnalyticalServer.WebService"/>
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <protocolMapping>
      <add binding="basicHttpBinding" scheme="http"/>
    </protocolMapping>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
  </system.serviceModel>
Nick
  • 49
  • 6
  • What does your web or app.config look like on the called service? The nature of your error implies that it cannot find the WSDL resource to build the client proxy objects for the service reference that you'd normally use to call the WCF service. – MutantNinjaCodeMonkey Dec 24 '15 at 19:07

1 Answers1

1

Try to change your web.config to

<service name="AnalyticalServer.WebService">
    <endpoint address="/AnalyticalServer/ws"
             binding="basicHttpBinding"
             contract="AnalyticalServer.AnalyticalServerWS" />
    <host>
      <baseAddresses>
        <add baseAddress="http://195.50.152.240:23/monitoring.svc/" />
      </baseAddresses>
    </host>
  </service>

After that your WCF-service will be available on http://195.50.152.240:23/monitoring.svc/ and you can access contract="AnalyticalServer.AnalyticalServerWS" on http://195.50.152.240:23/monitoring.svc/AnalyticalServer/ws.

If your special server will not see your WCF-service after this, try to change your endpoint's binding (i think that /ws in endpoint's address can mean wsHttpBinding)

Also read this to understand what is service endpoints and host base address.

Community
  • 1
  • 1
Alekstim
  • 452
  • 1
  • 8
  • 19