Author Message
B.Ritchie
Joined: Aug 26, 2014
Messages: 15
Offline
Hello - I am calling a REST web service using the built-in WSOP. I have OD version 7.1. I am getting following exception during the web service call:

04/10/2016 16:24:57:765 ERROR - 09E2B8E8415EABFB55EB20F436767111:/OA_MainRouting : AXISFAULT during web service call: <className>org.springframework.http.converter.HttpMessageNotReadableException</className>
04/10/2016 16:24:57:765 ERROR - 09E2B8E8415EABFB55EB20F436767111:/OA_MainRouting : EXCEPTION: <className>org.springframework.http.converter.HttpMessageNotReadableException</className>
04/10/2016 16:24:57:775 ERROR - 09E2B8E8415EABFB55EB20F436767111:/OA_MainRouting : session id:sess8844687 |
EXCEPTION>
org.apache.axis2.AxisFault: <className>org.springframework.http.converter.HttpMessageNotReadableException</className>
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:536)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:555)
at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:531)
at com.avaya.sce.runtime.connectivity.restws.Axis2RestStub.run(Axis2RestStub.java:190)
at com.avaya.sce.runtime.connectivity.restws.Axis2RestStub.execute(Axis2RestStub.java:154)
at com.avaya.sce.runtime.connectivity.restws.CallService.execute(CallService.java:367)
at com.avaya.sce.runtime.Data.evaluateActions(Data.java:228)
etc...

Below is a sample response from the server that results in this exception:

{
"statusCode": "R"
"statusDescription": "User is registered"
"userExists": true
"registeredSites": [3]
0: "ACCTSERV"
1: "TELESERV"
2: "ESPONSOR"
-
}

I'm not sure what part of the response is causing the error, but is there a way to handle this in code to get the response. The output above is from the Advanced REST Client.

Also, some responses from the server for the same web service are fine so it appears to be an issue with the "1,2,3" listing - see following example:

{
"statusCode": "N"
"statusDescription": "Not found. User is not registered"
"userExists": false
"registeredSites": [0]
}

Any ideas on how this can be handled in the WSOP or in Java code?

Thanks
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
The Json data with the digits as the keys need to be wrapped in quotes:

"0": "ACCTSERV"
"1": "TELESERV"
"2": "ESPONSOR"

Does that invalid format come from OD?
B.Ritchie
Joined: Aug 26, 2014
Messages: 15
Offline
Below is the raw response that is returned from the web service. I mistakenly copied the formatted result from the Advanced REST Client instead of the raw response.

{
"statusCode": "R",
"statusDescription": "User is registered",
"userExists": true,
"registeredSites": ["ACCTSERV", "TELESERV", "ESPONSOR"]
}

I think this is valid JSON so I'm not sure why OD is not able to parse it.

Thanks,
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Interesting. Are you sure that is the same response OD is getting? It is not OD that can't parses it. It's the axis2 client that OD is using.
B.Ritchie
Joined: Aug 26, 2014
Messages: 15
Offline
Yes that is the response that is returned from the web service. I'm wondering if Axis isn't parsing correctly because of the boolean and JSONArray types returned in the response.

I created a servlet to do the web service call and parse the results, but would prefer using the built-in WSOP.

Thanks
Go to:   
Mobile view