简体   繁体   中英

Using PHP nuSOAP webservice in C#

I am working on windows phone project in visual studio 2012 for windows phone. I am trying use PHP NuSOAP webservice by adding Service reference .

Here I followed this sample app. In general the VS will create Reference.cs file while adding webservice. You can see reference.cs file contents of dictionary(Sample) app HERE

The Reference.cs of my webservice of my project HERE . In my Reference.cs file the interface SomeMobileServicePortType is empty.

In Line 19.

public interface SomeMobileServicePortType {
}

Because of this I not getting any methods of webservice to access in my project. But while adding reference in Add service Refernce dialogue it is showing the methods contains in PHP NuSOAP webservice.

I created new instance of webservice class..

     ServiceReference1.SomeMobileServicePortTypeClient client = new ServiceReference1.SomeMobileServicePortTypeClient();

What is the wrong with PHP webservice. I tried some more webservices [in particular asmx, I didn't get any sample PHP NuSOAP webservice to try] which are working fine. Can any one tell me How to use PHP NuSOAP service using C#.

==================================================================================

Edit:

We are using NuSOAP PHP webservice.

I believe that there is no problem with Webservice. I can't share the WSDL file right now.

Here I got the sample that explains using PHP NuSOAP in C#. I tried with this webservice link. This reference also not giving any methods. The interface is empty like this.

 public interface HirdWebExamplePortType {    }

So my guess is while using NuSOAP service it is not working in IDE Visual Studio. Here is my sample windows phone project. Please try this & suggest me what I am doing wrong.

The project you supplied is not compatible with this kind of SOAP-Service.

If you add the service to eg a Console App it works fine: 在此输入图像描述

but if you add it to your project (WP Silverlight):
在此输入图像描述

Check if you can disable SOAP encoding on your service.

It does support RPC/Literal soap style so we need to change the style from RPC/encoded to RPC/literal. This is actually really easy: Open the wsdl file and modify the input and output operations from

<soap:body use="encoded" ..../>

to

<soap:body use="literal" ..../>

Reference: Just go through the below link:

http://guruce.com/blogpost/hosting-webservices-on-wec-using-gsoap-windows-phone-75-mango-client-application#comments

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