locked
WebService and PHP having to encode? RRS feed

  • Question

  • User-721934350 posted

    Good morning,

    I have been working with a PHP programmer who wants to use one of our web services but he is saying that when he communicates with us, that he must encode everything - so an < becomes &lt; and > becomes &gt; and this is a lot of work for him.

    We use the same WebService internally but using Visual Studio, and do not have to do this.

    I was wondering if something is wrong with our configuration? The programs declaration is below ..

    [WebMethod] 
    public XmlDocument CreateShipment(String xmlString)
    Monday, December 2, 2013 9:27 AM

Answers

  • User-417640953 posted

    Hi 2lethal,

    Thanks for the post.

    There are two SOAP message styles, called document and rpc. Document style indicates that the SOAP body simply contains an XML document.

    The sender and receiver must agree on the format of the document ahead of time, such as traditional messaging systems like

    Microsoft® Message Queue (MSMQ), MQSeries, and so on.  RPC (Remote Procedure Call) style, on the other hand, indicates that the SOAP body

    contains an XML representation of a method call such as the traditional distributed component technologies of DCOM, Corba, and others.

    In your side, you can set the "messageEncoding" and "textEncoding" of binding to constraint your message encode type.

    Please check below link to get more information about it.

    http://msdn.microsoft.com/en-us/library/ms731361(v=vs.110).aspx

     

    Thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 4, 2013 9:39 PM

All replies

  • User-760709272 posted

    If encoding his text is "a lot of work" you should advise him to move his code to a better platform :)

    Monday, December 2, 2013 10:34 AM
  • User-721934350 posted

    I don't disagree but I was wondering, if something was wrong with my "side" .... I use SOAP tools and I don't have to do this.

    Monday, December 2, 2013 10:38 AM
  • User-417640953 posted

    Hi 2lethal,

    Thanks for the post.

    There are two SOAP message styles, called document and rpc. Document style indicates that the SOAP body simply contains an XML document.

    The sender and receiver must agree on the format of the document ahead of time, such as traditional messaging systems like

    Microsoft® Message Queue (MSMQ), MQSeries, and so on.  RPC (Remote Procedure Call) style, on the other hand, indicates that the SOAP body

    contains an XML representation of a method call such as the traditional distributed component technologies of DCOM, Corba, and others.

    In your side, you can set the "messageEncoding" and "textEncoding" of binding to constraint your message encode type.

    Please check below link to get more information about it.

    http://msdn.microsoft.com/en-us/library/ms731361(v=vs.110).aspx

     

    Thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 4, 2013 9:39 PM