Hi,

I want to write a web service, that handles arrays of several types (please see attached WSDL file). I have written the web service with axis2 (databinding xmlbeans) and succeded with a client invoking the operations echoString, echoStringArray and echoStruct. The operations echoByteArray (handling base64Binary) and echoByteArray2 (handling a sequence of bytes) didn't work, throwing the following exception:

Exception in thread "main" org.apache.axis2.AxisFault: First Element must contain the local name, Envelope at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:81) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:356) at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294) at org.apache.axis2.userguide.axis2sampledoclit.Axis2SampleDocLitServiceStub.echoByteArray2(Axis2SampleDocLitServiceStub.java:975)
   at clients.TestClient.echoByteArray2(TestClient.java:66)
   at clients.TestClient.main(TestClient.java:81)
Caused by: org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:221) at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:179) at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:135) at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:163) at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:111) at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:474) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:142) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:77)
   ... 5 more

In using axis 1.4 none operation handling arrays succeeded.

What is wrong with the WSDL file and what do I have to do to make this work in axis 1.4 and axis2?

Cheers, Frank

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/";
	xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
	xmlns:tns="http://userguide.axis2.apache.org/Axis2SampleDocLit";
	xmlns:xsd="http://www.w3.org/2001/XMLSchema";
	xmlns:xsd1="http://userguide.axis2.apache.org/xsd";
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
	targetNamespace="http://userguide.axis2.apache.org/Axis2SampleDocLit";
	name="Axis2SampleDocLitService">
	<types>
		<schema targetNamespace="http://userguide.axis2.apache.org/xsd";
			xmlns="http://www.w3.org/2001/XMLSchema";
			xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
			elementFormDefault="qualified">
			<complexType name="ArrayOfstring_literal">
				<sequence>
					<element maxOccurs="unbounded" minOccurs="1"
						name="string" type="xsd:string" />
				</sequence>
			</complexType>
			<complexType name="SOAPStruct">
				<all>
					<element name="varFloat" type="xsd:float" />
					<element name="varInt" type="xsd:int" />
					<element name="varString" type="xsd:string" />
				</all>
			</complexType>
			<element name="echoStringParam" type="xsd:string" />
			<element name="echoIntParam" type="xsd:int" />
			<element name="echoStringReturn" type="xsd:string" />
			<element name="echoStringArrayParam"
				type="xsd1:ArrayOfstring_literal" />
			<element name="echoStringArrayReturn"
				type="xsd1:ArrayOfstring_literal" />
			<element name="echoStructParam" type="xsd1:SOAPStruct" />
			<element name="echoStructReturn" type="xsd1:SOAPStruct" />
		</schema>
		<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
			targetNamespace="http://userguide.axis2.apache.org/Axis2SampleDocLit";>
			<xsd:element name="in">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="byteArray"
							type="xsd:base64Binary">
						</xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="out">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="byteArray"
							type="xsd:base64Binary">
						</xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="in1">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="bytes" type="xsd:byte"
							maxOccurs="unbounded" minOccurs="0">
						</xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="out1">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="bytes" type="xsd:byte"
							maxOccurs="unbounded" minOccurs="0">
						</xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
		</xsd:schema>
	</types>
	<message name="echoString">
		<part name="a" element="xsd1:echoStringParam" />
	</message>
	<message name="echoStringResponse">
		<part name="result" element="xsd1:echoStringReturn" />
	</message>
	<message name="echoStringArray">
		<part name="a" element="xsd1:echoStringArrayParam" />
	</message>
	<message name="echoStringArrayResponse">
		<part name="result" element="xsd1:echoStringArrayReturn" />
	</message>
	<message name="echoStruct">
		<part name="a" element="xsd1:echoStructParam" />
	</message>
	<message name="echoStructResponse">
		<part name="result" element="xsd1:echoStructReturn" />
	</message>
	<message name="echoByteArrayRequest">
		<part name="echoByteArrayRequest" element="tns:in"></part>
	</message>
	<message name="echoByteArrayResponse">
		<part name="echoByteArrayResponse" element="tns:out"></part>
	</message>
	<message name="echoByteArray2Request">
		<part name="echoByteArray2Request" element="tns:in1"></part>
	</message>
	<message name="echoByteArray2Response">
		<part name="echoByteArray2Response" element="tns:out1"></part>
	</message>
	<portType name="Axis2SampleDocLitPortType">
		<operation name="echoString">
			<input name="echoString" message="tns:echoString" />
			<output name="echoStringResponse"
				message="tns:echoStringResponse" />
		</operation>
		<operation name="echoStringArray">
			<input name="echoStringArray" message="tns:echoStringArray" />
			<output name="echoStringArrayResponse"
				message="tns:echoStringArrayResponse" />
		</operation>
		<operation name="echoStruct">
			<input name="echoStruct" message="tns:echoStruct" />
			<output name="echoStructResponse"
				message="tns:echoStructResponse" />
		</operation>
		<operation name="echoByteArray">
			<input message="tns:echoByteArrayRequest"></input>
			<output message="tns:echoByteArrayResponse"></output>
		</operation>
		<operation name="echoByteArray2">
			<input message="tns:echoByteArray2Request"></input>
			<output message="tns:echoByteArray2Response"></output>
		</operation>
	</portType>
	<binding name="Axis2SampleDocLitPortBinding"
		type="tns:Axis2SampleDocLitPortType">


		<soap:binding style="document"
			transport="http://schemas.xmlsoap.org/soap/http"; />
		<operation name="echoString">


			<soap:operation
				soapAction="http://userguide.axis2.apache.org/Axis2SampleDocLit/echoString"; />
			<input name="echoString">

				<soap:body use="literal" />
			</input>
			<output name="echoStringResponse">

				<soap:body use="literal" />
			</output>
		</operation>
		<operation name="echoStringArray">


			<soap:operation
				soapAction="http://userguide.axis2.apache.org/Axis2SampleDocLit/echoStringArray"; />
			<input name="echoStringArray">

				<soap:body use="literal" />
			</input>
			<output name="echoStringArrayResponse">

				<soap:body use="literal" />
			</output>
		</operation>
		<operation name="echoStruct">


			<soap:operation
				soapAction="http://userguide.axis2.apache.org/Axis2SampleDocLit/echoStruct"; />
			<input name="echoStruct">

				<soap:body use="literal" />
			</input>
			<output name="echoStructResponse">

				<soap:body use="literal" />
			</output>
		</operation>
		<operation name="echoByteArray">
			<soap:operation
				soapAction="http://userguide.axis2.apache.org/Axis2SampleDocLit/echoByteArray"; />
			<input>
				<soap:body use="literal" />
			</input>
			<output>
				<soap:body use="literal" />
			</output>
		</operation>
		<operation name="echoByteArray2">
			<soap:operation
				soapAction="http://userguide.axis2.apache.org/Axis2SampleDocLit/echoByteArray2"; />
			<input>
				<soap:body use="literal" />
			</input>
			<output>
				<soap:body use="literal" />
			</output>
		</operation>
	</binding>
	<service name="Axis2SampleDocLitService">
		<port name="Axis2SampleDocLitPort"
			binding="tns:Axis2SampleDocLitPortBinding">
			<soap:address
				location="http://userguide.axis2.apache.org/stkv3/wsdl/Axis2SampleDocLit.wsdl"; />
		</port>
	</service>
</definitions>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to