Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / February 2008

Tip: Looking for answers? Try searching our database.

xsi:nil=true vs missing element

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nick Locke - 20 Feb 2008 16:16 GMT
Assume that my XSD defines MiddleNames as minOccurs=0, maxOccurs=1,
nillable=true.  From my XSD and WSDL, I am using WSDL.EXE to create a Server
Interface which I can then implement.  All ok so far.  But, I need to be
able to differentiate between these three scenarios of incoming data:

<Record>
 <FirstName>Fred</FirstName>
 <MiddleNames>George Oliver</MiddleNames>
<Record>

<Record>
 <FirstName>Fred</FirstName>
<Record>

<Record>
 <FirstName>Fred</FirstName>
 <MiddleNames xsi:nil="true" />
<Record>

The intention is that the first example will update the MiddleNames value,
the second will leave it unchanged and the third will remove it.  I had
rather hoped that the generated VB .NET code would provide a property value
allowing me to differentiate between the second and third examples.    It
seems that such a property is not generated, making it impossible to tell
the two examples apart.

Am I missing something?  Alternatively is there a better way to do the
"leave it unchanged" scenario (my second example)?  I don't really want to
go down the line of having all the elements passed in every time.

Thanks
Nick Locke - 20 Feb 2008 17:50 GMT
Adding a little info - I can follow the guidance here
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2657167&SiteID=1  to
add xxxxSpecified as a property.  That works, but entails manual editing of
the Interface Class which does not seem like something I should be doing.

There does not seem to be a way to persuade WSDL.EXE to add those
properties?

> Assume that my XSD defines MiddleNames as minOccurs=0, maxOccurs=1,
> nillable=true.  From my XSD and WSDL, I am using WSDL.EXE to create a
[quoted text clipped - 28 lines]
>
> Thanks

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.