Click here to Skip to main content
15,896,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I have made simple WCF service that returns hard coded number,now everything works so far.
I published website then through IIS it still works
localhost/websitename/site.aspx <-------- This works
but when i tried Ipaddress/websitename/site.aspx It doesn't call Wcf service !

Any suggestion ?
Posted

Check firewall
Check binding info - as you can see this configuration tries to access localhost - so it needs to be updated to point to the server
XML
<system.serviceModel>
    <client>
      <endpoint name="DataService" address="net.tcp://localhost:34433/DataService" binding="netTcpBinding" bindingConfiguration="MyDataServiceBinding" contract="MyDataService" behaviorConfiguration="DataServiceBehavior" />
    </client>


[Update]
the <client></client> section goes into the app.config file of the client application - that's how the client initially can locate the server.

[Update 2]
Try opening http://160.84.56.116/Website/Service1.svc[^] in your web browser

If this don't work - you probably have a serverside problem. If 160.84.56.116 is a public IP address, you do have a server side problem, because I'm not able to connect to anything at that address. not ping and not http://160.84.56.116[^]

Best regards
Espen Harlinn
 
Share this answer
 
v3
Comments
mohit`12 7-Jul-11 16:39pm    
please see the solution i submitted below for my web.config file thanks
mohit`12 7-Jul-11 16:52pm    
i have add my app.config .. let me know if i am doing anything wrong because it still doesn't work.
mohit`12 7-Jul-11 20:14pm    
well you wont be able to open it since it's hosted for local server only . so and yeah i will try to open service for that ip adress. and do u think that my app.config is written correct ?
Btw thanks a lot for help
XML
<configuration>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IService1" maxBufferSize="2147483647"
            maxReceivedMessageSize="2147483647">
          <security mode="None" />
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://160.84.56.116/Website/Service1.svc" binding="basicHttpBinding"
          bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReference1.IService1"
          name="BasicHttpBinding_IService1" />
    </client>
  </system.serviceModel>
</configuration>
 
Share this answer
 
It's Solve. Stupid mistake i just needed to make endpoint looks like this
<endpoint address="http://localhost.:2373/Service1.svc" binding="basicHttpBinding"

I have another question when client is working on website. can client open notepad on server(host) side and save some data in notepad.
 
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