如何从wsdl文件中获取名称空间,方法,soap_action

时间:2014-06-23 09:23:09

标签: web-services soap wsdl soap-client

我有一个WSDL文件,显示如下:

<wsdl:definitions targetNamespace="urn:sap-com:document:sap:rfc:functions"><wsdl:documentation><sidl:sidl/></wsdl:documentation><wsp:UsingPolicy wsdl:required="true"/><wsp:Policy wsu:Id="BN__binding"><wsp:ExactlyOne><wsp:All><sapattahnd:Enabled>false</sapattahnd:Enabled><saptrnbnd:OptimizedMimeSerialization wsp:Optional="true"/><wsaw:UsingAddressing wsp:Optional="true"/><wsp:All><sp:TransportBinding><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sp:HttpBasicAuthentication/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All><wsp:All><sapattahnd:Enabled>false</sapattahnd:Enabled><saptrnbnd:OptimizedXMLTransfer uri="http://xml.sap.com/2006/11/esi/esp/binxml" wsp:Optional="true"/><wsaw:UsingAddressing wsp:Optional="true"/><wsp:All><sp:TransportBinding><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sp:HttpBasicAuthentication/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All></wsp:ExactlyOne></wsp:Policy><wsp:Policy wsu:Id="BN__binding_soap12"><wsp:ExactlyOne><wsp:All><sapattahnd:Enabled>false</sapattahnd:Enabled><saptrnbnd:OptimizedMimeSerialization wsp:Optional="true"/><wsaw:UsingAddressing wsp:Optional="true"/><wsp:All><sp:TransportBinding><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sp:HttpBasicAuthentication/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All><wsp:All><sapattahnd:Enabled>false</sapattahnd:Enabled><saptrnbnd:OptimizedXMLTransfer uri="http://xml.sap.com/2006/11/esi/esp/binxml" wsp:Optional="true"/><wsaw:UsingAddressing wsp:Optional="true"/><wsp:All><sp:TransportBinding><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sp:HttpBasicAuthentication/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All></wsp:ExactlyOne></wsp:Policy><wsp:Policy wsu:Id="IF__ztm_ws_get_emp_holidays"><wsp:ExactlyOne><wsp:All><sapsession:Session><sapsession:enableSession>false</sapsession:enableSession></sapsession:Session><sapcentraladmin:CentralAdministration wsp:Optional="true"><sapcentraladmin:BusinessApplicationID>005056AC6E191ED3979A90345DADF406</sapcentraladmin:BusinessApplicationID></sapcentraladmin:CentralAdministration></wsp:All></wsp:ExactlyOne></wsp:Policy><wsp:Policy wsu:Id="OP__Z_TM_ETM_GET_EMPL_HOLIDAYS"><wsp:ExactlyOne><wsp:All><saptrhnw05:required>no</saptrhnw05:required><sapcomhnd:enableCommit>false</sapcomhnd:enableCommit><sapblock:enableBlocking>true</sapblock:enableBlocking><saprmnw05:enableWSRM>false</saprmnw05:enableWSRM></wsp:All></wsp:ExactlyOne></wsp:Policy><wsdl:types><xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:rfc:functions"><xsd:simpleType name="char1"><xsd:restriction base="xsd:string"><xsd:maxLength value="1"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char10"><xsd:restriction base="xsd:string"><xsd:maxLength value="10"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char20"><xsd:restriction base="xsd:string"><xsd:maxLength value="20"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char220"><xsd:restriction base="xsd:string"><xsd:maxLength value="220"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char30"><xsd:restriction base="xsd:string"><xsd:maxLength value="30"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char32"><xsd:restriction base="xsd:string"><xsd:maxLength value="32"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char40"><xsd:restriction base="xsd:string"><xsd:maxLength value="40"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char50"><xsd:restriction base="xsd:string"><xsd:maxLength value="50"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="date10"><xsd:restriction base="xsd:string"><xsd:maxLength value="10"/><xsd:pattern value="\d\d\d\d-\d\d-\d\d"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="numeric3"><xsd:restriction base="xsd:string"><xsd:maxLength value="3"/><xsd:pattern value="\d*"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="numeric6"><xsd:restriction base="xsd:string"><xsd:maxLength value="6"/><xsd:pattern value="\d*"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="numeric8"><xsd:restriction base="xsd:string"><xsd:maxLength value="8"/><xsd:pattern value="\d*"/></xsd:restriction></xsd:simpleType><xsd:complexType name="ZTMSHOLIDAYS"><xsd:sequence><xsd:element name="DATE" type="tns:date10"/><xsd:element name="DESCRIPTION" type="tns:char40"/></xsd:sequence></xsd:complexType><xsd:complexType name="BAPIRET2"><xsd:sequence><xsd:element name="TYPE" type="tns:char1"/><xsd:element name="ID" type="tns:char20"/><xsd:element name="NUMBER" type="tns:numeric3"/><xsd:element name="MESSAGE" type="tns:char220"/><xsd:element name="LOG_NO" type="tns:char20"/><xsd:element name="LOG_MSG_NO" type="tns:numeric6"/><xsd:element name="MESSAGE_V1" type="tns:char50"/><xsd:element name="MESSAGE_V2" type="tns:char50"/><xsd:element name="MESSAGE_V3" type="tns:char50"/><xsd:element name="MESSAGE_V4" type="tns:char50"/><xsd:element name="PARAMETER" type="tns:char32"/><xsd:element name="ROW" type="xsd:int"/><xsd:element name="FIELD" type="tns:char30"/><xsd:element name="SYSTEM" type="tns:char10"/></xsd:sequence></xsd:complexType><xsd:complexType name="ZTMTT_HOLIDAYS"><xsd:sequence><xsd:element name="item" type="tns:ZTMSHOLIDAYS" minOccurs="0" maxOccurs="unbounded"/></xsd:sequence></xsd:complexType><xsd:element name="Z_TM_ETM_GET_EMPL_HOLIDAYS"><xsd:complexType><xsd:sequence><xsd:element name="PI_PERNR" type="tns:numeric8"/></xsd:sequence></xsd:complexType></xsd:element><xsd:element name="Z_TM_ETM_GET_EMPL_HOLIDAYSResponse"><xsd:complexType><xsd:sequence><xsd:element name="PE_I_HOLIDAYS" type="tns:ZTMTT_HOLIDAYS"/><xsd:element name="PE_MESSAGE" type="tns:BAPIRET2"/></xsd:sequence></xsd:complexType></xsd:element></xsd:schema></wsdl:types><wsdl:message name="Z_TM_ETM_GET_EMPL_HOLIDAYS"><wsdl:part name="parameters" element="tns:Z_TM_ETM_GET_EMPL_HOLIDAYS"/></wsdl:message><wsdl:message name="Z_TM_ETM_GET_EMPL_HOLIDAYSResponse"><wsdl:part name="parameter" element="tns:Z_TM_ETM_GET_EMPL_HOLIDAYSResponse"/></wsdl:message><wsdl:portType name="ztm_ws_get_emp_holidays"><wsp:Policy><wsp:PolicyReference URI="#IF__ztm_ws_get_emp_holidays"/></wsp:Policy><wsdl:operation name="Z_TM_ETM_GET_EMPL_HOLIDAYS"><wsp:Policy><wsp:PolicyReference URI="#OP__Z_TM_ETM_GET_EMPL_HOLIDAYS"/></wsp:Policy><wsdl:input message="tns:Z_TM_ETM_GET_EMPL_HOLIDAYS"/><wsdl:output message="tns:Z_TM_ETM_GET_EMPL_HOLIDAYSResponse"/></wsdl:operation></wsdl:portType><wsdl:binding name="binding" type="tns:ztm_ws_get_emp_holidays"><wsp:Policy><wsp:PolicyReference URI="#BN__binding"/></wsp:Policy><soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/><wsdl:operation name="Z_TM_ETM_GET_EMPL_HOLIDAYS"><soap:operation soapAction="urn:sap-com:document:sap:rfc:functions:ztm_ws_get_emp_holidays:Z_TM_ETM_GET_EMPL_HOLIDAYSRequest" 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="binding_soap12" type="tns:ztm_ws_get_emp_holidays"><wsp:Policy><wsp:PolicyReference URI="#BN__binding_soap12"/></wsp:Policy><wsoap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/><wsdl:operation name="Z_TM_ETM_GET_EMPL_HOLIDAYS"><wsoap12:operation soapAction="urn:sap-com:document:sap:rfc:functions:ztm_ws_get_emp_holidays:Z_TM_ETM_GET_EMPL_HOLIDAYSRequest" style="document"/><wsdl:input><wsoap12:body use="literal"/></wsdl:input><wsdl:output><wsoap12:body use="literal"/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service name="OfficialHolidays"><wsdl:port name="binding" binding="tns:binding"><soap:address location="http://unrwa-red-71.unrwa.org:8000/sap/bc/srt/rfc/sap/ztm_ws_get_emp_holidays/520/officialholidays/binding"/></wsdl:port><wsdl:port name="binding_soap12" binding="tns:binding_soap12"><wsoap12:address location="http://unrwa-red-71.unrwa.org:8000/sap/bc/srt/rfc/sap/ztm_ws_get_emp_holidays/520/officialholidays/binding"/></wsdl:port></wsdl:service></wsdl:definitions>

我想知道这些价值形式:

namespace
soap action
method name 

他们是什么?

1 个答案:

答案 0 :(得分:0)


定义targetNamespace =“http://worldheritage.org/”

所以你的名字空间是

NameSpace = urn:sap-com:document:sap:rfc:functions


操作名称=“YourMethodName”

和方法名称是

方法名称=“Z_TM_ETM_GET_EMPL_HOLIDAYS


服务器网址

soap:address location =“http://unrwa-red-71.unrwa.org:8000/sap/bc/srt/rfc/sap/ztm_ws_get_emp_holidays/520/officialholidays/binding”