1 Reply Latest reply: Mar 7, 2013 4:08 AM by Sergio_AA RSS

    OSB doing XML Encoding for '&' in the Query Param Value for a HTTP GET Req

    802462
      Product Details
      ---------------
      OFM Product:Oracle Service Bus 11.1.1.6
      Paltform: Generic

      Problem Statement
      ----------------
      We have Search Service Provider which accepts the search term in a query string and the URL to access the REST Service is http://localhost:8085/search?term=<Search query term>&range=1;2. We are using OSB as the Service Virtualization layer.
      Service Consumer <-GET->OSB<-GET--> Service Provider
      The Service Provider accepts the URL encoded query string only and the Service Consumer sends the URL encoded Search query term, however OSB seems to convert the URL Encoded String to XML Encoded String when it enters the Proxy Services and when it leaves the Business Service it is XML decoded and as a result the Search query term get truncated. Let me explain with an example with SOAP UI acting as a Service Consumer. If we pass "Tom & Jerry" as the search term, below are our findings.

      Actual Reuqest:
      /search?term=Tom & Jerry&range=1;3

      GET Request Sent from SOAP UI captured via Fiddler to the OSB Service:
      /search?term=Tom%20%26%20Jerry&range=1%3B3 HTTP/1.1

      Inbound Variable in Proxy Service:
      <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">iso-8859-1</tran:encoding>
      <http:query-string xmlns:http="http://www.bea.com/wli/sb/transports/http">range=1;3&amp;term=Tom &amp; Jerry</http:query-string>
      <http:query-parameters xmlns:http="http://www.bea.com/wli/sb/transports/http">
      <http:parameter name="range" value="1;3"/>
      <http:parameter name="term" value="Tom &amp; Jerry"/>
      </http:query-parameters>

      GET Request Sent from OBS via Business Service captured via Fiddler to the Service Provider:
      Actual:/search?term=Tom+&+Jerry&range=1%3B3
      Expected:/search?term=Tom%20%26%20Jerry&range=1%3B3

      Ideally we would want OSB to be a pass through and have the same encoding format as that provided by service consumer. Please let me know the workaround for this?