My webservice WSDL doesn't return any information about the elements.

  • Thread starter Molalla Attenborough
  • Start date
M

Molalla Attenborough

If I go to the following public service WSDL @
http://www.swanandmokashi.com/HomePage/WebServices/StockQuotes.asmx?WSDL

I see the following section:
<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>

How do I get my service written in vb.net to return this info in the
autogenerated WSDL?

I am currently using code that looks like this:

<WebMethod()> Public Function GetContacts() as XmlDataDocument
Dim MyData as New Dataset1
oleDbDataAdpater1.Fill(MyData)
Dim dataDoc as new xmlDataDocument(MyData)
return dataDoc

Any suggestions?

TIA
 
B

BruceJohnson

Have you tried returning a Quote objects instead of an XMLDataDocument
from your GetContacts() method. Although it seems a little strange to
me that GetContacts would return a quote.

If you don't want to return Quote, then add the attribute
<XmlInclude("Quote")> to the declaraction of the GetContacts method.
This would cause the schema that defines the Quote class to be placed
into the WSDL.

Don't know if either of these answers is what you're looking for.

Bruce Johnson
http://www.ObjectSharp.com/Bruce
 
M

Mark Carver

BruceJohnson said:
Have you tried returning a Quote objects instead of an XMLDataDocument
from your GetContacts() method. Although it seems a little strange to
me that GetContacts would return a quote.

If you don't want to return Quote, then add the attribute
<XmlInclude("Quote")> to the declaraction of the GetContacts method.
This would cause the schema that defines the Quote class to be placed
into the WSDL.

Don't know if either of these answers is what you're looking for.

Bruce Johnson
http://www.ObjectSharp.com/Bruce

I should clarify a bit. I want my own service to return detailed data about the
fields in my dataset. I used the public server in my post an as example of the
kind of detail I want.

As it stands, My own service returns no information at all about the
fields. This makes my WSDL almost useless for my purposes.

My own project has a dataset that has a number of fields.
I want my own WSDL to return information as a complex type
and not as a dataset.

Does this make sense at all?

Thanks.
 
B

BruceJohnson

It does make sense. I can think of one way to accomplish your aim
quickly. There may be others that I'm missing

My suggestions would be to create an object that has public properties
defined that match the fields in the dataset. Then have the web service
method return the object (after having the properties populated with
values from the dataset, of course). This technique will also have the
schema for the complex object automatically included in the WSDL file.

HTH

Bruce Johnson
http://www.ObjectSharp.com/Bruce
 

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,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top