Author Message
MichaelDailous_deprecated
Joined: Nov 11, 2013
Messages: 171
Offline
Our WSDL has defined the web service return as a complex object. After the web service operation executes, when I issue the getObjectValue() method on the IVariableField or ISimpleVariable object, the return type is "String", and I can't convert that object to the correct return object.

Michael
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
When you map parameters in the WSOP wizard, did you remember to check "Use Java Obj" for the parameter?
MichaelDailous_deprecated
Joined: Nov 11, 2013
Messages: 171
Offline
Yes... LOL I did select "Use Java Object". I've attached a screenshot showing the WSOP with the return object defined as "SearchResult", which is class included in the stub. When I try to retrieve the value after the WSOP has executed, I'm using "mySession.getVariable(...).getSimpleVariable().getObjectValue()", and when I try to cast it to the SearchResult object, a ClassCastException is thrown saying a String cannot be cast to SearchResult. If I bypass the WSOP and execute the operation directly from a servlet, I get the correct result returned.

10/03/2017 06:38:00:261 INFO - B8613B3BBE61816617D84A412765F1E1:/WsTest : Capturing exception [java.lang.ClassCastException]. Message [java.lang.String cannot be cast to connectivity.ws.beans.ITSMAdapterWSImplServiceStub$SearchResponse]
10/03/2017 06:38:00:262 ERROR - B8613B3BBE61816617D84A412765F1E1:/WsTest : java.lang.ClassCastException: java.lang.String cannot be cast to connectivity.ws.beans.ITSMAdapterWSImplServiceStub$SearchResponse
at flow.ParseItsmResult.servletImplementation(ParseItsmResult.java:55)

I have a working demo that shows the problem, but I can't post it here [sensitive data]. Let me know where I should send it.

Also, I'm using Orchestration Designer 7.1, Java 8, and Tomcat 8... if that matters. :)
  • [Thumb - Wsop.png]
[Disk] Download
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
Object o = mySession.getVariable(...).getSimpleVariable().getObjectValue();
System.out.println( o.getClass().getName());

What do you see?
MichaelDailous_deprecated
Joined: Nov 11, 2013
Messages: 171
Offline
java.lang.String
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
Interesting. Did you also print out the value of the String?
MichaelDailous_deprecated
Joined: Nov 11, 2013
Messages: 171
Offline
Nothing exciting...

Value is []
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
Okay we are getting somewhere. For some reason the web service is not returning a real result and instead returning an empty string.
MichaelDailous_deprecated
Joined: Nov 11, 2013
Messages: 171
Offline
Unfortunately, that's not true. I have soap traces turned on, and I can see the Web Service Request xml and the Web service Response xml. It's even in the log. So... I'm getting data.

If I immediately execute the wsop manually, by calling ITSM...Stub.search(...) method, I can process the return object correctly.

Again, I have a working example with hard-coded values that you can execute in your environment. I just can't post it here due to content sensitivity.
RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
you can email to yakulis@avaya.com . Alternatively you can just make the WS call from Java. Since you are using the use java obj you will have to write java anyway to pull data outof the returned value and store into OD varaibles.
Go to:   
Mobile view