ASP.NET and Web Services Part 2 - The Standard WSDL File Form
(Page 6 of 8 )
But first, Listing 11 demonstrates the standard form that every WSDL file takes.
Listing 11 IFCEBrokerageFirm.asmx WSDL file
<?xml version="1.0" encoding="utf-8" ?
>
<definitions
xmlns:http="http://
schemas.xmlsoap.org/wsdl/http//
"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema
"
xmlns:s0="http://tempuri.org/"
xmlns:soapenc=
"http://schemas.xmlsoap.org/
soap/encoding/"
xmlns:tm="http://microsoft.com/wsdl/
mime/textMatching/"
xmlns:mime="http://
schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="http://tempuri.org/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<s:schema
elementFormDefault="qualified"
targetNamespace="http://tempuri.org/">
<s:element
name="StockQuote">
<s:element minOccurs="0" maxOccurs="1"
name="symbol" type="s:string" />
<s:element
name="StockQuoteResponse">
<s:complexType> <s:element
minOccurs="1"
maxOccurs="1" name="StockQuoteResult"
type="s:double"
/>
</s:sequence> </types>
<message
name="StockQuoteSoapIn">
<part name="parameters"
element="s0:StockQuote" />
</message>
<message
name="StockQuoteSoapOut">
<part name="parameters"
element="s0:StockQuoteResponse" />
</message>
<portType
name="SecuritiesExchangeSoap">
<operation
name="StockQuote">
<input message="s0:StockQuoteSoapIn"
/>
<output message="s0:StockQuoteSoapOut" />
</operation>
</portType>
<binding
name="SecuritiesExchangeSoap" type="s0:SecuritiesExchangeSoap">
<soap:binding transport="http://
schemas.xmlsoap.org/soap/http"
style="document" />
<operation name="StockQuote">
<soap:operation soapAction="http://
tempuri.org/StockQuote"
style="document" />
<input> <soap:body use="literal"
/>
</input>
<output> <soap:body use="literal"
/>
<service name="SecuritiesExchange">
<port
name="SecuritiesExchangeSoap" binding="s0:SecuritiesExchangeSoap">
<soap:address
location="http://localhost/
IFCEBrokerage/IFCEBrokerageFirm.asmx"
/>
</port> </definitions>
The WSDL file defines its own namespace. WSDL adds a targetNamespace attribute to the <definitions> element. The targetNamespace attribute may not use a relative URI. Conversely, it must use the fully qualified URL. The namespace allows the author to qualify references to entities contained within the WSDL document.
Remember: This is part one of chapter 7 .NET & J2EE Interoperability, by Dwight Peltzer (McGraw-Hill/Osborne, ISBN 0-07-223054-1, 2004). If you like what you see, feel free to click on the following link to get your own copy! Buy this book now.
|
Next: Referencing the Namespace >>
More ASP.NET Articles
More By McGraw-Hill/Osborne