I am a WebService asmx in c# with two methods. I was published this service on external server on port 8088, for connect to this service in firewall i made port forwarding from xxx.xxx.xxx.xxx:80(router) to 192.168.20.12:8088. In browser can connect to this web service(xxx.xxx.xxx.xxx/Service1.asmx). Now I create a SmartDeviceProject and when add this web service on WebReference in this mode: xxx.xxx.xxx.xxx/Service1.asmx I obtain this error:
Unable to downloal following files from: xxx.xxx.xxx.xxx:8088/Service1.asmx?wsdl
and when add in this mode: xxx.xxx.xxx.xxx/Service1.asmx?wsdl service successfully add but in this case in code:
public Service1() {
this.Url = "http://xxx.xxx.xxx.xxx:8088/Service1.asmx";
}
When I execute a project obtain this error: Could not establish connection to network
I get this error and if remove in all code port 8088 from Url.
Does anyone know how I can resolve this problem?
After you create the proxy instance, set the Url property to the correct value, just like the constructor sets it to the wrong value: