T
thomas.fuller
Hi, thanks in advance for your feedback.
I'm using Apache Axis to do some webservices stuff and I'm still rather
new to this.
I'm writing an example program and I have everything working, except
for one small piece.
I used java2wsdl in order to generate the stub/skel code for an
interface that contains a method that has the following signature:
public int writeCheck(float in0, Recipient in1)
My problem is as follows: I'm not sure how to invoke this method due to
the Recipient object. The following code demonstrates how far I've
gotten -- if you can point out what I've done wrong (I think it is the
second addParameter method invocation), I will very much appreciate it.
QName recipientQName = new QName("urn:bank", "ns:Recipient");
Service service = new Service();
Call call = (Call) service.createCall();
call.setUsername( "user1" );
call.setPassword( "pass1" );
call.setTargetEndpointAddress( url );
call.setOperationName(
new QName ("CheckingAccount", "writeCheck") );
call.addParameter(
"amount", XMLType.XSD_FLOAT, ParameterMode.IN
);
call.addParameter(
"recipient", recipientQName, Recipient.class, ParameterMode.IN
);
call.setReturnType(XMLType.XSD_INT);
Float amount = new Float (100);
Recipient recipient = new Recipient ();
recipient.setRecipient("thomas");
Integer ret = (Integer)call.invoke(
new Object[] {
amount, recipient
}
);
I'm using Apache Axis to do some webservices stuff and I'm still rather
new to this.
I'm writing an example program and I have everything working, except
for one small piece.
I used java2wsdl in order to generate the stub/skel code for an
interface that contains a method that has the following signature:
public int writeCheck(float in0, Recipient in1)
My problem is as follows: I'm not sure how to invoke this method due to
the Recipient object. The following code demonstrates how far I've
gotten -- if you can point out what I've done wrong (I think it is the
second addParameter method invocation), I will very much appreciate it.
QName recipientQName = new QName("urn:bank", "ns:Recipient");
Service service = new Service();
Call call = (Call) service.createCall();
call.setUsername( "user1" );
call.setPassword( "pass1" );
call.setTargetEndpointAddress( url );
call.setOperationName(
new QName ("CheckingAccount", "writeCheck") );
call.addParameter(
"amount", XMLType.XSD_FLOAT, ParameterMode.IN
);
call.addParameter(
"recipient", recipientQName, Recipient.class, ParameterMode.IN
);
call.setReturnType(XMLType.XSD_INT);
Float amount = new Float (100);
Recipient recipient = new Recipient ();
recipient.setRecipient("thomas");
Integer ret = (Integer)call.invoke(
new Object[] {
amount, recipient
}
);