axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepal Jayasinghe <dee...@opensource.lk>
Subject Re: Axis2/POJO: Caveats with data classes?
Date Tue, 08 May 2007 18:20:05 GMT
Hi Jeremy ,
by changing your SomeType  as shown below, I was able to fix the issue.

public class SomeType {
    public int foo;
    public int bar;
    public float baz;


    public int getFoo() {
        return foo;
    }

    public void setFoo(int foo) {
        this.foo = foo;
    }

    public int getBar() {
        return bar;
    }

    public void setBar(int bar) {
        this.bar = bar;
    }

    public float getBaz() {
        return baz;
    }

    public void setBaz(float baz) {
        this.baz = baz;
    }
}

> Martin Gainty wrote:
>
>> Hello Jeremy
>>
>> here is one an example which identifies a POJO named
>> sample.pojo.service.WeatherService.
>>    <parameter
>> name="ServiceClass">sample.pojo.service.WeatherService</parameter>
>>
> I did set up the services.xml, and the web service is fine except that
> the parameters are not being passed properly.
>
> I came up with this example to show what I'm doing; maybe someone can
> tell me where I went wrong.  There is one service class (BasicExample)
> and one auxiliary class that essentially functions as a struct (or a
> ComplexType in SOAP).
>
> //---------------BasicExample.java
>
> package guy.jeremy.examples;
>
> public class BasicExample
> {
>      public Boolean doomedToFail(SomeType parameter)
>    {
>        if(parameter == null)
>            return Boolean.FALSE;
>                  return Boolean.TRUE;
>    }
>      public BasicExample()
>    {
>          }
> }
> //-------------------------------------
>
> //-----------SomeType.java
>
> package guy.jeremy.examples;
>
> public class SomeType
> {
>    public Integer foo;
>    public Integer bar;
>    public Float baz;
> }
>
> //-----------------------------------
>
>
> I send this SOAP message:
>
> <soapenv:Envelope
>    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>   <soapenv:Body>
>      <ns:doomedToFail
>          xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>          xmlns:ns="http://examples.jeremy.guy/xsd"
>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>         <ns:param0>
>            <ns:baz>52.2</ns:baz>
>            <ns:bar>78</ns:bar>
>            <ns:foo>95</ns:foo>
>         </ns:param0>
>      </ns:doomedToFail>
>   </soapenv:Body>
> </soapenv:Envelope>
>
>
> and get back a "false", meaning the parameter was recieved as null
> even though it was clearly passed in.
>
>
> What am I doing wrong here?
>
>
> Thanks,
> Jeremy
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>

-- 
Thanks,
Deepal
................................................................
"The highest tower is built one brick at a time"



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message