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

N

Neil Young

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
 
N

Neil Young

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top