밑에서 위로 읽으면 쉬움

Contents

1 definitions
1.1 추상정의
1.1.1 type
1.1.2 message
1.1.3 portType
1.2 유형정의
1.2.1 binding
1.2.2 service
2 클라이언트 소스에서 사용

1 definitions #

root element

1.1 추상정의 #

1.1.1 type #

사용자 정의 타입

특정 머신, 언어에 구애받지 않는 XSD등의 타입 시스템을 사용하여 서비스에서 사용되는 데이터 타입을 정의(없을수도 있음)

1.1.2 message #

WSDL문서의 types요소, XSD, SOAP인코딩, WSDL에서 정의한 데이터 타입을 사용하여 웹서비스에서 교환되는 데이터를 정의한다.

예)
<message name="LottoIF_getLottoNumbers">
 <part name="int_1" type="xsd:int"/>
 <part name="int_2" type="xsd:int"/>
 <part name="int_3" type="xsd:int"/>
 <part name="int_4" type="xsd:int"/>
</message>
<message name="LottoIF_getLottoNumbersResponse">
 <part name="result" type="xsd:string"/>
</message>


1.1.3 portType #

어떤 메소드가 제공되는지 그리고 몇개의 메소드의 인자값이 사용되는지 표현됨, 그리고 인자와 변환값의 형식을 알 수 있음, 그리고 실제 형식은 위의 <message>에서 기술

ex)
<portType name="LottoIF">
 <operation name="getLottoNumbers" parameterOrder="int_1 int_2 int_3 int_4">
  <input message="tns:LottoIF_getLottoNumbers"/>
  <output message="tns:LottoIF_getLottoNumbersResponse"/>
 </operation>
</portType>



1.2 유형정의 #

1.2.1 binding #

원격 프로시저에 해당하는 전송 프로토콜과 데이터 인코딩 명세 바인딩 정의

ex)
<binding name="LottoIFBinding" type="tns:LottoIF">
 <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
 <operation name="getLottoNumbers">
  <soap:operation soapAction=""/>
  <input>
   <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    use="encoded" 
    namespace="http://localhost:8080/lottows/webservice/wsdl/webservice"/>
  </input>
  <output>
   <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
    use="encoded" 
    namespace="http://localhost:8080/lottows/webservice/wsdl/webservice"/>
  </output>
 </operation>
</binding>


1.2.2 service #

end point address 정의

ex)
<service name="Webservice">
 <port name="LottoIFPort" binding="tns:LottoIFBinding">
  <soap:address location="http://localhost:8080/lottows/webservice"/>
 </port>
</service>




2 클라이언트 소스에서 사용 #

// WSDL : <service name="Webservice">
lotto.ws.Webservice_Impl ws = new lotto.ws.Webservice_Impl();
			
// WSDL : <port name="LottoIFPort"
lotto.ws.LottoIF lotto = (lotto.ws.LottoIF)ws.getLottoIFPort();
			
String str = lotto.getLottoNumbers(1, 10, 5, 3);
System.out.println(str);
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2008-08-27 17:32:32
Processing time 0.0163 sec