Simple Java/Webservices/Axis Question

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
}
);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top