Author Message
ValeriyPolikarpov
Joined: Jan 12, 2015
Messages: 19
Offline
Hi Guys !
I'm experiencing some problems with web service that i'm trying to implement in my project . I've done a lot of Axis web services , and all are working well , but when doing next one, i've got an error "Unexpected format of web service client for avayaVPServices. Could not find method to invoke the service"
Could anyone know , what can cause this error ?

thanks for replies


WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Where do you see this error? Can you post some logs or screenshot?
ValeriyPolikarpov
Joined: Jan 12, 2015
Messages: 19
Offline
I can see this error in the console during testing application in OD simulator .When the call is calling this web service , OD generates an error:

17/03/2015 21:33:32:204 INFO - 39DE140ACB31260EF8377696EDD01555:/Testapp : Capturing exception [javax.servlet.ServletException]. Message [ EXCEPTION>
com.avaya.sce.runtimecommon.SCERuntimeException: Unexpected format of web serivce client for avayaVPServices. Could not find method to invoke the service.


I've tried to call this web service from SOAPUI tool , so its working there ......


Thanks a lot !
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Can you post the wsdl file for the web service?
ValeriyPolikarpov
Joined: Jan 12, 2015
Messages: 19
Offline
Hi Wilson !

You can find it in attachment .

The problem accrues when im executing setRoamingAVP method .


Thanks,
Filename wsdl.txt [Disk] Download
SamareshKowshik
Joined: Nov 6, 2013
Messages: 351
Offline
Which method are you trying to invoke? That error shows up before the client tries to make the connection, so it should show up for me, even though I don't have access to your web service. I've tried a couple methods and the only error I get is that I can't access the server.
ValeriyPolikarpov
Joined: Jan 12, 2015
Messages: 19
Offline
Hello Samaresh

Im trying to invoke setRoamingAVP method . Unfortunately this is our internal server , wich not available from public internet .


Thanks
SamareshKowshik
Joined: Nov 6, 2013
Messages: 351
Offline
The easiest way to get around this is to recreate your WSOP, but instead choose Use Document Wrapping. Then, when choosing Input and Output parameters, select the Use Java Object option and select a simple variable, or allow the wizard to do it for you. Then, in the Data node calling the web service, you can set the object using the following:


@Override
public void requestBegin(com.avaya.sce.runtimecommon.SCESession mySession) {
super.requestBegin(mySession);

SetRoamingAVP avp = new SetRoamingAVP("msisdn", Boolean.TRUE);
mySession.getVariableField(IProjectVariables.SET_ROAMING_AVP).setValue(avp);
}


Doing this cleared the exception and allowed the web service to get called. For completeness, I've provided an explanation below of what is actually happening. You needn't read it, but it might be useful for people.


EXPLANATION OF THE PROBLEM:
The problem is kind of complicated, but also slightly out of my hands to fix, at least in an easy way. Essentially, the setRoamingAVP method requires two arguments, a java.lang.String and a java.lang.Boolean. Setting those values works fine, but when it tries to find setRoamingAVP with those arguments exactly, it fails. The reason is, Java unboxes the Boolean object automatically, but the find method used by Java Reflection doesn't autobox. This is a known issue. It might have been fixed in more recent versions, but in Java 5, used by anything prior to OD 7, this shortcoming exists. One solution is to override the findMethod() method used by Reflection. The other would be to use one of the custom objects Axis creates, as in the above solution.
ValeriyPolikarpov
Joined: Jan 12, 2015
Messages: 19
Offline
Hi Samaresh

Im trying to include your code to the web service .

In the "super.requestBegin(mySession);" string , i ve got an error :

The method requestBegin(SCESession) is undefined for the type CallService
What else i have to include in the web service java code ?


Thanks for help
ValeriyPolikarpov
Joined: Jan 12, 2015
Messages: 19
Offline
Hi Sam ,
Im sorry , that a 've didn't replay to you at the time .
When im including this code to the DataNode , i got this error during debugging application .

event="error.runtime.com.avaya.sce.runtimecommon.VariableTypeException" message="Error processing request, com.avaya.sce.runtimecommon.VariableTypeException: Cannot access complex variable as simple variable

What elese can be wrong ?

thanks for help
SamareshKowshik
Joined: Nov 6, 2013
Messages: 351
Offline
Basically, that happens when you try and use a complex variable like a field or a simple variable. For example, if you have a complex variable named "Return" and it has a bunch of fields, and you write this line to access it:


IVariableField returnVar = mySession.getVariableField(IProjectVariables.RETURN);


You will get that error because the variable Return is not a field or simple. To properly access it, you would have to write:


IVariable returnVar = mySession.getVariable(IProjectVariables.RETURN);


You can then access the fields with something like this:


IVariableField field = returnVar.getComplexVariable().getField("FieldNameHere");


There are also methods which let you list out the field names, or get an array of all the fields, etc. The above isn't the only way to access a complex variable field in code, though, but if you get a complex var object you can do other things too, like creating a collection.

Hopefully that clears it up!
ValeriyPolikarpov
Joined: Jan 12, 2015
Messages: 19
Offline
Hi Sam ,
Regarding to your code , which previously provided



@Override
public void requestBegin(com.avaya.sce.runtimecommon.SCESession mySession) {
super.requestBegin(mySession);

SetRoamingAVP avp = new SetRoamingAVP("msisdn", Boolean.TRUE);
mySession.getVariableField(IProjectVariables.SET_ROAMING_AVP).setValue(avp);
}



The error happens in the


mySession.getVariableField(IProjectVariables.SET_ROAMING_AVP).setValue(avp);

string



This examples wich you written in the last message , describing getVariablesField
But, how can i define setVariablesField?

Many thanks for help!









RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline
Once you have an IVariableField, you can use get and set methods on that.

What error are you seeing?
ValeriyPolikarpov
Joined: Jan 12, 2015
Messages: 19
Offline
Hi Ross ,

I mean this error :


event="error.runtime.com.avaya.sce.runtimecommon.VariableTypeException" message="Error processing request, com.avaya.sce.runtimecommon.VariableTypeException: Cannot access complex variable as simple variable


I tried to insert and combine all codes which Sam provided for me
And now its look like this:


@Override
public void requestBegin(com.avaya.sce.runtimecommon.SCESession mySession) {
super.requestBegin(mySession);

SetRoamingAVP avp = new SetRoamingAVP("msisdn", Boolean.TRUE);
IVariable returnVar = mySession.getVariable(IProjectVariables.SET_ROAMING_AVP);
IVariableField field = returnVar.getComplexVariable().getField(IProjectVariables.SET_ROAMING_AVP);
field.setValue(avp);
mySession.putVariable((IVariable) field);
System.out.println("requestBegin roaming_disconnect_ws");


But when i debugging application, it stops in field.setValue(avp);
This error generated by OD :

event="error.runtime.java.lang.NullPointerException" message="Error processing request, java.lang.NullPointerException"/>



It is difficult to understand what else i should do or what im doing wrong .... ..... :(










RossYakulis
Joined: Nov 6, 2013
Messages: 2652
Offline



@Override
public void requestBegin(com.avaya.sce.runtimecommon.SCESession mySession) {
super.requestBegin(mySession);

SetRoamingAVP avp = new SetRoamingAVP("msisdn", Boolean.TRUE);
IVariable returnVar = mySession.getVariable(IProjectVariables.SET_ROAMING_AVP);
if (return.Var.isComplex() == true ) {
IComplexVariable cx = returnVar.getComplexVariable();
IVariableField field = cx.getField(IProjectVariables.SET_ROAMING_AVP);
field.setValue(avp);
} else {
IVariableField field = returnVar.getSimpleVariable();
field.setValue(avp);
}
System.out.println("requestBegin roaming_disconnect_ws");

Go to:   
Mobile view