简体   繁体   English

在Winform C中使用php soap Webservice

[英]consume php soap webservice in winform c#

one of my friend made a soap webservice in PHP and now i have to consume it into my winform app. 我的一位朋友用PHP制作了一个肥皂网络服务,现在我必须将其用于我的winform应用程序中。 I added web Service Reference , pasted the URL and it is showing method name. 我添加了Web Service Reference,粘贴了URL,并显示了方法名称。

The method name is Display() . 方法名称为Display() Now after adding when write code on button click, it is showing following three methods: 现在添加按钮单击时编写代码后,它显示以下三种方法:

 MyWebServiceName. DisplayCompletedEventArgs
                    DisplayCompletedEventHandler
                    SiteControllerService

There is no soapClient or direct Display method ,any one know , what am I doing wrong? 没有soapClient或直接Display方法,谁知道,我在做什么错?

Check the WSDLyou must have in the VS project. 检查您必须在VS项目中使用的WSDL。 You will find the service name: 您将找到服务名称:

Ex: 例如:

<wsdl:service name="SiteControllerService">

So you must type: 因此,您必须输入:

MyWebServiceName.SiteControllerService SOAPclient = new MyWebServiceName.SiteControllerService(); 
SOAPClient.Display();

Visual Strudio create a namespace to encapsulate all classes generated to work with the web service. Visual Strudio创建一个命名空间来封装为与Web服务一起使用而生成的所有类。 In that namespace you will find the soap proxy client, events and events handler and any data transfer object needed to pass parameters to proxy client or to recive the response. 在该名称空间中,您将找到肥皂代理客户端,事件和事件处理程序以及将参数传递给代理客户端或获取响应所需的任何数据传输对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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