axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave <>
Subject [AXIS1.3] Service method returns null while it should return a object?
Date Mon, 27 Feb 2006 21:49:12 GMT
Hi all,

For a school assignment, we have to use axis. We have deployed a webservice
succesfully but it doesnt return the correct value. First of all, the
webservice is ok, the beanmappings are fine, everything thats has to be in
the code and in the deploy.wsdd file is present. So there is nothing wrong
with any of those. The problem that occures is the following:

There's a class Tour with the folowing attributes and constructor:
    private long id;
    private String name;
    private Welcome welcome;
    public Tour(long id, String name, Welcome welcome)

The class Welcome has the folowing attributes and constructor:
    private long id;
    private String title;
    private String text;
    private byte[] picture;
    public Welcome(String title, String text, byte[] picture)

We run a service that does the following when you call it:
    Welcome w=new Welcome("title welcome", "text welcome", null);
    return new Tour(0, "name tour", w);

When we deploy this service and try to use it with a client everything goes
fine. In our client we recieve an object of the class Tour with all the data
present. There's an object Welcome in the object Tour with the title, test,
and null for the figure (it's just testdata).

Now we adjust the service:
    return new Tour(0, "name tour", null);

Here the problem occures. Suddenly our client recieves null for the object
Tour... We enabled the soap monitor to track the SOAP message, and the soap
message looks fine, there's an object of the class Tour and the String 'name
tour' and the id '0' is present in the message. Also the null of the Welcome
object is present, something like 'nil=true' is in the soap message for the
Welcome part. The class Welcome is nillable (as we can see in the wsdl
created by axis).
It is pretty strange that axis suddenly returns null for the Tour object
because one of its params is null...

Is there somebody who has experience with this problem or can help us out
cause we don't have a clue what the problem could be this time.

We had the same problem with a TestObjectService (a row of objects turns
null because one of the params of those objects is null)... How can this

thanks in advance
Dave and Fre

View raw message