Announcement Announcement Module
No announcement yet.
Special characters in soap request Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Special characters in soap request

    Whenever i try to pass a special character like in my soap request the server throws an error instead of processing the request.Can anyone tell me how to resolve this problem

  • #2
    If you send your requests as UTF-8, or even ISO 8859-1, there should be no problem. There character sets contain the sign.


    • #3
      This is my request:

      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelope xmlns:soapenv="" xmlns:tws="" env:encodingStyle="">
      <tws:InputRequest>TEST &pound; symbol

      No matter what encoding i use it gives me java.lang.ClassCastException: xception
      Last edited by roym; Dec 3rd, 2007, 06:02 AM. Reason: Code tags added by mistake


      • #4
        The &pound; is a HTML entity, not an XML entity. See

        In general, you don't have to think about escaping entities when dealing with XML. The XML API you use (DOM, StaX) takes care of it.


        • #5
          When i pass in the symbol in my request I expect the endpoint(have used a marshaller) to fetch the content,but it throws an exception,and only works if i pass in the entity number &#163; instead of &pound;.
          Im a bit confused as to how to get this to work in my web service.


          • #6
            See you could try using & #163; in the request. (Make sure to remove the space in between the & and the #, i couldn't post it otherwise, because the forum escapes it). However - as stated earlier - any proper XML marshaller/parser should do this for you.

            At any rate, Spring-WS is not at fault here.


            • #7
              First of all I know spring web services is not at fault here but I was trying to get my web service to work with it.I use a jaxb marshaller to read the input request and then work with it.
              I meant to type & # 163 last time instead of the pound symbol this works finebut I need to pass in the symbol by itself instead of asking my clients to use the entity number.Cant seem to understand why it does not work


              • #8
                Dont bother Ive resolved this problem.Thanks for your help.


                • #9
                  Very old thread, but it might interest one:

                  Hit the same problem while using XwsSecurityInterceptor when a username had a "+" sign in it.

                  Problem occured in Sun Java 1.5 (Linux) and OSX 10.6.6 Java 1.6.

                  Fix was to switch to Wss4jSecurityInterceptor, which supports these signs.


                  • #10
                    i am also facing this problem from some time, please suggest me any resolution of this problem


                    • #11
                      we all are in the same boat lolx


                      • #12

                        I'm using a web service that in my request includes a symbol (chr 0165). I have set the encoding on my soap client to:

                        $soap = new MySoapClient('address.wsdl', array('trace' => 1, 'encoding'=>'ISO-8859-1'));

                        But when I look at my outgoing soap package the "" is changed to "¥"

                        I'm not good at encoding but I've tried a number of different combinations, using UTF8-ENCODE etc, to no avail....I just want my outbound soap package to show "" for every "" in my string variable.