6

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.

9
  • Are you sure the WSDL of the PHP SOAP service is valid? I guess the problem lies there... Commented Apr 22, 2014 at 11:44
  • @chrfin It is fine. While adding reference it is showing the operations that contains in webservice. Commented Apr 22, 2014 at 11:47
  • Just because it shows the methods there does not mean it is fine. I already created a few PHP SOAP services and ALWAYS had to "tweak" the WSDL Generation a little bit to get it "really working" for all "clients". May try adding the Service in SOAPui or SoapSonar and see if they work as you expect them? Commented Apr 22, 2014 at 11:51
  • I just want add that the webservice working well for author domains well like Android.. Let me check How to use SOAPui and those things. Because I am new to these. Commented Apr 22, 2014 at 12:05
  • Still I didn't get solution for this.... Is any one worked before on PHP NuSOAP webservice in C# with IDE Visual Studio... It is essential for me,,Thanks. Commented May 1, 2014 at 18:22

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Hi.. chrfin, As Rathish's answer suggested if I changed to literal it is working fine for me. But I don't think it is proper way. Do you know any other solution to encode the SOAP service...
But I don't think it is proper way. => IMO it IS the proper way to make the service compatible, BUT you should not edit the WSDL manually, but change the generation of the WSDL to be generated that way.
It seems that the silverlight version doesn't support RPC/encoded soap and ignores those operations. It does support RPC/Literal soap style. By changing to literal the service working for me. Great thanks for spending your valuable time.
1
+50

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.