0 Replies Latest reply on Mar 3, 2014 5:36 AM by Alex Terzis

    camel cxf - can't escape spaces correctly

    Alex Terzis Newbie

      Repost of http://fusesource.com/forums/thread.jspa?threadID=4920&tstart=0

      I'm reposting here in case I didn't post on the correct forum the first time.  Apologies if this shouldn't be reposted...

       

      _____________________________

      I'm trying to access a public API with the cxf component from within a camel flow; the URL contains spaces in it (it's a Microsoft-based platform) and I can't seem to be able to escape %20 correctly in the URL:

       

      :7047/nSembleR2_MN/WS/CRONUS%20UK%20Ltd./Codeunit/EMS2NAV?wsdlURL=src/main/resources/META-INF/EMS2NAV.wsdl&serviceName=EMS2NAV&portName=EMS2NAV_Port&dataFormat=MESSAGE"/>

       

      I've trying using '%20' or even '%2520' instead of '%20" with no luck!

      For all of the above I keep getting a "400 Bad Request" from the service, while I do observe with Wireshark that the outgoing request (that camel generates) contains actual spaces (instead of %20)!

       

      It seems like somewhere in the camel code, the decoding takes place and there is no way to have camel to generate the call with the '%20' (so that I avoid the 400 error).

       

      Any ideas on how to successfully escape the above URL?

       

      _____________________________

      To make things clear:

       

      The following request from SoapUI works fine:

      http://<XX.XX.XX.XX-deletedTheIPForSecurityReasons>:7047/nSembleR2_MN/WS/CRONUS%20UK%20Ltd./Codeunit/EMS2NAV

       

      But (observing with Wireshark) I see that camel generates the following request that fails with 400 Bad Request error:

      http://<XX.XX.XX.XX-deletedTheIPForSecurityReasons>:7047/nSembleR2_MN/WS/CRONUS UK Ltd./Codeunit/EMS2NAV

       

      _____________________________

      And to clarify even further, ALL of the following generate the same output request (that contains the actual spaces with no escaping whatsoever and) that returns the 400 Bad Request error:

       

      :7047/nSembleR2_MN/WS/CRONUS%2520UK%2520Ltd./Codeunit/EMS2NAV?wsdlURL=

       

      Edited by: alex.terzis on Feb 26, 2014 6:21 PM

       

      Edited by: alex.terzis on Mar 3, 2014 10:36 AM