users@jax-rpc.java.net

Dynamic invocation interface custom objects

From: Srinath K <srinathk_at_aztecsoft.com>
Date: Wed, 16 Aug 2006 18:26:25 +0530

Hi All,

Iam a newbie to webservices jaxrpc.
Iam trying with a webservice method which accepts as a parameter a
custom object
When I tried to invoke using a standalone client using DII way I get an
error saying
"faultString: java.io.IOException: No serializer found for class
org.SampleModel in registry
org.apache.axis.encoding.TypeMappingDelegate_at_d9660d"

Can anyone let me know if iam missing anything

Thanks all in advance



My service interface looks something like this

1) public Collection sayHello(SampleModel model) throws RemoteException;

2) I generated wsdl and jaxrpc-mapping xml files using wscompile using
the command

wscompile -cp d:\test_workspace\test_workspace\bin
-gen:server -f:jaxbenumtype -d d:\META-INF\wsdl -mapping
d:\META-INF\sample-mapping.xml d:\config.xml

My config file looks like this

   <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">

    <service name="SampleWebService"
      targetNamespace="http://sample"
      typeNamespace="http://sample/types"
      packageName="org">
      <interface name="org.SampleInterface"/>
          <typeMappingRegistry>
          <additionalTypes>
            <class name="org.SampleModel" />
          </additionalTypes>
    </typeMappingRegistry>
    </service>

   </configuration>

And I deployed the ws in jboss

3) I have a standalone client whose code is
 ServiceFactory factory=ServiceFactory.newInstance();
        Service service=factory.createService(new
QName("SampleWebService"));
       
        QName port=new QName("SampleInterface");
        Call call=service.createCall(port);

call.setTargetEndpointAddress("http://localhost:8012/samplews/SampleWS")
;
        call.setProperty(Call.SOAPACTION_USE_PROPERTY,new
Boolean(true));
        call.setProperty(Call.SOAPACTION_URI_PROPERTY,"");

call.setProperty("javax.xml.rpc.encodingstyle.namespace.uri","http://sch
emas.xmlsoap.org/soap/encoding/");
       
        QName QNAME_TYPE_STRING =new
QName("http://www.w3.org/2001/XMLSchema", "collection");

call.setReturnType(QNAME_TYPE_STRING,java.util.Collection.class);
        call.setOperationName(new QName("http://sample","sayHello"));

call.addParameter("String_1",XMLType.XSD_QNAME,ParameterMode.IN);
        SampleModel model=new SampleModel();
        model.setId(12);
        model.setName("xyz");
        call.invoke(new Object[] {model});
        /*java.util.Collection col=(java.util.Collection)call.invoke(new
Object[] {model});
        System.out.println("Result "+col.size());



The information contained in, or attached to, this e-mail, contains confidential information and is intended solely for the use of the individual or entity to whom they are addressed and is subject to legal privilege. If you have received this e-mail in error you should notify the sender immediately by reply e-mail, delete the message from your system and notify your system manager. Please do not copy it for any purpose, or disclose its contents to any other person. The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company. The recipient should check this e-mail and any attachments for the presence of viruses. The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email.

www.aztecsoft.com