parser

Написать ответ на текущее сообщение

 

 
   команды управления поиском

Ответ

virusav 13.03.2015 10:53

Вот тестовый WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
		xmlns:soap12bind="http://schemas.xmlsoap.org/wsdl/soap12/"
		xmlns:soapbind="http://schemas.xmlsoap.org/wsdl/soap/"
		xmlns:tns="NS"
		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
		xmlns:xsd1="NS1"
		xmlns:xsd2="NS2"
		xmlns:xsd3="NS3"
		name="NS"
		targetNamespace="NS">
	<types>
		<xs:schema xmlns:tns="NS3"
				xmlns:xs="http://www.w3.org/2001/XMLSchema"
				targetNamespace="NS3"
				attributeFormDefault="unqualified"
				elementFormDefault="qualified">
			<xs:complexType name="Type1">
				<xs:sequence>
					<xs:element name="Param1"
							type="xs:integer"
							nillable="true"/>
					<xs:element name="Param2"
							type="xs:string"
							nillable="true"/>
				</xs:sequence>
			</xs:complexType>
		</xs:schema>
		<xs:schema xmlns:tns="NS2"
				xmlns:xs="http://www.w3.org/2001/XMLSchema"
				targetNamespace="NS2"
				attributeFormDefault="unqualified"
				elementFormDefault="qualified">
			<xs:complexType name="Type2">
				<xs:sequence>
					<xs:element name="Param1"
							type="xs:string"/>
				</xs:sequence>
			</xs:complexType>
		</xs:schema>
		<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
				xmlns:xs1="NS3"
				xmlns:xs2="NS2"
				xmlns:xs3="NS1"
				targetNamespace="NS"
				elementFormDefault="qualified">
			<xs:import namespace="NS3"/>
			<xs:import namespace="NS2"/>
			<xs:element name="Operation1">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="Param1"
								type="xs1:Type1"/>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
			<xs:element name="Operation1Response">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="return"
								type="xs2:Type2"/>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
		</xs:schema>
	</types>
	<message name="Operation1RequestMessage">
		<part name="parameters"
				element="tns:Operation1"/>
	</message>
	<message name="Operation1ResponseMessage">
		<part name="parameters"
				element="tns:Operation1Response"/>
	</message>
	<portType name="PortType1">
		<operation name="Operation1">
			<input message="tns:Operation1RequestMessage"/>
			<output message="tns:Operation1ResponseMessage"/>
		</operation>
	</portType>
	<binding name="SoapBinding1"
			type="tns:PortType1">
		<soapbind:binding style="document"
				transport="http://schemas.xmlsoap.org/soap/http"/>
		<operation name="Operation1">
			<soapbind:operation style="document"
					soapAction="NS#NS1:Operation1"/>
			<input>
				<soapbind:body use="literal"/>
			</input>
			<output>
				<soapbind:body use="literal"/>
			</output>
		</operation>
	</binding>
	<binding name="Soap12Binding1"
			type="tns:PortType1">
		<soap12bind:binding style="document"
				transport="http://schemas.xmlsoap.org/soap/http"/>
		<operation name="Operation1">
			<soap12bind:operation style="document"
					soapAction="NS#NS1:Operation1"/>
			<input>
				<soap12bind:body use="literal"/>
			</input>
			<output>
				<soap12bind:body use="literal"/>
			</output>
		</operation>
	</binding>
	<service name="NS">
		<port name="Soap1"
				binding="tns:SoapBinding1">
			<documentation> 
				<wsi:Claim xmlns:wsi="http://ws-i.org/schemas/conformanceClaim/"
						conformsTo="http://ws-i.org/profiles/basic/1.1"/>
			</documentation>
			<soapbind:address location="URL1"/>
		</port>
		<port name="Soap121"
				binding="tns:Soap12Binding1">
			<soap12bind:address location="URL2"/>
		</port>
	</service>
</definitions>
В вашем примере xs3:element, а в моем везде xs:element.

Для Operation1 мне нужно получить Param1=Type1 и xs1=NS3, чтобы знать, откуда брать тип.