Hello,
I have a webservice method that returns to me a User object which is a bean
like class have getters and setters for fields like firstname, lastname,
password.

My deploy.wsdd looks like this
<deployment xmlns="http://xml.apache.org/axis/wsdd/";
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>

 <service name="TestWs" provider="java:RPC">
  <parameter name="className" value="com.ardec.ebf.test.TestWebService"/>
  <parameter name="allowedMethods" value="*"/>

  <beanMapping qname="myNS:User" xmlns:myNS="urn:TestWebService"
               languageSpecificType="java:com.ardec.ebf.usermgr.User"/>
 </service>

</deployment>

and the client call is as follows

String endpoint = http://localhost:8080/usermgr/services/TestWs
Service  service = new Service();
Call     call    = (Call) service.createCall();

call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName( "getObject" );

QName    qn      = new QName( "urn:TestWebService", "User" );

call.registerTypeMapping(User.class, qn,
                      new
org.apache.axis.encoding.ser.BeanSerializerFactory(User.class, qn),
                      new
org.apache.axis.encoding.ser.BeanDeserializerFactory(User.class, qn));

call.setReturnType(qn);

User usr = (User) call.invoke( new Object [] {});


Now when I run this class to call the service and get me the user object I
get the following error

- Could not convert java.lang.String to bean field 'password', type
java.lang.String
    [junit] - Exception:
    [junit] java.lang.NullPointerException
    [junit]  at org.apache.axis.encoding.ser.BeanPropertyTarget.set(Unknown
Source)
    [junit]  at
org.apache.axis.encoding.DeserializerImpl.valueComplete(Unknown Source)
    [junit]  at org.apache.axis.encoding.DeserializerImpl.endElement(Unknown
Source)
    [junit]  at
org.apache.axis.encoding.DeserializationContextImpl.endElement(Unknown
Source)
    [junit]  at org.apache.axis.message.SAX2EventRecorder.replay(Unknown
Source)
    [junit]  at
org.apache.axis.message.MessageElement.publishToHandler(Unknown Source)
    [junit]  at
org.apache.axis.encoding.DeserializerImpl.startElement(Unknown Source)
    [junit]  at
org.apache.axis.encoding.DeserializationContextImpl.startElement(Unknown
Source)
    [junit]  at org.apache.axis.message.SAX2EventRecorder.replay(Unknown
Source)
    [junit]  at
org.apache.axis.message.MessageElement.publishToHandler(Unknown Source)
    [junit]  at org.apache.axis.message.RPCElement.deserialize(Unknown
Source)
    [junit]  at org.apache.axis.message.RPCElement.getParams(Unknown Source)
    [junit]  at org.apache.axis.client.Call.invoke(Unknown Source)
    [junit]  at org.apache.axis.client.Call.invoke(Unknown Source)
    [junit]  at org.apache.axis.client.Call.invoke(Unknown Source)
    [junit]  at com.ardec.ebf.test.TestWsClient.testGetObject(Unknown
Source)
    [junit]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [junit]  at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
    [junit]  at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
    [junit]  at java.lang.reflect.Method.invoke(Method.java:324)
.
.
.
.

I have tried to follow the example 5 and I know there are many of you who
have tried to return a Java object from the webservice. Please check my wsdd
and client class. What am I doing wrong here. Please help me.

Thanks a lot
Vaishakhi

----- Original Message -----
From: "Lasker, Kory" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 26, 2002 2:53 PM
Subject: RE: URGENT


>
>   So, do both client and server need to have access to the IDENTICAL java
> class specified in the WSDD in the bean mapping for complexType objects?
>
>   Thanks,
>   Kory
>
> -----Original Message-----
> From: Chris Haddad [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 26, 2002 2:01 PM
> To: [EMAIL PROTECTED]
> Subject: RE: URGENT
>
>
> Patricia -
>
> We need more information to help.
>
> The WSDL and WSDD files for your service deployment may assist to
> provide a clue.
>
> One wag, the package does always have to be accessible by the
> Classloader running in your servlet container.
>
> Second wag, your WSDD defining the typemapping is invalid.
>
> Have you gotten any of the Axis samples to work?  Example5 demonstrate
> bean deserialization.....
>
> /Chris

Reply via email to