UTF-8 deserialiation problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?T2xhdiBM?=

    UTF-8 deserialiation problem

    I have made a web service operation that just return the input string that
    is sent as a parameter. If the characters in the string is, for example the
    Norwegian letters "æøå", the returned string is not deserialised to the same
    string as sent in. I have checked that in the returned soap message, the
    letter are binary the same.

    I have caught the serialized soap message and it looks like this:

    <?xml version="1.0" encoding="utf-8" ?>
    <soap:Envelop e xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
    xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
    xmlns:tns="http ://localhost:8080/EDMWS/earlybinding/DataRepository/gurumod/QEX/gurumod_ws"
    xmlns:types="ht tp://localhost:8080/EDMWS/earlybinding/DataRepository/gurumod/QEX/gurumod_ws/encodedTypes"
    xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
    <soap:Body soap:encodingSt yle="http://schemas.xmlsoap .org/soap/encoding/">
    <tns:return_str ing>
    <EDMsessionId xsi:type="xsd:s tring">OK</EDMsessionId>
    <IN_STRING xsi:type="xsd:s tring">æøå</IN_STRING>
    </tns:return_stri ng>
    </soap:Body>
    </soap:Envelope>


    The returned soap message is as follows:

    <?xml version="1.0" encoding="utf-8" ?>
    <SOAP-ENV:Envelope xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
    xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
    xmlns:ns1="http ://localhost/EDMWS/earlybinding/DataRepository/gurumod/QEX/gurumod_ws"
    xmlns:SOAP-ENV="http://schemas.xmlsoap .org/soap/envelope/"
    xmlns:ns2="http ://epmtech.jotne.c om/GURUMOD/gurumod_WS"
    xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Body
    SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/">
    <ns1:return_str ingResponse>
    <Response xsi:type="xsd:s tring">æøå</Response>
    </ns1:return_stri ngResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
  • John Saunders

    #2
    Re: UTF-8 deserialiation problem



    "Olav L" <Olav L@discussions.m icrosoft.comwrote in message
    news:44E0BE1D-C7FC-4363-B018-09DFB16C6164@mi crosoft.com...
    I have made a web service operation that just return the input string
    that
    is sent as a parameter. If the characters in the string is, for example
    the
    Norwegian letters "æøå", the returned string is not deserialised to the
    same
    string as sent in. I have checked that in the returned soap message, the
    letter are binary the same.
    >
    I have caught the serialized soap message and it looks like this:
    >
    <?xml version="1.0" encoding="utf-8" ?>
    <soap:Envelop e xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
    xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
    xmlns:tns="http ://localhost:8080/EDMWS/earlybinding/DataRepository/gurumod/QEX/gurumod_ws"
    xmlns:types="ht tp://localhost:8080/EDMWS/earlybinding/DataRepository/gurumod/QEX/gurumod_ws/encodedTypes"
    xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
    <soap:Body soap:encodingSt yle="http://schemas.xmlsoap .org/soap/encoding/">
    <tns:return_str ing>
    <EDMsessionId xsi:type="xsd:s tring">OK</EDMsessionId>
    <IN_STRING xsi:type="xsd:s tring">æøå</IN_STRING>
    </tns:return_stri ng>
    </soap:Body>
    </soap:Envelope>
    >
    >
    The returned soap message is as follows:
    >
    <?xml version="1.0" encoding="utf-8" ?>
    <SOAP-ENV:Envelope xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
    xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
    xmlns:ns1="http ://localhost/EDMWS/earlybinding/DataRepository/gurumod/QEX/gurumod_ws"
    xmlns:SOAP-ENV="http://schemas.xmlsoap .org/soap/envelope/"
    xmlns:ns2="http ://epmtech.jotne.c om/GURUMOD/gurumod_WS"
    xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Body
    SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/">
    <ns1:return_str ingResponse>
    <Response xsi:type="xsd:s tring">æøå</Response>
    </ns1:return_stri ngResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    The request and response look the same to me. How did you determine that
    they are different?
    --
    John Saunders | MVP - Connected System Developer

    Comment

    • =?Utf-8?B?T2xhdiBM?=

      #3
      Re: UTF-8 deserialiation problem



      "John Saunders" wrote:
      >
      >
      "Olav L" <Olav L@discussions.m icrosoft.comwrote in message
      news:44E0BE1D-C7FC-4363-B018-09DFB16C6164@mi crosoft.com...
      I have made a web service operation that just return the input string
      that
      is sent as a parameter. If the characters in the string is, for example
      the
      Norwegian letters "æøå", the returned string is not deserialised to the
      same
      string as sent in. I have checked that in the returned soap message, the
      letter are binary the same.

      I have caught the serialized soap message and it looks like this:

      <?xml version="1.0" encoding="utf-8" ?>
      <soap:Envelop e xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
      xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
      xmlns:tns="http ://localhost:8080/EDMWS/earlybinding/DataRepository/gurumod/QEX/gurumod_ws"
      xmlns:types="ht tp://localhost:8080/EDMWS/earlybinding/DataRepository/gurumod/QEX/gurumod_ws/encodedTypes"
      xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
      <soap:Body soap:encodingSt yle="http://schemas.xmlsoap .org/soap/encoding/">
      <tns:return_str ing>
      <EDMsessionId xsi:type="xsd:s tring">OK</EDMsessionId>
      <IN_STRING xsi:type="xsd:s tring">æøå</IN_STRING>
      </tns:return_stri ng>
      </soap:Body>
      </soap:Envelope>


      The returned soap message is as follows:

      <?xml version="1.0" encoding="utf-8" ?>
      <SOAP-ENV:Envelope xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
      xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
      xmlns:ns1="http ://localhost/EDMWS/earlybinding/DataRepository/gurumod/QEX/gurumod_ws"
      xmlns:SOAP-ENV="http://schemas.xmlsoap .org/soap/envelope/"
      xmlns:ns2="http ://epmtech.jotne.c om/GURUMOD/gurumod_WS"
      xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
      <SOAP-ENV:Body
      SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/">
      <ns1:return_str ingResponse>
      <Response xsi:type="xsd:s tring">æøå</Response>
      </ns1:return_stri ngResponse>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>
      >
      The request and response look the same to me. How did you determine that
      they are different?
      --
      John Saunders | MVP - Connected System Developer
      >
      In the Visual Studio, the debugger shows "??????" as the response value.

      Comment

      Working...