axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Russell Butek" <bu...@us.ibm.com>
Subject Re: INOUT parameter with user-defined class ?
Date Fri, 18 Jan 2002 16:16:10 GMT
Look at the operation in rpc-style pseudo-code:

Customer zoekCustomer(IN String shortname, INOUT Customer customer);

Is this really what you want?  Is this method supposed to have both a
returned Customer AND an inout Customer?  I suspect you really want

void zoekCustomer(IN String shortname, INOUT Customer customer);

If this is true, then you don't want to call setReturnType (or you call it
with a null).

If I guessed wrong and you really do want the return, then could you
provide the NullPointerException stack trace?

Russell Butek
butek@us.ibm.com


Beukering Jack <Jack.Beukering@icl.nl> on 01/18/2002 08:43:17 AM

Please respond to axis-user@xml.apache.org

To:   "Axis-User (E-mail)" <axis-user@xml.apache.org>
cc:
Subject:  INOUT parameter with user-defined class ?



I'm trying to serialize a self-made class with the beanserializer. As an
input parameter it function's fine, but used for the return type or as an
INOUT type I get a nullpointer exception. Can anyone please help me, what
am
I doing wrong?

My service has the following signature:
    public Customer zoekCustomer ( Customer c) throws Exception {

This is what I do in the client using an INOUT parameter:

        Customer c = new Customer();
        Service  service = new Service();
        Call     call    = (Call) service.createCall();
        QName    qn      = new QName( "urn:Willow", "customer" );
        c.setShortName("ICL");
        call.addSerializer(Customer.class, qn,new
BeanSerializer(Customer.class));
        call.addDeserializerFactory(qn, Customer.class,
BeanSerializer.getFactory());
        Object result;
        try {
            call.setTargetEndpointAddress(  new
URL("http://localhost:4040/axis/services/willow-service") );
            call.setProperty( Call.NAMESPACE, "willow-service" );
            call.setOperationName( "zoekCustomer" );
            call.setReturnType( new XMLType(qn) );
            //call.addParameter("shortname",
XMLType.XSD_STRING,Call.PARAM_MODE_IN);
            call.addParameter("customer",new
XMLType(qn),Call.PARAM_MODE_INOUT);

            result = call.invoke( new Object[] {c});



> * Email:     jack.beukering@icl.nl
> * Tel:          +31(0)346 598477
> * Mobile:    +31(0)6 53492931
> * Fax:         +31(0)346 598
>
>



Mime
View raw message