axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.che...@ascentialsoftware.com
Subject rpc/encoded standard interpretation
Date Wed, 05 Feb 2003 16:35:34 GMT
I have one or two questions related to the way to encode a SOAP encoded RPC
request, according to what the spec (soap and wsdl) are stating.

I realize that it is a pure SOAP standard related question, but I'd like to
have the opinion of the Axis developers on that one (as you guys spent more
time than me worrying about interoperability issues :-))

The mail seems a little long because I included WSDL and SOAP body examples.
The questions are at the end.

Let's imagine that I have the following WSDL:

<definitions name="AddressValidatorService" xmlns:tns="http://abc.com/"
targetNamespace="http://abc.com/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
	<types>
		<schema xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" targetNamespace="http://abc.com/">
			<complexType name="address">
				<sequence>
					<element name="city"
type="xsd:string"/>
					<element name="state"
type="xsd:string"/>
				</sequence>
			</complexType>
		</schema>
	</types>
	<message name="AddressValidatorRequest">
		<part name="id" type="xsd:string"/>
		<part name="address" type="tns:address"/>
	</message>
	<message name="AddressValidatorResponse">
		<part name="return" type="xsd:boolean"/>
	</message>
	<portType name="AddressValidatorPortType">
		<operation name="getValidateAddressResponse">
			<input message="tns:AddressValidatorRequest"/>
			<output message="tns:AddressValidatorResponse"/>
		</operation>
	</portType>
	<binding name="AddressValidatorBinding"
type="tns:AddressValidatorPortType">
		<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
		<operation name="getValidateAddressResponse">
			<soap:operation
soapAction="urn:validateAddressResponse"/>
			<input>
				<soap:body use="encoded"
namespace="urn:validateAddressResponse"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
			</input>
			<output>
				<soap:body use="encoded"
namespace="urn:validateAddressResponse"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
			</output>
		</operation>
	</binding>
	<service name="AddressValidatorService">
		<documentation>Receives address validation
response.</documentation>
		<port name="AddressValidatorPort"
binding="tns:AddressValidatorBinding">
			<soap:address location="http://abc.com/xyz"/>
		</port>
	</service>
</definitions>

Here is an example of a possible SOAP body for a request to the
getValidateResponse operation:

<soapenv:Body>
<ns1:getValidateAddressResponse
xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/
<http://schemas.xmlsoap.org/soap/encoding/> 
	
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 
xmlns:ns2=http://abc.com/ <http://abc.com/> 
				    xmlns:ns1="urn:validateAddressResponse"
 
xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/
<http://schemas.xmlsoap.org/wsdl/> 
 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
		<id xsi:type="xsd:string">1</id>
		<address xsi:type="ns2:address">
				<ns2:city
xsi:type="xsd:string">Boston</ns2:city>
				<ns2:state
xsi:type="xsd:string">MA</ns2:state>
		</address>
</ns1:getValidateAddressResponse>
</soapenv:Body> 

According to the statements of Section 7.1 of SOAP 1.1 spec (and probably a
couple of other things from the WSDL 1.1 spec as well), here are some
explanations/questions related to the above SOAP body structure:

1.	The getValidateAddressResponse element is in the namespace
urn:validateAddressResponse since it is the value of the namespace attribute
of the soap:body element in the input message of this operation in the soap
binding. Is it the way it is supposed to be?

2.	The address element has an attribute xsi:type referencing the
address type of the schema with the correct namespace. But what should be
(for maximum interoperability and/or from the standard point of view) the
namespace of this element? Should it be the same as the namespace used in
the xsi:type attribute value (http://abc.com/ <http://abc.com/> ) or should
it be the namespace indicated by the namespace attribute of the soap:body
element in the input message of the soap binding? 

3.	Each sub-element of the address element are qualified with the
http://abc.com <http://abc.com>  namespace since, according to the schema in
the types section, sub-elements must be fully qualified
(elementFormDefault="qualified"). It sounds reasonable from a pure XML
schema point of view, but when looking at the rules for encoding types in
XML (SOAP 1.1 spec), it seems that it can/should be different (in some ways
that I am not able to figure ....).

Thanks in advance for any help.

Thomas

Mime
View raw message