开发者

WebService getting the local address instead of ip address

I trying to run a silverlight app. I have a server with a knowed ip, and I am trying to install the sl app in this server.

The problem is, if I access the service using the ip like: http://serverip:port/Service.svc, the service runs with no problem, but, service shows this: svcutil.exe http://serverLocalAddress:port/Service.svc?wsdl

So, when I run the app from the local domain,开发者_如何学编程 I have no problem, but, when I run from outside domain (from my house for example), the app doesn't run correctly, showing a error in the service.

I have configured my ServiceReference.ClientConfig endpoint address with: "http://serverip:port/Service.svc".

There are other place to change to fix this problem?

Regards.

Eduardo.


You may want to be explicit about your address in your code versus in your ClientConfig. This can give your more control over your url, you can event move it to your Application InitParams.

To do this, modify your service declaration to include the address and change this

_proxy = new WCFServiceClient();

to

_proxy = new WCFServiceClient("BasicHttpBinding_IWCFService", "http://serverip:port/Service.svc");

I don't recommend hard coding the address as I've done here, but this should get you started.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜