My SOAP is not clean!

  • Thread starter Molalla Attenborough
  • Start date
M

Molalla Attenborough

I am working on a vb.net webservice with a FlashMX
client to consume it.
I got some help from Jan with returning data from my service as an array of
complex objects. Now, however, I am not getting the results I
expect in the WSDL. The result is that in the flash designer,
it can't "see" the elements in the returned array.

Can someone look at these two WSDLs and tell me how I fix
the one generated by MS so that it will work the same as the one
I reference below? Thanks. I can't figure out why one would act
differently than the other. My WSDL is listed below the stock
quote one.

If anyone can help me out, I would appreciate it greatly!

The sample Macromedia attaches to frequently is at
http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx?WSDL

The listing is like this:
<?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://swanandmokashi.com/"
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://swanandmokashi.com/" xmlns="http://schemas.xmlsoap.org/wsdl/">
- <types>
- <s:schema elementFormDefault="qualified" targetNamespace="http://swanandmokashi.com/">
- <s:element name="GetStockQuotes">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="QuoteTicker" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="GetStockQuotesResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetStockQuotesResult"
type="s0:ArrayOfQuote" />
</s:sequence>
</s:complexType>
</s:element>
- <s:complexType name="ArrayOfQuote">
- <s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="Quote" type="s0:Quote" />
</s:sequence>
</s:complexType>
- <s:complexType name="Quote">
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CompanyName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="StockTicker" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="StockQuote" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="LastUpdated" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Change" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="OpenPrice" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="DayHighPrice" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="DayLowPrice" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Volume" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="MarketCap" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="YearRange" type="s:string" />
</s:sequence>
</s:complexType>
<s:element name="ArrayOfQuote" nillable="true" type="s0:ArrayOfQuote" />
</s:schema>
</types>
- <message name="GetStockQuotesSoapIn">
<part name="parameters" element="s0:GetStockQuotes" />
</message>
- <message name="GetStockQuotesSoapOut">
<part name="parameters" element="s0:GetStockQuotesResponse" />
</message>
- <message name="GetStockQuotesHttpGetIn">
<part name="QuoteTicker" type="s:string" />
</message>
- <message name="GetStockQuotesHttpGetOut">
<part name="Body" element="s0:ArrayOfQuote" />
</message>
- <message name="GetStockQuotesHttpPostIn">
<part name="QuoteTicker" type="s:string" />
</message>
- <message name="GetStockQuotesHttpPostOut">
<part name="Body" element="s0:ArrayOfQuote" />
</message>
- <portType name="StockQuotesSoap">
- <operation name="GetStockQuotes">
<documentation>Retrieves the latest(20 minutes delay) stock quote of a stock ticker. To
get multiple quotes enter Ticker symbols seperated by ,(eg. MSFT,YHOO,GE) or space (eg.
MSFT YHOO GE). <BR>Gives the company name ,ticker,Stock Quote, Change,Open price ,Day's
range(high and low),Volume, the Market Cap and the Year range of the stock
price.<BR><B>Powered by Yahoo!'s stock Quotes service.Not for commerical use.For demo
purposes only.</b></documentation>
<input message="s0:GetStockQuotesSoapIn" />
<output message="s0:GetStockQuotesSoapOut" />
</operation>
</portType>
- <portType name="StockQuotesHttpGet">
- <operation name="GetStockQuotes">
<documentation>Retrieves the latest(20 minutes delay) stock quote of a stock ticker. To
get multiple quotes enter Ticker symbols seperated by ,(eg. MSFT,YHOO,GE) or space (eg.
MSFT YHOO GE). <BR>Gives the company name ,ticker,Stock Quote, Change,Open price ,Day's
range(high and low),Volume, the Market Cap and the Year range of the stock
price.<BR><B>Powered by Yahoo!'s stock Quotes service.Not for commerical use.For demo
purposes only.</b></documentation>
<input message="s0:GetStockQuotesHttpGetIn" />
<output message="s0:GetStockQuotesHttpGetOut" />
</operation>
</portType>
- <portType name="StockQuotesHttpPost">
- <operation name="GetStockQuotes">
<documentation>Retrieves the latest(20 minutes delay) stock quote of a stock ticker. To
get multiple quotes enter Ticker symbols seperated by ,(eg. MSFT,YHOO,GE) or space (eg.
MSFT YHOO GE). <BR>Gives the company name ,ticker,Stock Quote, Change,Open price ,Day's
range(high and low),Volume, the Market Cap and the Year range of the stock
price.<BR><B>Powered by Yahoo!'s stock Quotes service.Not for commerical use.For demo
purposes only.</b></documentation>
<input message="s0:GetStockQuotesHttpPostIn" />
<output message="s0:GetStockQuotesHttpPostOut" />
</operation>
</portType>
- <binding name="StockQuotesSoap" type="s0:StockQuotesSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <operation name="GetStockQuotes">
<soap:eek:peration soapAction="http://swanandmokashi.com/GetStockQuotes" style="document"
/>
- <input>
<soap:body use="literal" />
</input>
- <output>
<soap:body use="literal" />
</output>
</operation>
</binding>
- <binding name="StockQuotesHttpGet" type="s0:StockQuotesHttpGet">
<http:binding verb="GET" />
- <operation name="GetStockQuotes">
<http:eek:peration location="/GetStockQuotes" />
- <input>
<http:urlEncoded />
</input>
- <output>
<mime:mimeXml part="Body" />
</output>
</operation>
</binding>
- <binding name="StockQuotesHttpPost" type="s0:StockQuotesHttpPost">
<http:binding verb="POST" />
- <operation name="GetStockQuotes">
<http:eek:peration location="/GetStockQuotes" />
- <input>
<mime:content type="application/x-www-form-urlencoded" />
</input>
- <output>
<mime:mimeXml part="Body" />
</output>
</operation>
</binding>
- <service name="StockQuotes">
- <port name="StockQuotesSoap" binding="s0:StockQuotesSoap">
<soap:address
location="http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx" />
</port>
- <port name="StockQuotesHttpGet" binding="s0:StockQuotesHttpGet">
<http:address
location="http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx" />
</port>
- <port name="StockQuotesHttpPost" binding="s0:StockQuotesHttpPost">
<http:address
location="http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx" />
</port>
</service>
</definitions>



Now, my WSDL looks like this:


<?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://central/ContactTester/Contacts"
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://central/ContactTester/Contacts"
xmlns="http://schemas.xmlsoap.org/wsdl/">
- <types>
- <s:schema elementFormDefault="qualified"
targetNamespace="http://central/ContactTester/Contacts">
- <s:element name="GetArray">
<s:complexType />
</s:element>
- <s:element name="GetArrayResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetArrayResult" type="s0:ArrayOfMyContact"
/>
</s:sequence>
</s:complexType>
</s:element>
- <s:complexType name="ArrayOfMyContact">
- <s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="MyContact" nillable="true"
type="s0:MyContact" />
</s:sequence>
</s:complexType>
- <s:complexType name="MyContact">
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ID" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ContactName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="AD1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="AD2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="City" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="State" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Zip" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Country" type="s:string" />
</s:sequence>
</s:complexType>
</s:schema>
</types>
- <message name="GetArraySoapIn">
<part name="parameters" element="s0:GetArray" />
</message>
- <message name="GetArraySoapOut">
<part name="parameters" element="s0:GetArrayResponse" />
</message>
- <portType name="ContactsSoap">
- <operation name="GetArray">
<input message="s0:GetArraySoapIn" />
<output message="s0:GetArraySoapOut" />
</operation>
</portType>
- <binding name="ContactsSoap" type="s0:ContactsSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <operation name="GetArray">
<soap:eek:peration soapAction="http://central/ContactTester/Contacts/GetArray"
style="document" />
- <input>
<soap:body use="literal" />
</input>
- <output>
<soap:body use="literal" />
</output>
</operation>
</binding>
- <service name="Contacts">
- <port name="ContactsSoap" binding="s0:ContactsSoap">
<soap:address location="http://central/contacttester/contacts.asmx" />
</port>
</service>
</definitions>
 
J

Jan Tielens

This article has some good tips:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/html/service12052001.asp

This one worked for me:
Avoid HTTP/GET and HTTP/POST Bindings in Your WSDL
If you use the SOAP Toolkit, this is easy. But what do you do if you use
Visual Studio .NET to generate your WSDL files? You can disable all
generation of the HTTP bindings by modifying your Web.config file. In the
Web Service project, go into the <configuration><system.Web> section and add
the following lines of XML:

<webServices>
<protocols>
<remove name="HttpPost" />
<remove name="HttpGet" />
</protocols>
</webServices>
These few lines tell the WSDL generator to not produce the HTTP/POST and
HTTP/GET bindings. Why do you need to remove these bindings? Most of the
existing toolkits do an excellent job of handling SOAP and many can even
handle WSDL files. The developers of these toolkits did not worry about the
existence of HTTP/POST and HTTP/GET bindings. They didn't have to because
not many toolkits supported the binding in the first place. When the
toolkits try to create proxies and see the bindings to HTTP/GET or POST they
typically fail to produce anything. By telling ASP.NET not to provide those
bindings, you make it easier for other toolkits to use your Web Service.


--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
Molalla Attenborough said:
I am working on a vb.net webservice with a FlashMX
client to consume it.
I got some help from Jan with returning data from my service as an array of
complex objects. Now, however, I am not getting the results I
expect in the WSDL. The result is that in the flash designer,
it can't "see" the elements in the returned array.

Can someone look at these two WSDLs and tell me how I fix
the one generated by MS so that it will work the same as the one
I reference below? Thanks. I can't figure out why one would act
differently than the other. My WSDL is listed below the stock
quote one.

If anyone can help me out, I would appreciate it greatly!

The sample Macromedia attaches to frequently is at
http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx?WSDL

The listing is like this:
<?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://swanandmokashi.com/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
- <types>
- <s:schema elementFormDefault="qualified" targetNamespace="http://swanandmokashi.com/">
- <s:element name="GetStockQuotes">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="QuoteTicker" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="GetStockQuotesResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetStockQuotesResult"
type="s0:ArrayOfQuote" />
</s:sequence>
</s:complexType>
</s:element>
- <s:complexType name="ArrayOfQuote">
- <s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="Quote" type="s0:Quote" />
</s:sequence>
</s:complexType>
- <s:complexType name="Quote">
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CompanyName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="StockTicker" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="StockQuote" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="LastUpdated" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Change" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="OpenPrice" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="DayHighPrice" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="DayLowPrice" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Volume" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="MarketCap" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="YearRange" type="s:string" />
</s:sequence>
</s:complexType>
<s:element name="ArrayOfQuote" nillable="true" type="s0:ArrayOfQuote" />
</s:schema>
</types>
- <message name="GetStockQuotesSoapIn">
<part name="parameters" element="s0:GetStockQuotes" />
</message>
- <message name="GetStockQuotesSoapOut">
<part name="parameters" element="s0:GetStockQuotesResponse" />
</message>
- <message name="GetStockQuotesHttpGetIn">
<part name="QuoteTicker" type="s:string" />
</message>
- <message name="GetStockQuotesHttpGetOut">
<part name="Body" element="s0:ArrayOfQuote" />
</message>
- <message name="GetStockQuotesHttpPostIn">
<part name="QuoteTicker" type="s:string" />
</message>
- <message name="GetStockQuotesHttpPostOut">
<part name="Body" element="s0:ArrayOfQuote" />
</message>
- <portType name="StockQuotesSoap">
- <operation name="GetStockQuotes">
<documentation>Retrieves the latest(20 minutes delay) stock quote of a stock ticker. To
get multiple quotes enter Ticker symbols seperated by ,(eg. MSFT,YHOO,GE) or space (eg.
MSFT YHOO GE). <BR>Gives the company name ,ticker,Stock Quote, Change,Open price ,Day's
range(high and low),Volume, the Market Cap and the Year range of the stock
price.<BR><B>Powered by Yahoo!'s stock Quotes service.Not for commerical use.For demo
purposes only.</b></documentation>
<input message="s0:GetStockQuotesSoapIn" />
<output message="s0:GetStockQuotesSoapOut" />
</operation>
</portType>
- <portType name="StockQuotesHttpGet">
- <operation name="GetStockQuotes">
<documentation>Retrieves the latest(20 minutes delay) stock quote of a stock ticker. To
get multiple quotes enter Ticker symbols seperated by ,(eg. MSFT,YHOO,GE) or space (eg.
MSFT YHOO GE). <BR>Gives the company name ,ticker,Stock Quote, Change,Open price ,Day's
range(high and low),Volume, the Market Cap and the Year range of the stock
price.<BR><B>Powered by Yahoo!'s stock Quotes service.Not for commerical use.For demo
purposes only.</b></documentation>
<input message="s0:GetStockQuotesHttpGetIn" />
<output message="s0:GetStockQuotesHttpGetOut" />
</operation>
</portType>
- <portType name="StockQuotesHttpPost">
- <operation name="GetStockQuotes">
<documentation>Retrieves the latest(20 minutes delay) stock quote of a stock ticker. To
get multiple quotes enter Ticker symbols seperated by ,(eg. MSFT,YHOO,GE) or space (eg.
MSFT YHOO GE). <BR>Gives the company name ,ticker,Stock Quote, Change,Open price ,Day's
range(high and low),Volume, the Market Cap and the Year range of the stock
price.<BR><B>Powered by Yahoo!'s stock Quotes service.Not for commerical use.For demo
purposes only.</b></documentation>
<input message="s0:GetStockQuotesHttpPostIn" />
<output message="s0:GetStockQuotesHttpPostOut" />
</operation>
</portType>
- <binding name="StockQuotesSoap" type="s0:StockQuotesSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <operation name="GetStockQuotes">
<soap:eek:peration soapAction="http://swanandmokashi.com/GetStockQuotes" style="document"
/>
- <input>
<soap:body use="literal" />
</input>
- <output>
<soap:body use="literal" />
</output>
</operation>
</binding>
- <binding name="StockQuotesHttpGet" type="s0:StockQuotesHttpGet">
<http:binding verb="GET" />
- <operation name="GetStockQuotes">
<http:eek:peration location="/GetStockQuotes" />
- <input>
<http:urlEncoded />
</input>
- <output>
<mime:mimeXml part="Body" />
</output>
</operation>
</binding>
- <binding name="StockQuotesHttpPost" type="s0:StockQuotesHttpPost">
<http:binding verb="POST" />
- <operation name="GetStockQuotes">
<http:eek:peration location="/GetStockQuotes" />
- <input>
<mime:content type="application/x-www-form-urlencoded" />
</input>
- <output>
<mime:mimeXml part="Body" />
</output>
</operation>
</binding>
- <service name="StockQuotes">
- <port name="StockQuotesSoap" binding="s0:StockQuotesSoap">
<soap:address
location="http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asm
x" />
</port>
- <port name="StockQuotesHttpGet" binding="s0:StockQuotesHttpGet">
<http:address
location="http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asm
x" />
</port>
- <port name="StockQuotesHttpPost" binding="s0:StockQuotesHttpPost">
<http:address
location="http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asm
x" />
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top