axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmon...@attbi.com
Subject RE: HOW to pass Vector acrross to published service
Date Fri, 13 Sep 2002 14:47:44 GMT
I can't imagine that a Vector would be a supported type
to move across Web Services.  If it were, there would
have to be a custom serializer and I don't think the
behavior would be as you expect.

One of the big problems is that the contents of the
Vector would probably have to be identified as JavaBeans
themselves with bean descriptors in the WSDD file since
the WSDL file must contain complex types to allow clients
to generate JavaBeans from the complex types.

I haven't seen any reason to believe the whole path is
supported.  Perhaps you could either 
- write a custom serializer
- flatten your object design to pass typed arrays back
and forth

(frankly, i'd try the second approach).

Of course, I could be wrong :-)

The important thing is to acknowledge that a client OTHER
than Java can attach to your web service, what does a
vector mean to them?  Absolutely nothing...what would a
vector mean to a C program, or Python.  The more explicit
typing you can do the better, IMHO.

Paul Monday
> Hi,
> 	james thanks for respondng
> I am using wsdd to deploy across to server.	wsdl is automatically
> generated.
> While I am returning vector thru the service I am getting foll exception
> 
> I am doing 		
> 	call.setReturnType( new QName("http://xml.apache.org/xml-soap",
> "java.util.Vector"));
> 
> Sep 13, 2002 7:55:59 PM org.apache.axis.client.Call invoke
> SEVERE: Exception:
> org.xml.sax.SAXException: Bad types (null -> class java.util.Vector)
>         at
> org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:207)
>         at
> org.apache.axis.encoding.DeserializationContextImpl.startElement(Deseria
> lizationContextIm
> pl.java:857)
>         at
> org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:
> 199)
>         at
> org.apache.axis.message.MessageElement.publishToHandler(MessageElement.j
> ava:644)
>         at
> org.apache.axis.message.RPCElement.deserialize(RPCElement.java:235)
>         at
> org.apache.axis.message.RPCElement.getParams(RPCElement.java:259)
>         at org.apache.axis.client.Call.invoke(Call.java:1806)
>         at org.apache.axis.client.Call.invoke(Call.java:1711)
>         at org.apache.axis.client.Call.invoke(Call.java:1251)
>         at TestClient.main(TestClient.java:148)
> 
> Thanks
> Mahindra
> 
> 
> -----Original Message-----
> From: James Black [mailto:jblack@ieee.org] 
> Sent: Friday, September 13, 2002 7:08 PM
> To: axis-user@xml.apache.org
> Subject: Re: HOW to pass Vector acrross to published service
> 
> 
> Mahindra K wrote:
> 
> >  Hi,    I am in a fix as to how to pass accross vectors to the
> > service.    Please direct me to some links or mail me piece of code
> > which might help
> > meThanksMahindra 
> >
> --------------------------------------------------------------------Mahi
> ndra
> > KCisco Systems Inc. ODC.
> > Zensar Technologies Limited.
> > Mile Post# 4,
> > Nagar Road, Pune.
> > Ph: 6633001 - 612E-Mail:
> >
> mkshirsa@cisco.com------------------------------------------------------
> -----------------------------
> 
>   At the moment I don't think it is going to work, but my client did
> compile. I am concerned because it uses anyType, but here is how
> java2wsdl handled by Vector.
> 
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://xml.apache.org/xml-soap">
>   <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
> - <complexType name="Vector">
> - <sequence>
>   <element name="item" minOccurs="0" maxOccurs="unbounded"
> type="xsd:anyType" />
>   </sequence>
>   </complexType>
>   <element name="Vector" nillable="true" type="apachesoap:Vector" />
>   </schema>
> 
> So, here is one usage:
>  <wsdl:message name="lookupCollegesResponse4">
>   <wsdl:part name="lookupCollegesReturn" type="apachesoap:Vector" />
>   </wsdl:message>
> 
> Some other data: xmlns:apachesoap="http://xml.apache.org/xml-soap"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:tns1="http://persons.epic.acomp.usf.edu"
> 
>   Hope this helps.
> 
> 

Mime
View raw message