Author Message
RandySchuster
Joined: Mar 7, 2014
Messages: 65
Offline

I have a web service that cannot be accessed from a wsop.

The problem field is a Java object which returns an array of custom types, see below.

Attempting to access any of the lineOfBusiness[0] fields or members produces a null exception.

import connectivity.ws.beans.validateReferringLegacyProvider2.ProviderValidationStub.LinesOfBusinessType;
import connectivity.ws.beans.validateReferringLegacyProvider2.ProviderValidationStub.LineOfBusinessType;

...

LinesOfBusinessType linesOfBusiness = (LinesOfBusinessType)mySession.getVariable(IProjectVariables.LINE_OF_BUSINESS_4).getSimpleVariable().getObjectValue();
LineOfBusinessType[] lineOfBusiness = linesOfBusiness.getLineOfBusiness();

Other fields in the xml response are parsed correctly but this fields values cannot be accessed.

These values are nested so the xml looks something like

<linesOfBusiness>
<lineOfBusiness>LOB1</lineOfBusiness>
<lineOfBusiness>LOB2</lineOfBusiness>
</linesOfBusiness>
RandySchuster
Joined: Mar 7, 2014
Messages: 65
Offline

Okay think I fixed this on another one by having both the input and output parameters be unexpanded Java objects and completely parsing the inputs and outputs in servlet.

The example that isn't working has the input with one simple Java object and the output is expanded where all but one of the output fields are mapped to voice application variable and only one is a Java object.

I'll see if I can testing it with one Java object for input and one for output.
RandySchuster
Joined: Mar 7, 2014
Messages: 65
Offline
Unfortunately this web service does not work when using a single Java object for the input and output with a wsop file.

05/06/2014 16:41:00:603 DEBUG - 1AA8B02E83F133C581047AEB3E6B410A:/referral_fe : Web Service Reply <- (what appeared to be a valid reply)
05/06/2014 16:41:00:650 DEBUG - 1AA8B02E83F133C581047AEB3E6B410A:/referral_fe : Web Service Reply <- null
05/06/2014 16:41:00:650 ERROR - 1AA8B02E83F133C581047AEB3E6B410A:/referral_fe : Got AxisFault during web service call: null

This service will have to be accessed without using a wsop file.

Would you like to see the XML?
RandySchuster
Joined: Mar 7, 2014
Messages: 65
Offline

This is a known problem?

Was hoping for some feedback.

SamareshKowshik
Joined: Nov 6, 2013
Messages: 351
Offline
First, sorry about such a late response. We seem to have let this post slip through the cracks. Assuming you still are having issues, I have a couple of questions.

So, you have a web service that returns a complex response, and the response isn't being properly translated into OD variables. To fix this, you tried to use a Java object, which means OD does not translate the response into variables but leaves it for you to parse in a servlet. But trying this, you found that the response was, null? Or nonexistant? Or it didn't parse correctly? The trace you have seems to indicate no response was sent back at all, but I also see that it's been modified slightly. And it looks like there are two replies:


05/06/2014 16:41:00:603 DEBUG - 1AA8B02E83F133C581047AEB3E6B410A:/referral_fe : Web Service Reply <- (what appeared to be a valid reply)
05/06/2014 16:41:00:650 DEBUG - 1AA8B02E83F133C581047AEB3E6B410A:/referral_fe : Web Service Reply <- null


Another question, when you created the WSOP, on the second page of the wizard, did you select to Unwrap the parameters or did you not Unwrap them? Have you tried both options? It does have an impact on what OD does to the XML and is a separate operation from the Java object choice.

Finally, if nothing works, then you might have to create the client using Java rather than the WSOP. This isn't so much an issue with OD, but instead sometimes a web service just isn't completely compatible. If this is the case, and you need help with writing the Java let us know and we can provide a template. Also, if you are able to provide the WSDL, I can take a look at it and try and reproduce things on my end.
Go to:   
Mobile view