Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 811
Kumar Avatar asked Apr 22 '14 11:04

Kumar


2 Answers

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

If you add the service to e.g. a Console App it works fine: enter image description here

but if you add it to your project (WP Silverlight):
enter image description here

Check if you can disable SOAP encoding on your service.

like image 115
Christoph Fink Avatar answered Nov 03 '22 06:11

Christoph Fink


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

like image 21
Maverick Avatar answered Nov 03 '22 05:11

Maverick