axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Reif" <Ben.R...@cgi-ams.com>
Subject RE: wsdd <operation> - How do I represent return type of List?
Date Mon, 19 Dec 2005 18:09:20 GMT
Fair enough, seems like that's probably the more "correct" thing to do anyway. Especially in
regards to interoperability. Thanks again for your help.

Ben

-----Original Message-----
From: iksrazal [mailto:iksrazal@gmail.com] 
Sent: Monday, December 19, 2005 11:56 AM
To: axis-user@ws.apache.org
Subject: Re: wsdd <operation> - How do I represent return type of List?

IMHO, run like hell from java.util.List . List - as well as Vector and Map which are _not_
part of the spec. Here's the supported types - google for a better mapping if you like: 

http://e-docs.bea.com/wls/docs90/webserv/data_types.html

Notice how weblogic deprecated all those Collection types. That's the trend. 

My strong recommendation is to use Arrays. Convert your List to arrays like
so: 

List.toArray() ; 

Convert your arrays to list like so: 

List myList = Arrays.asList(myArray);

In your wsdl just do something like: 

<element name="informarServicoList">
        <complexType>
          <sequence>
            <element name="soap_session_id" type="xsd:string"/>
            <element name="web_user_name" type="xsd:string"/>
            <element name="Matricula" type="xsd:string"/>
            <element name="RATList"  minOccurs="0" maxOccurs="unbounded" 
type="xsd:string"/>
          </sequence>
        </complexType>
      </element>

Sorry about the português, the main point here is RATList . wsdl2java will allow you to create
an API something like this: 

    public  ReturnWebBaseDocument informarServicoList(
            InformarServicoListDocument informarServicoListDocument) {
            //Todo fill this with the necessary business logic
           ...
           String [] ratArray = informarServicoList.getRATListArray();
            List < String > ratList = Arrays.asList(ratArray);
            // do business logic here...
            ratList.add(new String("1"));
            // convert for return: 
            informarServicoList.setRATListArray(ratList.toArray(new
String[ratList.size()]));

That's the way to be compatible with .net . Anything using java.util.list directly I can't
help with. 

HTH,
iksrazal


Em Segunda 19 Dezembro 2005 15:09, o Ben Reif escreveu:
> Iksrazal,
>
> Did you just create your own <typeMapping> for java.util.List and then 
> use reflection in the serializer/deserializer class to call the 
> individual serializers/deserializers for the objects inside the List?
> Also, how did you implement the writeSchema() method? Did you have it 
> generate a complex type definition for a wrapper object like ListOfxxx?
> Any issues with interoperability with things like .Net?
>
> Thanks,
> Ben
>
> -----Original Message-----
> From: trebor iksrazal [mailto:iksrazal@yahoo.com]
> Sent: Friday, December 16, 2005 7:26 PM
> To: axis-user@ws.apache.org
> Subject: Re: wsdd <operation> - How do I represent return type of List?
>
> Anne actuallly helped me with 'List of complex type objects' a couple 
> days ago. I've done what you describe alot with 'rpc encoded', but the 
> future is pointing to doc / lit, as you seem to be using anyways
>
>
> http://marc.theaimsgroup.com/?l=axis-user&m=113459148202564&w=2
>
> I've got it about 99% working at this point. I might be able to help 
> more code wise should you get stuck.
>
> HTH,
> iksrazal
>
> --- Anne Thomas Manes <atmanes@gmail.com> wrote:
> > Ben,
> >
> > For better interoperability, you should convert your list into an 
> > array.
> >
> > See
> > http://www.osmoticweb.com/axis-wsdd/operation.htm
> > for documentation of
> > the WSDD <operation> definition.
> >
> > name = the name of the Java method
> > qname = the qname of the element that represents the method name in 
> > XML returnQName = the qname of the element that represents the 
> > return value in XML returnType = the XML type of the element that 
> > represents the return value
> >
> > Anne
> >
> > On 12/16/05, Ben Reif <Ben.Reif@cgi-ams.com> wrote:
> > > I'm using Axis 1.3 to create document / literal
> >
> > style services, so as I
> >
> > > understand it, I need to be more declarative in my
> >
> > wsdd file and define the
> >
> > > operations. I have a method in my service that
> >
> > returns a List of complex
> >
> > > type objects. In reading through the documentation
> >
> > I need to set the name,
> >
> > > qname, returnQName, and returnType attributes.
> >
> > Something like:
> > > <operation name="query" qname="?" returnQName="?"
> >
> > returnType="?">
> >
> > > I also noticed in the WSDDConstants class there
> >
> > were constants defined for
> >
> > > returnItemQName, returnItemType, itemQName, and
> >
> > itemType attributes, but
> >
> > > there is no mention of them in the documentation.
> >
> > Can anyone explain how to
> >
> > > represent a List of complex types as either an
> >
> > input parameter or a return
> >
> > > parameter in the <operation> tag? Also, what's the
> >
> > difference between qname,
> >
> > > returnQName and the returnType (which could also
> >
> > be a QName maybe?).
> >
> > > Thanks a bunch,
> > > Ben
>
> "None are more hopelessly enslaved than those who falsely believe they 
> are free. -- Goethe"
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com

Mime
View raw message