|
Hi,
I get similar problems as yours. But mine even worse. I
even cannot pass primitive types into the server side.
My relevant WSDL is like
<xsd:element name="monitorRequest"
type="xsd:string"/>
<xsd:element name="monitorResponse" type="xsd:string"/> Service PortType:
public java.lang.String
monitor(java.lang.String parameters) throws
java.rmi.RemoteException;
Client-side dynamic invocation: (Different from yours,
I added AddressingHeaders to the call object, in order for compliance
with WS-Addressing)
AddressingHeaders headers = new
AddressingHeaders();
headers.setTo(new To(url));
// pass the addressing info to the addressing
header
call.setProperty(Constants.ENV_ADDRESSING_REQUEST_HEADERS, headers); call.setTargetEndpointAddress(url); call.setOperationName(new QName(url, args[1])); Object ret = call.invoke(new Object[]{"anyArgs"}); System.out.println("1st ret: " + ret.toString()); The worse fact is that I will get error:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. And if i change the invocation line to
Object ret = call.invoke(new
Object[]{});
Then it runs without reporting error. The expected
return result was in SOAP response message, but the ret is null at the client
side.
Would
you like to test if your dynamic invocation works with primitive types?
PS: my
Axis version: Axis 1.2RC2 included with Globus Toolkit version 4.0.1.
Could
anybody point us a way out?
Regards,
Xinjun From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, August 29, 2005 8:08 PM To: [email protected] Subject: Call.invoke parameter not getting in server side Hi I am developing a module in wsdl and
axis. I have deployed the wsdl and I am writing the client to dynamically invoke
a method which contains some arguments/parameters. But I am not getting the
parameters correctly passed or seems like it is getting missed some
where. QName inputQName // QName of input
parameter QName returnQName // QName of
return type Inputparamaeterbeanclass
obj; All the necessary set methods are
called org.apache.axis.client.Service
service = new org.apache.axis.client.Service();
org.apache.axis.client.Call call =
(org.apache.axis.client.Call) service.createCall(); call.registerTypeMapping(beanclass
of input parameter, inputQName,
new org.apache.axis.encoding.ser.BeanSerializerFactory(beanclass of input
parameter, inputQName),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(beanclass of input
parameter, inputQName));
call.registerTypeMapping(AuthenticateResult.class,
returnQName,
new org.apache.axis.encoding.ser.BeanSerializerFactory(beanclass of return type,
returnQName),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(beanclass of return
type, returnQName)); call.setTargetEndpointAddress( new
java.net.URL(service url) ); call.setOperationName(operation
name); call.addParameter( "arg1",
inputQName, ParameterMode.IN ); call.setReturnType( returnQName
); Object resultObj =
call.invoke( new Object[] obj } ); After invoke
control is going to the correct method BindingImpl class. But in that method,
the get method of the argument is returning
null. Regards, Priya Ruby
Jose Associate
Consultant - Investment
Banking Group www.iflexsolutions.com/services/services.asp
i-flex solutions limited - Bangalore
Tel. Office: 91-80-5759-6868
e-mail:
[EMAIL PROTECTED] DISCLAIMER: |
