on 01-23-2015 4:32 PM
Hello all.
I'm creating an HTTP scenario like backend->PI->SOAP(AXIS) (synchronous) to consume a rest web service. The goal is to make an HTTP call using method GET (no payload) and the URL must be dynamic. To achieve it I read several links, like:
and it seems to be working fine (the request part).
Using a SICF http service (using like a mock service), I can see that everything is doing fine. This http service, like the real one, returns an xml in the response (not a SOAP envelope).
However, when invoking the real web service, i'm receiving this error:
Exception caught by adapter framework: ; nested exception is:
org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1f) was found in the element content of the document.
I can also test the real scenario using an HTTP requester and it returns an xml, like the one my SICF service returns.
My suspission is that the real webservice is returning a gzip response and this prevents PI from being able to parse the response.
For that I'm, trying to use:
a) AF_Modules/PayloadZipBean to unzip the reponse before parsing
b) set HTTP-Request-Headers{Accept} with "*/*"
Both without success
Regards,
VDO
Hi all,
Finally the issue is solved.
The parsing error was related to the fact that the response is gzipped and the default Axis Handler, called "java:com.sap.aii.adapter.axis.ra.transport.http.HTTPSender" used in trp operation, doesn't support it.
The solution was the replace of this handler by another one, that supports it "com.sap.aii.adapter.axis.ra.transport.http.CommonsHTTPSender"
Regards,
VDO
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eng,
Yes.
The request header is like:
Accept: */*
Accept-Encoding: gzip, deflate, sdch
Content-Encoding: gzip
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Valter
I've read up a bit more on your initial error regarding the unicode 0x1F symbol. From the link below, it seems that character is invalid in XML 1.0 (but allowed in XML 1.1)
android - What is character 0x1f? - Stack Overflow
Now, my guess would be that you are actually getting back the same XML response using both Axis channel and HTTP test tool/extension. The test tool does not complain as it does not do anything further with the response. However, the Axis channel is trying to parse the response, and therefore the invalid content in the XML is causing the SAX Parser to raise an exception.
Another useful tool in your debugging would be to have the XPI inspector - details in OSS note 1514898
You can use that to further inspect the HTTP traces.
Rgds
Eng Swee
Thanks for the help.
Regarding the the zip stream. This is not an usual SOAP adapter, I'm using SOAP AXIS adapter. I'm using this module to gzip a message in the previous scenario. But this is not applicable with Axis.
Regarding the accept: "application/xml". It was a good sugestion but it doesn't work,
Regards,
VDO
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Valter
IMHO, for testing REST services, the following extension on Chrome is an indispensable tool.
Advanced REST client - Chrome Web Store
I would suggest that you compare the HTTP request headers being sent to the web service when you test using the Axis adapter vs when you use a test tool.
Maybe when you use the test tool, the "Accept" header is set to application/xml so it returns XML, while gzip could be the default when it is */*, which you specified in you adapter config.
Rgds
Eng Swee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please check the below blog and document which might help
regards,
Harish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.