Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Services (http://www.velocityreviews.com/forums/f64-asp-net-web-services.html)
-   -   My webservice WSDL doesn't return any information about the elements. (http://www.velocityreviews.com/forums/t782428-my-webservice-wsdl-doesnt-return-any-information-about-the-elements.html)

Molalla Attenborough 12-23-2003 07:35 PM

My webservice WSDL doesn't return any information about the elements.
 
If I go to the following public service WSDL @
http://www.swanandmokashi.com/HomePa...otes.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




BruceJohnson 12-23-2003 08:00 PM

Re: My webservice WSDL doesn't return any information about the elements.
 
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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Mark Carver 12-23-2003 08:22 PM

Re: My webservice WSDL doesn't return any information about the elements.
 
"BruceJohnson" <Bruce@ObjectSharp.removethis.com> wrote in message
news:Ojpzf9YyDHA.1196@TK2MSFTNGP12.phx.gbl...
> 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
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!


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.




BruceJohnson 12-28-2003 05:09 AM

Re: My webservice WSDL doesn't return any information about the elements.
 
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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT. The time now is 03:35 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.