2 Replies Latest reply on Mar 3, 2014 5:35 AM by alex.terzis

    camel cxf - can't escape spaces correctly

    alex.terzis

      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?

       

      Edited by: alex.terzis on Feb 25, 2014 4:00 PM

        • 1. Re: camel cxf - can't escape spaces correctly
          alex.terzis

          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

          • 2. Re: camel cxf - can't escape spaces correctly
            alex.terzis

            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 Mar 3, 2014 10:34 AM