Search code examples
c#asp.netweb-servicesnetwork-programmingasmx

Webservice URL appends port when adding a reference in my application


I have developed a simple .asmx webservice and hosted it on my server. The local machine url of the service is http://192.168.1.34:1115/webservices/verify.asmx.

I have given this a public IP so we can access it from anywhere like http://104.32.43.21/webservices/verify.asmx

when I hit the public url from my browser it works fine and the service page shown.

But when I try to add a reference of this service in my asp.net application, the port number 1115 gets appended to the service url and it shows an error in downloading the wsdl file from the server saying unable to resolve the host.

can someone tell me what is happening here and how can I access the webservice.

Thanks


Solution

  • There was problem in the way I was trying to add the service reference to my application. When ever adding an ASMX service reference add it with appending ?wsdl at the last of the service URL.

    For my case it should have been like: http://104.32.43.21/webservices/verify.asmx?wsdl.