WSDL Tutorials - Herong's Tutorial Examples - v2.22, by Herong Yang
IRI Style Example - Get Exchange Rate
This section provides a tutorial example on writing a WSDL 2.0 example that uses SOAP 1.2 over HTTP with Multipart as the message style.
My next WSDL 20 example was converted from the WSDL 1.1 version:
In this WSDL example, I want to send a SOAP request to get the exchange rate from one currency to another on a given date. And I expect the server to return the exchange rate. So I wrote this WSDL document, GetExchangeRate_WSDL_20_SOAP_12_IRI.wsdl:
<?xml version="1.0"?>
<wsdl:description xmlns:wsdl="http://www.w3.org/ns/wsdl"
xmlns:wsoap= "http://www.w3.org/ns/wsdl/soap"
xmlns:hy="https://www.herongyang.com/Service/"
targetNamespace="https://www.herongyang.com/Service/">
<wsdl:documentation>
GetExchangeRate_WSDL_20_SOAP_12_IRI.wsdl
Copyright (c) 2009 HerongYang.com. All Rights Reserved
</wsdl:documentation>
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.herongyang.com/Service/">
<xsd:element name="GetExchangeRate">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Date" type="xsd:date"/>
<xsd:element name="FromCurrency" type="xsd:string"/>
<xsd:element name="ToCurrency" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ExchangeRateOutput">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Rate" type="xsd:decimal"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:interface name="exchangeRateInterface">
<wsdl:operation name="GetExchangeRate"
pattern="http://www.w3.org/ns/wsdl/in-out"
style="http://www.w3.org/ns/wsdl/style/iri">
<wsdl:input messageLabel="In"
element="hy:GetExchangeRate#element"/>
<wsdl:output messageLabel="Out"
element="hy:ExchangeRateOutput"/>
</wsdl:operation>
</wsdl:interface>
<wsdl:binding name="rexchangeRateBinding"
interface="hy:exchangeRateInterface"
type="http://www.w3.org/ns/wsdl/soap"
wsoap:version="1.2"
wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/">
<wsdl:operation ref="hy:GetExchangeRate"
wsoap:mep="http://www.w3.org/2003/05/soap/mep/request-response"/>
</wsdl:binding>
<wsdl:service name="rexchangeRateService"
interface="hy:exchangeRateInterface">
<wsdl:endpoint name="rexchangeRateEndpoint"
binding="hy:rexchangeRateBinding"
address="https://www.herongyang.com/Service/GetExchangeRate12.php"/>
</wsdl:service>
</wsdl:description>
See "Request and Response - Get Exchange Rate" tutorial for testing requests and responses.
Table of Contents
WSDL 2.0 Document Structure and Syntax
WSDL Version 2.0 Part 2: Adjuncts
►WSDL 2.0 Document Examples with SOAP Binding
RPC Style Example - Get Stock Price
►IRI Style Example - Get Exchange Rate
Multiplart Style Example - Reservation
Using WSDL Document in Java Apache Axis2/Java for WSDL
Apache Woden for WSDL Documents in Java
SoapUI - Web Service Testing Tool
WSDL 1.1 Document Structure and Syntax
WSDL 1.1 Binding Extension for SOAP 1.1
SoapUI as WSDL 1.1 Testing Tool
WSDL 1.1 and SOAP 1.1 Examples - Document and RPC Styles
PHP SOAP Extension for WSDL 1.1
Apache Axis2/Java for WSDL 1.1
Using WSDL2Java to Generate Web Service Stub Classes
WSDL 1.1 Binding Extension for SOAP 1.2
WSDL 1.1 and SOAP 1.2 Examples - Document and RPC Styles