Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2006

Tip: Looking for answers? Try searching our database.

IP, ASP.NET WebServices and strings with minoccurs=0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Neil Young - 03 Mar 2006 20:42 GMT
Hello,

Scenario:
1) IP connected to a ASP.NET 2 webservice
2) Webservice offers query and update
3) To break the things down to the basics just two strings are passed

[WebMethod]
public string query(string querystring);
[WebMethod]
public void update(string updatestring);

4) IP shall be provide a form to change the query result and post it
back to the update function of the webservice. Just forget about the
missing primary key, that doesn't matter in the context of the problem

Problem (obviously by IP design):

If I design the form that way, that the result of the query is
presented and is posted back on update, then IP doesn't allow me to
change the content of the bound field for the query result, whenever
the query didn't return the appropriate XML entry. Because of the
default "minoccurs=0" for a string, a string may really not be present
in the result, if the string was initially NULL at the webservice side.
But of course I would like to be able to change NULL strings to any
other value...

Possible solution:
1) Enforce minoccurs=1 for the string. By using
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]

I'm able to set minoccurs=1 for the string, but unfortunately
"nillable=true" also, what seems to be not correct for IP, beacause IP
complains about "invalid xsi:nil for string". Is there another way to
achieve "minoccurs=1" without having to mess with "nillable"? I can't
see such a setting in ASP.NET.

2) Ensure, that a string result is never NULL. Seems not very
professional...

3) ???

Any pointer welcome. By the way: There is no such a problem with any
other value type like bool, long, int, DateTime, etc... Just strings
are problematic... To stupid...

Regards

Neil
Neil Young - 03 Mar 2006 21:45 GMT
Hmmm... Wait a minute: Seems to work now... surprisingly...

Solution 1 is OK for IP, regardless of whether nillable=true or not.
Hmm. I was quite sure to have seen an IP message, that xsi:nil for the
string parameter isn't possible..

However, solved for now.
Thanks

> Hello,
>
[quoted text clipped - 48 lines]
>
> Neil
 
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.