简体   繁体   中英

web service call fails

I have created a windows service application with C# with .Net 2.0, and added a web service as

http://localhost/postIncidents.ws.php?wsdl

It has the method "ReportIncident". I checked the windows service in local environment. It worked. Before I deploy it I added below code to get the particular url from a setting file.

shids_client.shidsWebServer.ReportIncident r = new shids_client.shidsWebServer.ReportIncident();
r.Url = Constant.readUrl();
r.CallReportIncident(time,LocalIPAddress(),type,line);

After I deployed, I added the URL to my setting file as

      http://192.168.1.1/postIncidents.ws.php?wsdl

After I check it, it didn't work. the following error was in my log:

"Operation 'CallReportIncident' is not defined in the WSDL for this service"


if i remove it, then it will not show the wsdl xml. it will show only a rendered page.

You use the ?wsdl flag so that Visual Studio can download the WSDL and generate the service proxy. When the proxy actually runs, it runs against http:///postIncidents.ws.php, not ?wsdl needed. So try removing ?wsdl from the URL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM