Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   WebServices returning a java.util.Vector (http://www.velocityreviews.com/forums/t125875-webservices-returning-a-java-util-vector.html)

Espen Dietrichs 08-21-2003 01:03 PM

WebServices returning a java.util.Vector
 
I am trying to deploy a webservice that returns a java.util.Vector (using
IBM Websphere 5.0, the latest version of AXIS and J2EE 1.3).

I first tried the simpler case; a webservice returning an array. This
succeeded utilising the following wsdd file:

<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="AktiviteterWebService" provider="java:RPC">
<parameter name="className"
value="eqd.webservices.aktiviteter.AktiviteterWebS ervice"/>
<parameter name="allowedMethods" value="execute"/>
<beanMapping qname="ns:AktivitetDO"
xmlns:ns="urn:AktiviteterWebService"
languageSpecificType="java:eqd.webservices.aktivit eter.AktivitetDO"/>
<typeMapping qname="ns:AktivitetDOArray"
xmlns:ns="urn:AktiviteterWebService"
type="java:eqd.webservices.aktiviteter.AktivitetDO[]"
serializer="org.apache.axis.encoding.ser.ArraySeri alizerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDe serializerFactory"
encodingStyle=""/>
</service>
</deployment>

Modifying the webservice and the wsdd file now returning a java.util.Vector
(containing objects of the type AktivitetDO) gives the following
runtimeexception:

- Exception:
org.xml.sax.SAXException: No deserializer for
{urn:AktiviteterWebService}AktivitetDO
at org.apache.axis.client.Call.invoke(Call.java:2272)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at
localhost.WSAktiviteter_war.services.AktiviteterWe bService.AktiviteterWebSer
viceSoapBindingStub.execute(AktiviteterWebServiceS oapBindingStub.java:97)
at eqd3.webservice.TestAktiviteter.main(TestAktivitet er.java:65)
at eqd3.webservice.TestAktiviteter.main(TestAktivitet er.java:65)

The wsdd file looks like this:

<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="AktiviteterWebService" provider="java:RPC">
<parameter name="className"
value="eqd.webservices.aktiviteter.AktiviteterWebS ervice"/>
<parameter name="allowedMethods" value="execute"/>
<beanMapping qname="myNS:AktivitetDO" xmlns:myNS="urn:AktiviteterWebService"
languageSpecificType="java:eqd.webservices.aktivit eter.AktivitetDO"/>
<typeMapping
qname="ns:AktivitetDOVector" xmlns:ns="urn:AktiviteterWebService"
type="java:java.util.Vector"
serializer="org.apache.axis.encoding.ser.VectorSer ializerFactory"
deserializer="org.apache.axis.encoding.ser.VectorD eserializerFactory"
encodingStyle=""/>
</service>
</deployment>

The generated wsdl takes the following form:

<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions
targetNamespace="http://localhost:9080/WSAktiviteter_war/services/Aktivitete
rWebService" xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost:9080/WSAktiviteter_war/services/AktiviteterWebS
ervice"
xmlns:intf="http://localhost:9080/WSAktiviteter_war/services/AktiviteterWebS
ervice" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns1="urn:AktiviteterWebService"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:types>
- <schema targetNamespace="urn:AktiviteterWebService"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
- <complexType name="AktivitetDO">
- <sequence>
<element name="aktivitetstype" nillable="true" type="xsd:string" />
<element name="aktivitetsnummer" nillable="true" type="xsd:string" />
</sequence>
</complexType>
</schema>
- <schema targetNamespace="http://xml.apache.org/xml-soap"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
- <complexType name="Vector">
- <sequence>
<element maxOccurs="unbounded" minOccurs="0" name="item"
type="xsd:anyType" />
</sequence>
</complexType>
</schema>
</wsdl:types>
- <wsdl:message name="executeRequest">
<wsdl:part name="aktivitettype" type="xsd:string" />
</wsdl:message>
- <wsdl:message name="executeResponse">
<wsdl:part name="executeReturn" type="apachesoap:Vector" />
</wsdl:message>
- <wsdl:portType name="AktiviteterWebService">
- <wsdl:operation name="execute" parameterOrder="aktivitettype">
<wsdl:input message="impl:executeRequest" name="executeRequest" />
<wsdl:output message="impl:executeResponse" name="executeResponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="AktiviteterWebServiceSoapBinding"
type="impl:AktiviteterWebService">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="execute">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="executeRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost:9080/WSAktiviteter_war/services/AktiviteterWebSe
rvice" use="encoded" />
</wsdl:input>
- <wsdl:output name="executeResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost:9080/WSAktiviteter_war/services/AktiviteterWebSe
rvice" use="encoded" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="AktiviteterWebServiceService">
- <wsdl:port binding="impl:AktiviteterWebServiceSoapBinding"
name="AktiviteterWebService">
<wsdlsoap:address
location="http://localhost:9080/WSAktiviteter_war/services/AktiviteterWebSer
vice" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I guess the problem is related to the definition of the wsdd file and the
linkage (or lack of linkage) between the Vector and AktivititDO-object.

Happy for any feedback!

Regards,

Espen Dietrichs












All times are GMT. The time now is 08:46 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.