Re: XSD is missing an element

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Jul 11, 11:19 am, "John Saunders" <n...@xxxxxxxxxxxxxxxx> wrote:
<huohaod...@xxxxxxxxx> wrote in message

news:92022c77-42ed-4179-a545-0e794012fbc8@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

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.

.



Relevant Pages

  • Re: XSD is missing an element
    ... have one method called GetUserwhich returns a custom user object, ... public User GetUser() ... XSD for my class object? ... It seems that asp.net automatically generate wsdl for me, ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: XSD is missing an element
    ... have one method called GetUserwhich returns a custom user object, ... public User GetUser() ... XSD for my class object? ... It seems that asp.net automatically generate wsdl for me, ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: XSD is missing an element
    ... I am a new to web service world. ... have one method called GetUserwhich returns a custom user object, ... XSD for my class object? ... You don't need to have .NET generate the WSDL and schemas for you. ...
    (microsoft.public.dotnet.framework.webservices)
  • XSD is missing an element
    ... I am a new to web service world. ... have one method called GetUserwhich returns a custom user object, ... public User GetUser() ... XSD for my class object? ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Dynamic WSDL?
    ... But the new ASMX will have its own WSDL. ... > GetUser ... > GetInspection ... so I would like to have a web service with the following ...
    (microsoft.public.dotnet.framework.webservices)