Hi

I'm new to Axis2, and i've developed a soap web service using Eclipse
Helios integration with Axis2 and tomcat. I've tried searching the mailing
list but no solution seemed to address my problem. This is why i send this
email since i don't know what to do anymore! :(

I'm trying to pass a string of array to the following web service function:

package pt.uc.dei.MyWebService;

public class MyWebService {
//other functions ignored
(...)

    public int getArray(String[]result) {
       return (result.length);
   }
}

The WSDL generated is attached with this email (it has definitions of other
operations but getArray is the one with the problem)


However when i use SOAPUI to generate a client. The default request that
SoapUI generate is:

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";<http://schemas.xmlsoap.org/soap/envelope/>xmlns:myw=
"http://MyWebService.dei.uc.pt"; <http://mywebservice.dei.uc.pt/>>
    <soapenv:Header/>
         <soapenv:Body>
           <myw:getArray>
                <myw:result>?</myw:result>
           </myw:getArray>
         </soapenv:Body>
</soapenv:Envelope>


I've edited the soap envelop tag, and the request content inside result tag
it in order to support an array like this:

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";<http://schemas.xmlsoap.org/soap/envelope/>
xmlns:xsd="http://www.w3.org/2001/XMLSchema";<http://www.w3.org/2001/XMLSchema>xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance";<http://www.w3.org/2001/XMLSchema-instance>xmlns:SOAP-ENC=
"http://schemas.xmlsoap.org/soap/encoding/";<http://schemas.xmlsoap.org/soap/encoding/>xmlns:myw=
"http://MyWebService.dei.uc.pt"; <http://mywebservice.dei.uc.pt/>>
<soapenv:Header/>
  <soapenv:Body>
    <myw:getArray>
         <myw:result>
            <param SOAP-ENC:arrayType="xsd:string[4]" >
                 <item xsi:type="xsd:string">Egypt</item>
                 <item xsi:type="xsd:string">Amsterdam</item>
                 <item xsi:type="xsd:string">Lisbon</item>
                 <item xsi:type="xsd:string">Paris</item>
            </param>
         </myw:result>
    </myw:getArray>
  </soapenv:Body>
</soapenv:Envelope>

However the response i get from the getArray operation is :

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";<http://schemas.xmlsoap.org/soap/envelope/>>

   <soapenv:Body>
      <ns:getArrayResponse
xmlns:ns="http://MyWebService.dei.uc.pt";<http://mywebservice.dei.uc.pt/>>

          <ns:return>1</ns:return>
      </ns:getArrayResponse>
   </soapenv:Body>
</soapenv:Envelope>


It seems like the array of strings is being converted to one dimensional
empty Array, and i'm not receiving the strings inside the soap array from
the request.

Can anyone provide me what is causing this and if my request is being built
correctly?

Best Regards
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:ns1="http://org.apache.axis2/xsd"; xmlns:ns="http://MyWebService.dei.uc.pt"; xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"; xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"; targetNamespace="http://MyWebService.dei.uc.pt";>
    <wsdl:documentation>
		Please Type your service description here
	</wsdl:documentation>
    <wsdl:types>
        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://MyWebService.dei.uc.pt";>
            <xs:element name="getConcatenation">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="s" nillable="true" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="getConcatenationResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="getCircumference">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="r" type="xs:double"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="getCircumferenceResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="return" type="xs:double"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="getArray">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element maxOccurs="unbounded" minOccurs="0" name="result" nillable="true" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="getArrayResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="return" type="xs:int"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="getArea">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="r" type="xs:double"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="getAreaResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="return" type="xs:double"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:schema>
    </wsdl:types>
    <wsdl:message name="getAreaRequest">
        <wsdl:part name="parameters" element="ns:getArea"/>
    </wsdl:message>
    <wsdl:message name="getAreaResponse">
        <wsdl:part name="parameters" element="ns:getAreaResponse"/>
    </wsdl:message>
    <wsdl:message name="getArrayRequest">
        <wsdl:part name="parameters" element="ns:getArray"/>
    </wsdl:message>
    <wsdl:message name="getArrayResponse">
        <wsdl:part name="parameters" element="ns:getArrayResponse"/>
    </wsdl:message>
    <wsdl:message name="getConcatenationRequest">
        <wsdl:part name="parameters" element="ns:getConcatenation"/>
    </wsdl:message>
    <wsdl:message name="getConcatenationResponse">
        <wsdl:part name="parameters" element="ns:getConcatenationResponse"/>
    </wsdl:message>
    <wsdl:message name="getCircumferenceRequest">
        <wsdl:part name="parameters" element="ns:getCircumference"/>
    </wsdl:message>
    <wsdl:message name="getCircumferenceResponse">
        <wsdl:part name="parameters" element="ns:getCircumferenceResponse"/>
    </wsdl:message>
    <wsdl:portType name="MyWebServicePortType">
        <wsdl:operation name="getArea">
            <wsdl:input message="ns:getAreaRequest" wsaw:Action="urn:getArea"/>
            <wsdl:output message="ns:getAreaResponse" wsaw:Action="urn:getAreaResponse"/>
        </wsdl:operation>
        <wsdl:operation name="getArray">
            <wsdl:input message="ns:getArrayRequest" wsaw:Action="urn:getArray"/>
            <wsdl:output message="ns:getArrayResponse" wsaw:Action="urn:getArrayResponse"/>
        </wsdl:operation>
        <wsdl:operation name="getConcatenation">
            <wsdl:input message="ns:getConcatenationRequest" wsaw:Action="urn:getConcatenation"/>
            <wsdl:output message="ns:getConcatenationResponse" wsaw:Action="urn:getConcatenationResponse"/>
        </wsdl:operation>
        <wsdl:operation name="getCircumference">
            <wsdl:input message="ns:getCircumferenceRequest" wsaw:Action="urn:getCircumference"/>
            <wsdl:output message="ns:getCircumferenceResponse" wsaw:Action="urn:getCircumferenceResponse"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="MyWebServiceSoap11Binding" type="ns:MyWebServicePortType">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http"; style="document"/>
        <wsdl:operation name="getArea">
            <soap:operation soapAction="urn:getArea" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="getArray">
            <soap:operation soapAction="urn:getArray" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="getConcatenation">
            <soap:operation soapAction="urn:getConcatenation" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="getCircumference">
            <soap:operation soapAction="urn:getCircumference" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="MyWebServiceSoap12Binding" type="ns:MyWebServicePortType">
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"; style="document"/>
        <wsdl:operation name="getArea">
            <soap12:operation soapAction="urn:getArea" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="getArray">
            <soap12:operation soapAction="urn:getArray" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="getConcatenation">
            <soap12:operation soapAction="urn:getConcatenation" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="getCircumference">
            <soap12:operation soapAction="urn:getCircumference" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="MyWebServiceHttpBinding" type="ns:MyWebServicePortType">
        <http:binding verb="POST"/>
        <wsdl:operation name="getArea">
            <http:operation location="getArea"/>
            <wsdl:input>
                <mime:content type="text/xml" part="parameters"/>
            </wsdl:input>
            <wsdl:output>
                <mime:content type="text/xml" part="parameters"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="getArray">
            <http:operation location="getArray"/>
            <wsdl:input>
                <mime:content type="text/xml" part="parameters"/>
            </wsdl:input>
            <wsdl:output>
                <mime:content type="text/xml" part="parameters"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="getConcatenation">
            <http:operation location="getConcatenation"/>
            <wsdl:input>
                <mime:content type="text/xml" part="parameters"/>
            </wsdl:input>
            <wsdl:output>
                <mime:content type="text/xml" part="parameters"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="getCircumference">
            <http:operation location="getCircumference"/>
            <wsdl:input>
                <mime:content type="text/xml" part="parameters"/>
            </wsdl:input>
            <wsdl:output>
                <mime:content type="text/xml" part="parameters"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="MyWebService">
        <wsdl:port name="MyWebServiceHttpSoap11Endpoint" binding="ns:MyWebServiceSoap11Binding">
            <soap:address location="http://localhost:8080/MyWebService/services/MyWebService.MyWebServiceHttpSoap11Endpoint/"/>
        </wsdl:port>
        <wsdl:port name="MyWebServiceHttpSoap12Endpoint" binding="ns:MyWebServiceSoap12Binding">
            <soap12:address location="http://localhost:8080/MyWebService/services/MyWebService.MyWebServiceHttpSoap12Endpoint/"/>
        </wsdl:port>
        <wsdl:port name="MyWebServiceHttpEndpoint" binding="ns:MyWebServiceHttpBinding">
            <http:address location="http://localhost:8080/MyWebService/services/MyWebService.MyWebServiceHttpEndpoint/"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org
For additional commands, e-mail: java-user-h...@axis.apache.org

Reply via email to