Simple Java/Webservices/Axis Question

Discussion in 'Java' started by thomas.fuller@gmail.com, Jan 28, 2005.

  1. Guest

    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
    }
    );
     
    , Jan 28, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. andreikov

    myeclipse webservices axis

    andreikov, Dec 20, 2004, in forum: Java
    Replies:
    0
    Views:
    1,546
    andreikov
    Dec 20, 2004
  2. Replies:
    0
    Views:
    940
  3. Elhanan
    Replies:
    1
    Views:
    3,978
    iksrazal
    Mar 16, 2005
  4. ed
    Replies:
    2
    Views:
    430
    Mike Schilling
    Dec 8, 2006
  5. pramodr
    Replies:
    0
    Views:
    655
    pramodr
    May 6, 2009
Loading...

Share This Page