• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

webservice help

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I ame trying to expose some API's as a web-service.
The approach I am following is :
1) JWSDP_1.0 (Java Web Service Developer Pack, can run on any j2ee server)- JAX-RPC approach
2) xrpcc tool (comes with JWSDP)- generates stubs, ties and WSDL file using the config.xml file, interface file and implementation file.

I have tried to expose the service with primitive types and String as a parameter as well return type. Runs fine.
But I am facing problem for Classes.(Vector, HashTable....UserDefined class etc as an argument and return type).

For Vector as a return type, error is :
xrpcc-server:
[echo] Running xrpcc for the server....D:\DAM/lib/contmgmt.jar :\DAM/lib/logger.jar :\DAM/lib/errorhandler.jar
[exec] error: invalid type for JAX-RPC structure: java.util.Vector
[exec] 1 error
[exec] Result: 1

So I modified the config.xml file required for xrpcc tool like this :

<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://java.sun.com/jax-rpc-ri/xrpcc-config">
<rmi name="TestService1" targetNamespace="http://dam.org/wsdl" typeNamespace="http://dam.org/types">
<service name="TestService1" packageName="net.etouch.contmgmt.dam">
<interface name="net.etouch.contmgmt.dam.ContIF" servantName="net.etouch.contmgmt.dam.ContentManager"/>
</service>
<!-- Addition here -->
<typeMappingRegistry>
<typeMapping encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<entry schemaType="ns1:java.util.Vector" javaType="java.util.Vector"
serializerFactory="org.apache.axis.encoding.ser.VectorSerializerFactory"
deserializerFactory="org.apache.axis.encoding.ser.VectorDeserializerFactory"
xmlns:ns1="http://dam.org/types"/>
</typeMapping>
</typeMappingRegistry>
</rmi>
</configuration>

I have supplied here the VecorSerializerFactory class from apache 'axis' project. But this class is not as per the jwsdp specs as its giving error. b'cos this class is using its own interfaces, classes and not implementing javax.xml.rpc.encoding.Serializer.
We want to implement the (de)serialiser classes for above stated classes (Vector, HashTable .. Employee etc) which will implement javax.xml.rpc.encoding.Serializer interface. We did not get any sample java code where javax....Serializer interface is implemented. Searched for sample code as we didn't know what is required in method implementations though its an application specific implementation.

Is there any way to do this?

pls help....

Regards
Simon



--------------------------------------------------------------------------------
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (www.grisoft.com).
Version: 6.0.265 / Virus Database: 137 - Release Date: 7/18/2001
 
reply
    Bookmark Topic Watch Topic
  • New Topic