理解WSDL

阅读更多
WSDL是干什么的?
Web服务的定义语言.通过WSDL你可以告诉别人您能够提供什么服务,或者你能干什么. 首先,我提供一个WSDL的例子,这个例子源于Netbeans5.5的BPEL的贷款教程。
WSDL例子
 
  1. xml version="1.0" encoding="UTF-8"?>  
  2. <definitions targetNamespace="http://j2ee.netbeans.org/wsdl/LoanRequestor"  
  3.     xmlns="http://schemas.xmlsoap.org/wsdl/"  
  4.     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"  
  5.     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"  
  6.     xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="LoanRequestor" xmlns:plink="http://schemas.xmlsoap.org/ws/2004/03/partner-link/" xmlns:tns="http://j2ee.netbeans.org/wsdl/LoanRequestor" xmlns:ns="http://xml.netbeans.org/schema/LoanRequestor">  
  7.     <types>  
  8.         <xsd:schema targetNamespace="http://j2ee.netbeans.org/wsdl/LoanRequestor">  
  9.             <xsd:import namespace="http://xml.netbeans.org/schema/LoanRequestor" schemaLocation="LoanRequestor.xsd"/>  
  10.         xsd:schema>  
  11.     types>  
  12.     <message name="LoanRequestorOperationRequest">  
  13.         <part name="requestLoanMessage" element="ns:pa"/>  
  14.     message>  
  15.     <message name="LoanRequestorOperationReply">  
  16.         <part name="responsePart" element="ns:par"/>  
  17.     message>  
  18.     <portType name="LoanRequestorPortType">  
  19.         <operation name="LoanRequestorOperation">  
  20.             <input name="input1" message="tns:LoanRequestorOperationRequest"/>  
  21.             <output name="output1" message="tns:LoanRequestorOperationReply"/>  
  22.         operation>  
  23.     portType>  
  24.     <binding name="LoanRequestorBinding" type="tns:LoanRequestorPortType">  
  25.         <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>  
  26.         <operation name="LoanRequestorOperation">  
  27.             <soap:operation/>  
  28.             <input name="input1">  
  29.                 <soap:body use="literal"/>  
  30.             input>  
  31.             <output name="output1">  
  32.                 <soap:body use="literal"/>  
  33.             output>  
  34.         operation>  
  35.     binding>  
  36.     <service name="LoanRequestorService">  
  37.         <port name="LoanRequestorPort" binding="tns:LoanRequestorBinding">  
  38.             <soap:address location="http://localhost:18181/LoanRequestorService/LoanRequestorPort"/>  
  39.         port>  
  40.     service>  
  41.     <plink:partnerLinkType name="LoanRequestorPartner">  
  42.          class --> package 给其他Java程序使用
    Web: operation --> port type --> wsdl 给其他任何Web Service的客户端使用.
    类比一下把.

你可能感兴趣的:(Netbeans,SOAP,Web,XML)