이 콘텐츠는 선택한 언어로 제공되지 않습니다.

36.2. CustomerService WSDL Contract


Sample WSDL contract

The WSDL contract used in this demonstration is the CustomerService WSDL contract, which is available in the following location:
cxf-webinars-jboss-fuse-6.2.1/src/main/resources/wsdl
Copy to Clipboard Toggle word wrap
Because the WSDL contract is a fairly verbose format, it is not shown in here in full. The main point you need to be aware of is that the CustomerSerivice WSDL contract exposes the following operations:
lookupCustomer
Given a customer ID, the operation returns the corresponding Customer data object.
updateCustomer
Stores the given Customer data object against the given customer ID.
getCustomerStatus
Returns the status of the customer with the given customer ID.

Parts of the WSDL contract

A WSDL contract has the following main parts:

Port type

The port type is defined in the WSDL contract by the wsdl:portType element. It is analogous to an interface and it defines the operations that can be invoked on the Web service.
For example, the following WSDL fragment shows the wsdl:portType definition from the CustomerService WSDL contract:
<wsdl:definitions name="CustomerService"
	targetNamespace="http://demo.fusesource.com/wsdl/CustomerService/"
    ...>

    ...
    <wsdl:portType name="CustomerService">
        <wsdl:operation name="lookupCustomer">
            <wsdl:input message="tns:lookupCustomer"></wsdl:input>
            <wsdl:output message="tns:lookupCustomerResponse"></wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="updateCustomer">
            <wsdl:input message="tns:updateCustomer"></wsdl:input>
            <wsdl:output message="tns:updateCustomerResponse"></wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="getCustomerStatus">
            <wsdl:input message="tns:getCustomerStatus"></wsdl:input>
            <wsdl:output message="tns:getCustomerStatusResponse"></wsdl:output>
        </wsdl:operation>   
    </wsdl:portType>
    ...
</wsdl:definitions>
Copy to Clipboard Toggle word wrap

WSDL binding

A WSDL binding describes how to encode all of the operations and data types associated with a particular port type. A binding is specific to a particular protocol—for example, SOAP or JMS.

WSDL port

A WSDL port specifies the transport protocol and contains addressing data that enables clients to locate and connect to a remote server endpoint.
For example, the CustomerService WSDL contract defines the following WSDL port:
<wsdl:definitions ...>
    ...
    <wsdl:service name="CustomerService">
        <wsdl:port name="SOAPOverHTTP" binding="tns:CustomerServiceSOAP">
            <soap:address location="http://0.0.0.0:8183/CustomerService" />
        </wsdl:port>
    </wsdl:service>

</wsdl:definitions>
Copy to Clipboard Toggle word wrap
The address specified by the soap:address element's location attribute in the original WSDL contract is typically overridden at run time, however.

The getCustomerStatus operation

Because a WSDL contract is fairly verbose, it can be a bit difficult to see what the parameters of an operation are. Typically, for each operation, you can find data types in the XML schema section that represent the operation request and the operation response. For example, the getCustomerStatus operation has its request parameters (IN parameters) encoded by the getCustomerStatus element and its response parameters (OUT parameters) encoded by the getCustomerStatusResponse element, as follows:
<wsdl:definitions name="CustomerService"
	targetNamespace="http://demo.fusesource.com/wsdl/CustomerService/"
    ...>
    <wsdl:types>
        <xsd:schema ...>
            ...
            <xsd:element name="getCustomerStatus">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="customerId" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="getCustomerStatusResponse">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="status" type="xsd:string"/>
                        <xsd:element name="statusMessage" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>            
        </xsd:schema>		
    </wsdl:types>
    ...
</wsdl:definitions>
Copy to Clipboard Toggle word wrap

References

For more details about the format of WSDL contracts and how to create your own WSDL contracts, see Writing WSDL Contracts and the Eclipse JAX-WS Tools Component.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat