Re: XSD is missing an element
- From: huohaodian@xxxxxxxxx
- Date: Fri, 11 Jul 2008 10:00:56 -0700 (PDT)
On Jul 11, 11:33 am, huohaod...@xxxxxxxxx wrote:
On Jul 11, 11:19 am, "John Saunders" <n...@xxxxxxxxxxxxxxxx> wrote:
<huohaod...@xxxxxxxxx> wrote in message
news:92022c77-42ed-4179-a545-0e794012fbc8@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I am a new to web service world. For the leaning purpose, I have
created a web service in 2005 with one asmx.cs file, in this file, I
have one method called GetUser() which returns a custom user object,
something like
[WebMethod]
public User GetUser()
When I run it from IDE, I noticed after clicking the Service
Description link that the XSD for my custom object user is missing an
element id, which is a read only property of object, and it would
shown if change it to read write.
1. Why this is happening?
The XML Serializer only works with public read/write properties. Since your
property is read-only, it will be ignored.
any way I can manually or explicitly set the
XSD for my class object?
2. It seems that asp.net automatically generate wsdl for me, any way I
can control the content and element of it?
Yes. You don't need to have .NET generate the WSDL and schemas for you. You
can create your own by hand. The only problem is that there is no way that I
know of to "plug in" to what ASP.NET does when it sees "?WSDL". You will
have to turn off the "?WSDL" functionality by removing the <documentation>
protocol in web.config.
--
John Saunders | MVP - Connected System Developer
Thanks a lot for the helps.
For some reasons I couldn't find the <documentation> in the web.cofig
file, and I am not sure how would asp.net handles after removing the ?
wsdl functinality.
Thanks again.
Any suggestions for a good wsdl editor?
Thanks,
.
- Follow-Ups:
- Re: XSD is missing an element
- From: huohaodian
- Re: XSD is missing an element
- Prev by Date: Re: XSD is missing an element
- Next by Date: Re: XSD is missing an element
- Previous by thread: Re: XSD is missing an element
- Next by thread: Re: XSD is missing an element
- Index(es):
Relevant Pages
|