Hello Tom,

anonymous wrote : 
  | Once again do not use soap encoding, use document/literal or rpc/literal. 
Arrays need to be nested in a javabean in order to work properly. 
  | 
I did what you've recommended and for datatypes like int, string and my complex 
type Animal it works. But for arrays it does not work.

What did I wrong?

Here is my new wsdl-file (rpc/literal)

  | <?xml version="1.0" encoding="UTF-8"?>
  | <wsdl:definitions targetNamespace="http://Hello";
  | xmlns:impl="http://Hello"; xmlns:intf="http://Hello"; 
  | xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"; 
  | xmlns:apachesoap="http://xml.apache.org/xml-soap"; 
  | xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; 
  | xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
  | xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
  | xmlns="http://schemas.xmlsoap.org/wsdl/";>
  | <!--WSDL created by Apache Axis version: 1.2
  | Built on May 03, 2005 (02:20:24 EDT)-->
  |  <wsdl:types>
  |   <schema xmlns="http://www.w3.org/2001/XMLSchema"; 
targetNamespace="http://Hello";>
  |    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
  |    <complexType name="Animal">
  |     <sequence>
  |      <element name="age" type="xsd:int"/>
  |      <element name="name" nillable="true" type="xsd:string"/>
  |     </sequence>
  |    </complexType>
  |    <complexType name="ArrayOfAnimal">
  |     <sequence>
  |      <element name="item" type="impl:Animal" minOccurs="0" 
maxOccurs="unbounded"/>
  |     </sequence>
  |    </complexType>
  |    <complexType name="AnimalArray">
  |     <sequence>
  |      <element name="animalArray" nillable="true" type="impl:ArrayOfAnimal"/>
  |     </sequence>
  |    </complexType>
  |   </schema>
  |  </wsdl:types>
  |    <wsdl:message name="createAnimalResponse">
  |       <wsdl:part name="createAnimalReturn" type="impl:Animal"/>
  |    </wsdl:message>
  |    <wsdl:message name="greetAnimalRequest">
  |       <wsdl:part name="in0" type="impl:Animal"/>
  |    </wsdl:message>
  |    <wsdl:message name="sayRoarRequest">
  |       <wsdl:part name="in0" type="xsd:string"/>
  |    </wsdl:message>
  |    <wsdl:message name="getAnimalsResponse">
  |       <wsdl:part name="getAnimalsReturn" type="impl:AnimalArray"/>
  |    </wsdl:message>
  |    <wsdl:message name="getAnimalsRequest">
  |    </wsdl:message>
  |    <wsdl:message name="greetAnimalResponse">
  |       <wsdl:part name="greetAnimalReturn" type="xsd:string"/>
  |    </wsdl:message>
  |    <wsdl:message name="sayRoarResponse">
  |       <wsdl:part name="sayRoarReturn" type="xsd:string"/>
  |    </wsdl:message>
  |    <wsdl:message name="createAnimalRequest">
  |       <wsdl:part name="in0" type="xsd:string"/>
  |       <wsdl:part name="in1" type="xsd:int"/>
  |    </wsdl:message>
  |    <wsdl:portType name="AnimalEndpoint">
  |       <wsdl:operation name="sayRoar" parameterOrder="in0">
  |          <wsdl:input name="sayRoarRequest" message="impl:sayRoarRequest"/>
  |          <wsdl:output name="sayRoarResponse" 
message="impl:sayRoarResponse"/>
  |       </wsdl:operation>
  |       <wsdl:operation name="greetAnimal" parameterOrder="in0">
  |          <wsdl:input name="greetAnimalRequest" 
message="impl:greetAnimalRequest"/>
  |          <wsdl:output name="greetAnimalResponse" 
message="impl:greetAnimalResponse"/>
  |       </wsdl:operation>
  |       <wsdl:operation name="createAnimal" parameterOrder="in0 in1">
  |          <wsdl:input name="createAnimalRequest" 
message="impl:createAnimalRequest"/>
  |          <wsdl:output name="createAnimalResponse" 
message="impl:createAnimalResponse"/>
  |       </wsdl:operation>
  |       <wsdl:operation name="getAnimals">
  |          <wsdl:input name="getAnimalsRequest" 
message="impl:getAnimalsRequest"/>
  |          <wsdl:output name="getAnimalsResponse" 
message="impl:getAnimalsResponse"/>
  |       </wsdl:operation>
  |    </wsdl:portType>
  |    <wsdl:binding name="AnimalEndpointPortSoapBinding" 
type="impl:AnimalEndpoint">
  |       <wsdlsoap:binding style="rpc" 
transport="http://schemas.xmlsoap.org/soap/http"/>
  |       <wsdl:operation name="sayRoar">
  |          <wsdlsoap:operation soapAction=""/>
  |          <wsdl:input name="sayRoarRequest">
  |             <wsdlsoap:body use="literal" namespace="http://Hello"/>
  |          </wsdl:input>
  |          <wsdl:output name="sayRoarResponse">
  |             <wsdlsoap:body use="literal" namespace="http://Hello"/>
  |          </wsdl:output>
  |       </wsdl:operation>
  |       <wsdl:operation name="greetAnimal">
  |          <wsdlsoap:operation soapAction=""/>
  |          <wsdl:input name="greetAnimalRequest">
  |             <wsdlsoap:body use="literal" namespace="http://Hello"/>
  |          </wsdl:input>
  |          <wsdl:output name="greetAnimalResponse">
  |             <wsdlsoap:body use="literal" namespace="http://Hello"/>
  |          </wsdl:output>
  |       </wsdl:operation>
  |       <wsdl:operation name="createAnimal">
  |          <wsdlsoap:operation soapAction=""/>
  |          <wsdl:input name="createAnimalRequest">
  |             <wsdlsoap:body use="literal" namespace="http://Hello"/>
  |          </wsdl:input>
  |          <wsdl:output name="createAnimalResponse">
  |             <wsdlsoap:body use="literal" namespace="http://Hello"/>
  |          </wsdl:output>
  |       </wsdl:operation>
  |       <wsdl:operation name="getAnimals">
  |          <wsdlsoap:operation soapAction=""/>
  |          <wsdl:input name="getAnimalsRequest">
  |             <wsdlsoap:body use="literal" namespace="http://Hello"/>
  |          </wsdl:input>
  |          <wsdl:output name="getAnimalsResponse">
  |             <wsdlsoap:body use="literal" namespace="http://Hello"/>
  |          </wsdl:output>
  |       </wsdl:operation>
  |    </wsdl:binding>
  |    <wsdl:service name="AnimalEndpointService">
  |       <wsdl:port name="AnimalEndpointPort" 
binding="impl:AnimalEndpointPortSoapBinding">
  |          <wsdlsoap:address 
location="http://this.value.is.replaced.by.jboss"/>
  |       </wsdl:port>
  |    </wsdl:service>
  | </wsdl:definitions>
  | 

my Animal class looks like:

  | public class Animal {
  |     private String name;
  |     private int age;
  | 
  | ... constructor/setters/getters
  | 

According to the wiki 
http://wiki.jboss.org/wiki/Wiki.jsp?page=WSArrayTypeMapping my AnimalArray 
looks like:

  | public class AnimalArray {
  | 
  |     private Animal[] animalArray;
  |     
  |     public Animal[] getAnimalArray() { 
  |             return animalArray; 
  |     }
  |     
  |     public void setAnimalArray(Animal[] animalArray) { 
  |             this.animalArray = animalArray; 
  |     }
  | }
  | 

I made a new JavaBean for my animal-array but during the test following error 
appeared:


  | AxisFault
  |  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
  |  faultSubcode: 
  |  faultString: org.xml.sax.SAXException: Invalid element in 
testing.ArrayOfAnimal - age
  |  faultActor: 
  |  faultNode: 
  |  faultDetail: 
  |     {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: 
Invalid element in testing.ArrayOfAnimal - age
  |     at 
org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:260)
  |     at 
org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:1040)
  |     at 
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198)
  |     at 
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:856)
  |     at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:235)
  |     at org.apache.axis.message.RPCElement.getParams(RPCElement.java:349)
  | 

What did I wrong? I hope you can help me again. 

Thanks in advance,
Alex

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3880752#3880752

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3880752


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to