Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Special characters in soap request

  1. #1

    Default 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. #2
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

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

    Spring Web Services Dev Lead
    Please read the FAQ

  3. #3

    Default

    This is my request:

    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tws="http://test.com/types/TestEndpoint" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <soapenv:Header/>
    <soapenv:Body>
    <tws:InputRequest>TEST &pound; symbol
    </tws:InputRequest>
    </soapenv:Body>
    </soapenv:Envelope>

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

  4. #4
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    The &pound; is a HTML entity, not an XML entity. See http://en.wikipedia.org/wiki/List_of...ity_references

    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.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  5. #5

    Default

    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. #6
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    See http://en.wikipedia.org/wiki/Pound_sign: 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.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  7. #7

    Default

    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. #8

    Default

    Dont bother Ive resolved this problem.Thanks for your help.

  9. #9
    Join Date
    Sep 2006
    Location
    Germany
    Posts
    73

    Default

    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. #10
    Join Date
    Jan 2011
    Location
    UK
    Posts
    3

    Smile

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •