[prev in list] [next in list] [prev in thread] [next in thread] 

List:       axis-user
Subject:    Re: Axis 1.1 Array Problems
From:       John Green <jggreenjr () yahoo ! com>
Date:       2005-04-28 16:55:57
Message-ID: 20050428165557.95439.qmail () web52007 ! mail ! yahoo ! com
[Download RAW message or body]

Anne,

Sorry to hit you directly, but I wanted to thank you
so very much for your response, I got a simple case to
work.  I changed the type to rpc/encoded and got an
array of strings and a class wrapping an array of
strings back. It is amazing that it was such a simple
fix.  

Of course I had to push the envelope and add an array
of a complex type.  Well once I did that, now I get a
problem with a missing serializer.  I modified the
mapping and deployment files, but not sure why it
cannot find the serializer.  I have attached the WSDL,
Bean, Mapping, and Deployment files.  I want to put
together a lessons learned post because it seems like
there is tons of hunting and pecking going on to try
and get this working.

Any insight into this you could provide would be quite
helpful.

Once again, thank you very much for your response and
look forward to seeing more posts from you.

Thanks,

John Green


 


--- Anne Thomas Manes <atmanes@gmail.com> wrote:
> Don't try to use rpc/literal with Axis 1.1.
> You have three choices:
> - use rpc/encoded
> - use document/literal (I suggest "wrapped" style)
> - upgrade to Axis 1.2
> 
> Anne
> 
> On 4/27/05, John Green <jggreenjr@yahoo.com> wrote:
> > All,
> > 
> > I am seeing lots of posts about problems with
> arrays.
> > Not sure what the solution is, the problem I am
> seeing
> > is that an array is being populated with many
> elements
> > on the server-side, but on the client I am only
> > getting the last element in the array.  I have
> tried
> > several things from changing the style and use in
> the
> > ant task, to wrapping the array in a class.  Here
> is
> > what is generated in the WDSL for the class that
> > contains the array.
> > <complexType name="ProviderArray">
> >     <sequence>
> >      <element name="providerArray" nillable="true"
> > type="impl:ArrayOf_tns1_Provider"/>
> >     </sequence>
> > </complexType>
> > <complexType name="GetProvidersResponse">
> >     <complexContent>
> >      <extension base="tns1:ResponseMessage">
> >       <sequence>
> >        <element name="providers" nillable="true"
> > type="tns1:ProviderArray"/>
> >       </sequence>
> >     </extension>
> > </complexContent>
> > </complexType>
> > <complexType name="ArrayOf_tns1_Provider">
> >     <complexContent>
> >      <restriction base="soapenc:Array">
> >       <attribute ref="soapenc:arrayType"
> > wsdl:arrayType="tns1:Provider[]"/>
> >      </restriction>
> >     </complexContent>
> > </complexType>
> > 
> > Can anyone give me some new suggestions to try? 
> Is
> > this a bug with the ant task?  Here is the ant
> task I
> > have setup:
> > <axis-java2wsdl
> >
>
classname="net.ussouth.incomm.postpay.webService.WebServiceFacadeEndpoint"
> >
>
namespace="http://net.ussouth.incomm.postpay.webService/"
> >
>
location="http://localhost:8080/ws4ee/services/WebServiceFacadeService"
> >             serviceElementName="WebServiceFacade"
> >            
> servicePortName="WebServiceFacadeEndpoint"
> >             style="rpc"
> >             use="literal"
> > output="${rsrc.home}/wsdl/WebServiceFacade.wsdl">
> > <classpath refid="classpath" />
> > </axis-java2wsdl>
> > 
> > Thanks,
> > 
> > John Green
> > 
> >
> 
["WSTestMapping.xml" (text/xml)]

<java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:impl="http://com.incomm.hello"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee \
http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd"  version="1.1">

    <package-mapping>
        <package-type>com.webservice.response</package-type>
        <namespaceURI>http://com.webservice.response</namespaceURI>
    </package-mapping>
    <java-xml-type-mapping>
        <java-type>com.webservice.response.ResponseBean</java-type>
        <root-type-qname \
xmlns:typeNS="http://response.webservice.com">typeNS:ResponseBean</root-type-qname>  \
<qname-scope>complexType</qname-scope>  <variable-mapping>
            <java-variable-name>strArray</java-variable-name>
            <xml-element-name>strArray</xml-element-name>
        </variable-mapping>
        <variable-mapping>
            <java-variable-name>strArray2</java-variable-name>
            <xml-element-name>strArray2</xml-element-name>
        </variable-mapping>
        <variable-mapping>
            <java-variable-name>complexResponses</java-variable-name>
            <xml-element-name>complexResponses</xml-element-name>
        </variable-mapping>
    </java-xml-type-mapping>
    <java-xml-type-mapping>
        <java-type>com.webservice.response.ResponseClass</java-type>
        <root-type-qname \
xmlns:typeNS="http://response.webservice.com">typeNS:ResponseClass</root-type-qname>  \
<qname-scope>complexType</qname-scope>  <variable-mapping>
            <java-variable-name>name</java-variable-name>
            <xml-element-name>name</xml-element-name>
        </variable-mapping>
        <variable-mapping>
            <java-variable-name>description</java-variable-name>
            <xml-element-name>description</xml-element-name>
        </variable-mapping>
    </java-xml-type-mapping>
</java-wsdl-mapping>


["ws4ee-deployment.xml" (text/xml)]

<deployment
    xmlns='http://xml.apache.org/axis/wsdd/'
    xmlns:java='http://xml.apache.org/axis/wsdd/providers/java'
    xmlns:soap='http://schemas.xmlsoap.org/soap/encoding/'
    xmlns:xsi='http://www.w3.org/2000/10/XMLSchema-instance'
    xmlns:xsd='http://www.w3.org/2001/XMLSchema'>

    <typeMapping
        qname='ns2:ResponseBean' xmlns:ns2='http://response.webservice.com'
        type='java:com.webservice.response.ResponseBean'
        serializer='org.apache.axis.encoding.ser.BeanSerializerFactory'
        deserializer='org.apache.axis.encoding.ser.BeanDeserializerFactory'
        encodingStyle=''
        />
    <typeMapping
        qname='ns2:StringArray' xmlns:ns2='http://response.webservice.com'
        type='java:com.webservice.response.StringArray'
        serializer='org.apache.axis.encoding.ser.BeanSerializerFactory'
        deserializer='org.apache.axis.encoding.ser.BeanDeserializerFactory'
        encodingStyle=''>
    </typeMapping>
    <typeMapping
        qname='ns2:ResponseClass' xmlns:ns2='http://response.webservice.com'
        type='java:com.webservice.response.ResponseClass'
        serializer='org.apache.axis.encoding.ser.BeanSerializerFactory'
        deserializer='org.apache.axis.encoding.ser.BeanDeserializerFactory'
        encodingStyle=''
        />
</deployment>

["WSTest.wsdl" (text/xml)]

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://com.webservice.sessionBean.wsTest/" \
xmlns:apachesoap="http://xml.apache.org/xml-soap" \
xmlns:impl="http://com.webservice.sessionBean.wsTest/" \
xmlns:intf="http://com.webservice.sessionBean.wsTest/" \
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" \
xmlns:tns1="http://response.webservice.com" \
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" \
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" \
xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <!--WSDL created by Apache Axis \
version: 1.2RC3 Built on Feb 28, 2005 (10:15:14 EST)-->
 <wsdl:types>
  <schema targetNamespace="http://response.webservice.com" \
xmlns="http://www.w3.org/2001/XMLSchema">  <import \
namespace="http://com.webservice.sessionBean.wsTest/"/>  <import \
namespace="http://schemas.xmlsoap.org/soap/encoding/"/>  <complexType \
name="ResponseClass">  <sequence>
     <element name="description" nillable="true" type="xsd:string"/>
     <element name="name" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
   <complexType name="StringArray">
    <sequence>
     <element name="stringArray" nillable="true" type="impl:ArrayOf_xsd_string"/>
    </sequence>
   </complexType>
   <complexType name="ResponseBean">
    <sequence>
     <element name="complexResponses" nillable="true" \
                type="impl:ArrayOf_tns1_ResponseClass"/>
     <element name="strArray" nillable="true" type="impl:ArrayOf_xsd_string"/>
     <element name="strArray2" nillable="true" type="tns1:StringArray"/>
    </sequence>
   </complexType>
  </schema>
  <schema targetNamespace="http://com.webservice.sessionBean.wsTest/" \
xmlns="http://www.w3.org/2001/XMLSchema">  <import \
namespace="http://response.webservice.com"/>  <import \
namespace="http://schemas.xmlsoap.org/soap/encoding/"/>  <complexType \
name="ArrayOf_tns1_ResponseClass">  <complexContent>
     <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:ResponseClass[]"/>
     </restriction>
    </complexContent>
   </complexType>
   <complexType name="ArrayOf_xsd_string">
    <complexContent>
     <restriction base="soapenc:Array">
      <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
     </restriction>
    </complexContent>
   </complexType>
  </schema>
 </wsdl:types>

   <wsdl:message name="createResponseResponse">

      <wsdl:part name="createResponseReturn" type="tns1:ResponseBean"/>

   </wsdl:message>

   <wsdl:message name="createResponseRequest">

   </wsdl:message>

   <wsdl:portType name="WSTestEndpoint">

      <wsdl:operation name="createResponse">

         <wsdl:input message="impl:createResponseRequest" \
name="createResponseRequest"/>

         <wsdl:output message="impl:createResponseResponse" \
name="createResponseResponse"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="WSTestEndpointSoapBinding" type="impl:WSTestEndpoint">

      <wsdlsoap:binding style="rpc" \
transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="createResponse">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="createResponseRequest">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" \
namespace="http://com.webservice.sessionBean.wsTest/" use="encoded"/>

         </wsdl:input>

         <wsdl:output name="createResponseResponse">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" \
namespace="http://com.webservice.sessionBean.wsTest/" use="encoded"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="WSTestBean">

      <wsdl:port binding="impl:WSTestEndpointSoapBinding" name="WSTestEndpoint">

         <wsdlsoap:address \
location="http://localhost/samples-server-ejb/WSTestBean"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>


["WSTestSessionBean.java" (application/octet-stream)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic