WSDL(网络
务描述语言,WebServices Description Language)是一门基于XML 的语言,用于描述Web Services 以及如何对它们进行访问。
简要概括:
WSDL指网络服务描述语言
WSDL使用 XML编写
WSDL是一种 XML文档
WSDL用于描述网络服务
WSDL也可用于定位网络服务
WSDL还不是W3C标准
wsdl文件的编辑――方法/步骤wsdl文件的编辑 1、
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://test.lhl.lee/services" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://test.lhl.lee/services" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsi="uri:1">
<wsdl:types>
<xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://test.lhl.lee/services" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.w3.org/2005/05/xmlmime"/>
<xsd:element name="testFault">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="errorCode" type="xsd:int"/>
<xsd:element name="errorMessage" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="user">
<xsd:sequence>
<xsd:element name="userID" type="xsd:string" />
<xsd:element name="password" nillable="true" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="getInfo">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="user" type="tns:user" />
<xsd:element name="ID" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getInfoResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="returnCode" type="xsd:int" />
<xsd:element name="retrieveResult" type="tns:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="sayHello">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="sayHelloResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="returnCode" type="xsd:int"/>
<xsd:element name="helloString" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="getInfo">
<wsdl:part name="parameters" element="tns:getInfo"></wsdl:part>
</wsdl:message>
<wsdl:message name="getInfoResponse">
<wsdl:part name="return" element="tns:getInfoResponse"></wsdl:part>
</wsdl:message>
<wsdl:message name="sayHello">
<wsdl:part name="parameters" element="tns:sayHello"></wsdl:part>
</wsdl:message>
<wsdl:message name="sayHelloResponse">
<wsdl:part name="return" element="tns:sayHelloResponse"></wsdl:part>
</wsdl:message>
<wsdl:message name="testFaultMessage">
<wsdl:part name="fault" element="tns:testFault">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="DtestD">
<wsdl:operation name="getInfo">
<wsdl:input name="getInfo" message="tns:getInfo"></wsdl:input>
<wsdl:output name="getInfoResponse" message="tns:getInfoResponse"></wsdl:output>
<wsdl:fault name="testException" message="tns:testFaultMessage"></wsdl:fault>
</wsdl:operation>
<wsdl:operation name="sayHello">
<wsdl:input name="sayHello" message="tns:sayHello"></wsdl:input>
<wsdl:output name="sayHelloResponse" message="tns:sayHelloResponse"></wsdl:output>
<wsdl:fault name="testException" message="tns:testFaultMessage"></wsdl:fault>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="testSoapBinding" type="tns:DtestD">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getInfo">
<wsdlsoap:operation soapAction="http://test.lhl.lee/test/getInfo" />
<wsdl:input name="getInfo">
<wsdlsoap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://test.lhl.lee/DtestD/services/DtestD" />
</wsdl:input>
<wsdl:output name="getInfoResponse">
<wsdlsoap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://test.lhl.lee/DtestD/services/DtestD" />
</wsdl:output>
<wsdl:fault name="testException">
<wsdlsoap:fault name="testException" use="literal" />
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="sayHello">
<wsdlsoap:operation soapAction="http://test.lhl.lee/test/sayHello" />
<wsdl:input name="sayHello">
<wsdlsoap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://test.lhl.lee" />
</wsdl:input>
<wsdl:output name="sayHelloResponse">
<wsdlsoap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://test.lhl.lee" />
</wsdl:output>
<wsdl:fault name="testException">
<wsdlsoap:fault name="testException" use="literal" />
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="testService">
<wsdl:port name="test" binding="tns:testSoapBinding">
<wsdlsoap:address location="http://localhost:8080/test/services/test" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>