none
trouble invoking a web service from .NET to PHP RRS feed

  • Question

  • Hope this is the right forum:

    We are trying to call a webservice from another software vendor, on a php site.

    We've imported their wsdl, just like we do with other web services. The classes and function are nicely available in the Visual Studio 2013 project.

    When we actually connect to the web service by calling a function in the class generated, the connection is made OK, but "the other side" gets an xml message that is entirely different from what they expect, so they return an error message.

    What they expect, is a relatively "flat" xml stream, but what they are getting is an xml message with lots of "href id's" and other metadata. So it appears that the wsdl file triggers the .NET runtime to serialize the objects from the wsdl in a different manner than they expect it to.

    I've tried fiddling the wsdl by hand to use "document" style instead of "rpc", but then all hell breaks loose ;-)

    Any ideas on where to look for this mismatch?

    Thanks in advance,

    Will de Haan

    Here's part of the xml they are receiving:

    <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:vrest" xmlns:types="urn:vrest/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><tns:refreshSurgery><auth href="#id1" /><surgeryDescriptor xsi:type="xsd:string">99797</surgeryDescriptor><patientNumber xsi:type="xsd:string">3761920</patientNumber><date xsi:type="xsd:string">20-11-2014</date><surgeryProcedures href="#id2" /><patientBirthDate xsi:type="xsd:string">03-04-1957</patientBirthDate></tns:refreshSurgery><tns:AuthenticationDetails id="id1" xsi:type="tns:AuthenticationDetails"><username xsi:type="xsd:string">wscp</username><password xsi:type="xsd:string">***</password></tns:AuthenticationDetails><tns:SurgeryProcedureArray id="id2" xsi:type="tns:SurgeryProcedureArray"><SurgeryProcedure href="#id3" /></tns:SurgeryProcedureArray><soapenc:Array id="id3" soapenc:arrayType="tns:SurgeryProcedure[8]"><Item href="#id4" /><Item href="#id5" /><Item href="#id6" /><Item href="#id7" /><Item href="#id8" /><Item href="#id9" /><Item href="#id10" /><Item href="#id11" /></soapenc:Array><tns:SurgeryProcedure id="id4" xsi:type="tns:SurgeryProcedure"><surgGroupCode xsi:nil="true" /><appliedSurgProcDesc xsi:type="xsd:string">Endoscopische thoracale Sympathectomie</appliedSurgProcDesc><surgProcCode xsi:type="xsd:string">30518</surgProcCode><roles href="#id12" /></tns:SurgeryProcedure><tns:SurgeryProcedure id="id5" xsi:type="tns:SurgeryProcedure"><surgGroupCode xsi:nil="true" /><appliedSurgProcDesc xsi:type="xsd:string">Lobectomie of segmentresectie, open procedure (zie 032536 voor endoscopisch).</appliedSurgProcDesc><surgProcCode xsi:type="xsd:string">32530</surgProcCode><roles href="#id13" /></tns:SurgeryProcedure><tns:SurgeryProcedure id="id6" x

    And this is a structure as they expect it

    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="urn:vrest"><SOAP-ENV:Body><tns:refreshSurgery><auth><username>wscp</username><password>***</password></auth><surgeryDescriptor>OK1000000001</surgeryDescriptor><patientNumber>undisclosed</patientNumber><date>18-02-2015</date><surgeryProcedures><surgeryProcedure><appliedSurgProcDesc>1000000001</appliedSurgProcDesc><surgProcCode>OK_CHI_035582</surgProcCode><roles><SurgeryProcedureRole><userCode>WDH</userCode><roleId>D</roleId></SurgeryProcedureRole><SurgeryProcedureRole><userCode>EZW</userCode><roleId>A</roleId></SurgeryProcedureRole></roles></surgeryProcedure></surgeryProcedures></tns:refreshSurgery></SOAP-ENV:Body></SOAP-ENV:Envelope>


    1*! Galletto

    Friday, March 13, 2015 1:14 PM

All replies

  • Hi galletto_nl,

    What kinds of web service are you trying to consume? Is it a WCF service or other kinds of web service? If this is a WCF Service, since I want to have a test in my side, could you please try to tell us how do you import the webservice wsdl and how do you catch the xml content which you show on your post.

    For other kinds of web services, it will be better for you to post in this forum:
    http://forums.asp.net/28.aspx/1?WCF+ASMX+and+other+Web+Services .

    Thanks for your understanding.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.








    Monday, March 16, 2015 1:59 AM
    Moderator
  • Hi Amy,

    the "other side" is a php site.

    I imported the wsdl from their website.

    The xml I've shown has been e-mailed to me by the people who build and maintain the service. 

    Thanks,

    Will de Haan



    1*! Galletto

    Thursday, March 26, 2015 7:45 AM
  • Hi galletto_nl,

    After you import the wsdl from their website, what type of serialization are you using? Could you please try to post a simple reproduce project in here? I want to have a test in my side.

    Thanks for your understanding.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, April 1, 2015 5:51 AM
    Moderator
  • Hi Amy,

    I have created a sample project you could use for testing, in a zip file.

    How can I get it to you? I can only upoad images here.

    1*!

    Galletto


    1*! Galletto

    Wednesday, April 1, 2015 8:09 AM
  • Hi galletto_nl,

    Please upload your project in OneDrive.

    Thank you.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, April 1, 2015 8:35 AM
    Moderator
  • OK Amy, here goes:

    https://lievestro365.sharepoint.com/LievestroTechniek/_layouts/15/guestaccess.aspx?guestaccesstoken=vCz1jKd7Hwyqj1onpEUXGogkrZ9cCAAW1xv4TAv%2f%2f4o%3d&docid=198b2598ceeaa4c33a1aba5fc012e60e3

    Please let me know when you've downloaded the zip file, so I can remove it.

    Thanks in advance,

    Will


    1*! Galletto

    Wednesday, April 1, 2015 8:53 AM
  • Hi galletto_nl,

    I have downloaded your project, you can just remove it. :)
    I will do further testing about your project, once there is any update, I will post it here.
    Thanks for your understanding.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, April 2, 2015 9:20 AM
    Moderator
  • Hi Amy,

    any luck yet? Im still groping in the dark here... ;-) I'm hoping you can shed some light.



    1*! Galletto

    Thursday, April 9, 2015 2:03 PM
  • Hi Galleto!

    I think I'm having the same issue (this time to a ruby destination)

    Have you found any any way to solve this? Maybe just change the serialization?

    Tuesday, June 30, 2015 11:46 AM
  • We have changed the document style to "Document"instead of "rpc" in the generated code, and also some array definitions. That seems to help.

    My guess is, that the wsdl definition was actually wrong...


    1*! Galletto

    Monday, July 13, 2015 8:58 AM