Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I have WCF Service Running My Local IIS
[^]
When i Access Local every thing is Ok, but when i try to access Over Internet Using Public IP that Mapping to my Local IP and Post,
after I add Wcf Service in Client and i Call
I Got This Error:
C#
There was no endpoint listening at http://abdirizak-pc:90/HelloService.svc/HelloService that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException,


thanks for U Help...

What I have tried:

My Config File :
XML
<?xml version="1.0"?>
<configuration>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="mexbehavior">
          <serviceMetadata httpGetEnabled="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="mexbehavior" name="HelloService.HelloService">
        <endpoint address="HelloService" binding="basicHttpBinding" contract="HelloService.IHelloService"/>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:90"/>
          </baseAddresses>
        </host>
      </service>
    </services>
  </system.serviceModel>
  <system.web>
    <compilation debug="true" targetFramework="4.5.2" />
    <httpRuntime targetFramework="4.5.2" />
  </system.web>
</configuration>
Posted
Updated 28-Nov-16 18:35pm
v3
Comments
F-ES Sitecore 28-Nov-16 10:04am    
You can't have the endpoint binding as localhost, it needs to be the publically accessible hostname, so the public IP or whatever.

It's because you're using localhost. You have to use the IP address of the machine where the service is hosted.
 
Share this answer
 
Because at base address you have give the address of local host you have to give your public i.p address here or url of your server. And if its also not working the you have add multiple endpoints.

XML
<endpoint name="basicHttpEndpoint"
                  address=""
                  binding="basicHttpBinding"
                  bindingConfiguration="basicHttpBindingConfig"
                  contract="IService1" />
        <endpoint name="webHttpEndpoint"
                  address="/support"
                  binding="webHttpBinding"
                  bindingConfiguration="webHttpBindingConfig"
                  contract="IService1"
                  behaviorConfiguration="jsonBehaviour" />
        <endpoint name="mexHttpEndpoint"
                  address="/mex"
                  binding="mexHttpBinding"
                  contract="IMetadataExchange" />
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900