473,385 Members | 1,392 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

.NET SDK 2.0: complex types with minOccurs = 0 and nillable = true

HQM
If I create an element X of a primitive type with minOccurs=0 and
nillable=true and run it through the WSDL generator I get a class with a
property "X" of the primitive type plus a boolean "XSpecified" attribute to
say if it was not specified rather than null. But if I have a complex type
with minOccurs=0 and nillable=true you don't get the "XSpecified" property.
This means you can't tell the difference between

<outer>
<x xsi:nil="true"/>
</outer>

and

<outer/>

This is a bug, I think. Now if I could only find the place in MSDN to log
bugs...FWIW I tried reporting this to a newsgroup through Visual Studio 2005
beta 2 but it would crash when it brought up the entry box. How does one
report a bug that the bug reporting system crashes?

Nov 12 '05 #1
5 4263
did you try the link:
http://lab.msdn.microsoft.com/productfeedback/
and click on Report a Bug.

"HQM" <HQ*@discussions.microsoft.com> wrote in message
news:F8**********************************@microsof t.com...
If I create an element X of a primitive type with minOccurs=0 and
nillable=true and run it through the WSDL generator I get a class with a
property "X" of the primitive type plus a boolean "XSpecified" attribute to say if it was not specified rather than null. But if I have a complex type
with minOccurs=0 and nillable=true you don't get the "XSpecified" property. This means you can't tell the difference between

<outer>
<x xsi:nil="true"/>
</outer>

and

<outer/>

This is a bug, I think. Now if I could only find the place in MSDN to log
bugs...FWIW I tried reporting this to a newsgroup through Visual Studio 2005 beta 2 but it would crash when it brought up the entry box. How does one
report a bug that the bug reporting system crashes?

Nov 12 '05 #2
This is by design: by default we only generate xSepcified for optional
valuetypes, because from CLR point of view, null is a null. If you need to
differentiate between

<outer> <x xsi:nil="true"/> </outer>

and

<outer/>

You can add the xSpecified by hand to the generated OM, it will be honored.

"HQM" <HQ*@discussions.microsoft.com> wrote in message
news:F8**********************************@microsof t.com...
If I create an element X of a primitive type with minOccurs=0 and
nillable=true and run it through the WSDL generator I get a class with a
property "X" of the primitive type plus a boolean "XSpecified" attribute to say if it was not specified rather than null. But if I have a complex type
with minOccurs=0 and nillable=true you don't get the "XSpecified" property. This means you can't tell the difference between

<outer>
<x xsi:nil="true"/>
</outer>

and

<outer/>

This is a bug, I think. Now if I could only find the place in MSDN to log
bugs...FWIW I tried reporting this to a newsgroup through Visual Studio 2005 beta 2 but it would crash when it brought up the entry box. How does one
report a bug that the bug reporting system crashes?

Nov 12 '05 #3
HQM
So, if we add the xSpecified to the class x where x is an element of a
complex type B in the sequence of A then .NET will respect the Specified
semantic, even though it doesn't generate this indicator for complex types
(as opposed to "valuetypes", by which I take it you mean "primitives" like
int, etc.)? I don't follow the reasoning why this should be optional: you
seem to suggest that this is valid because if both ends are a CLR host then,
well, a null is a null. But of one end is NOT a CLR, and I NEED to
distinguish between them to send the specific message I need at the other
end, then this reasoning would be invalid. Why in a web service should the
design be predicated on the assumption that both ends are CLR? I thought
interoperability was the whole point. Am I missing something?

In any case is this treatment of xxxSpecified documented somewhere? I've
only seen the behaviour with primitives.

BTW, I tried to submit a bug, but I'm asked for profile information. I fill
in every field and hit ok or cancel and am always taken back to the profile
information form. I can't seem to get past it to file the bug report.

"Zafar Abbas" wrote:
This is by design: by default we only generate xSepcified for optional
valuetypes, because from CLR point of view, null is a null. If you need to
differentiate between

<outer> <x xsi:nil="true"/> </outer>

and

<outer/>

You can add the xSpecified by hand to the generated OM, it will be honored.

"HQM" <HQ*@discussions.microsoft.com> wrote in message
news:F8**********************************@microsof t.com...
If I create an element X of a primitive type with minOccurs=0 and
nillable=true and run it through the WSDL generator I get a class with a
property "X" of the primitive type plus a boolean "XSpecified" attribute

to
say if it was not specified rather than null. But if I have a complex type
with minOccurs=0 and nillable=true you don't get the "XSpecified"

property.
This means you can't tell the difference between

<outer>
<x xsi:nil="true"/>
</outer>

and

<outer/>

This is a bug, I think. Now if I could only find the place in MSDN to log
bugs...FWIW I tried reporting this to a newsgroup through Visual Studio

2005
beta 2 but it would crash when it brought up the entry box. How does one
report a bug that the bug reporting system crashes?


Nov 12 '05 #4
I do not see a problem with interoperability here: there is no assumption on
what type system is used by server. The schema for the "x" element allows
both forms, and .Net generated OM will be able to handle both of them
(xsi:nil=true" or omitted). The fact that your business logic depends on the
wire format is not part of the service contract, but is your application
specific.
And that custom logic could be build into the OM by adding the xSpecified
member.

"HQM" wrote:
So, if we add the xSpecified to the class x where x is an element of a
complex type B in the sequence of A then .NET will respect the Specified
semantic, even though it doesn't generate this indicator for complex types
(as opposed to "valuetypes", by which I take it you mean "primitives" like
int, etc.)? I don't follow the reasoning why this should be optional: you
seem to suggest that this is valid because if both ends are a CLR host then,
well, a null is a null. But of one end is NOT a CLR, and I NEED to
distinguish between them to send the specific message I need at the other
end, then this reasoning would be invalid. Why in a web service should the
design be predicated on the assumption that both ends are CLR? I thought
interoperability was the whole point. Am I missing something?

In any case is this treatment of xxxSpecified documented somewhere? I've
only seen the behaviour with primitives.

BTW, I tried to submit a bug, but I'm asked for profile information. I fill
in every field and hit ok or cancel and am always taken back to the profile
information form. I can't seem to get past it to file the bug report.

"Zafar Abbas" wrote:
This is by design: by default we only generate xSepcified for optional
valuetypes, because from CLR point of view, null is a null. If you need to
differentiate between

<outer> <x xsi:nil="true"/> </outer>

and

<outer/>

You can add the xSpecified by hand to the generated OM, it will be honored.

"HQM" <HQ*@discussions.microsoft.com> wrote in message
news:F8**********************************@microsof t.com...
If I create an element X of a primitive type with minOccurs=0 and
nillable=true and run it through the WSDL generator I get a class with a
property "X" of the primitive type plus a boolean "XSpecified" attribute

to
say if it was not specified rather than null. But if I have a complex type
with minOccurs=0 and nillable=true you don't get the "XSpecified"

property.
This means you can't tell the difference between

<outer>
<x xsi:nil="true"/>
</outer>

and

<outer/>

This is a bug, I think. Now if I could only find the place in MSDN to log
bugs...FWIW I tried reporting this to a newsgroup through Visual Studio

2005
beta 2 but it would crash when it brought up the entry box. How does one
report a bug that the bug reporting system crashes?


Nov 12 '05 #5
HQM
Hmm...the wire format -- the schema of the messages -- is EXACTLY my
contract. If my server sends <x><y xsi:nil="true"/></x> or <x/> I need to
know on the client which message was sent to understand the semantics of the
message; my server similiarly has precise and distinct meanings for the first
statement versus the second, so on the client I need a distinct way of
ensuring one message is sent instead of the other.

Peter

"Elena Kharitidi" wrote:
I do not see a problem with interoperability here: there is no assumption on
what type system is used by server. The schema for the "x" element allows
both forms, and .Net generated OM will be able to handle both of them
(xsi:nil=true" or omitted). The fact that your business logic depends on the
wire format is not part of the service contract, but is your application
specific.
And that custom logic could be build into the OM by adding the xSpecified
member.

"HQM" wrote:
So, if we add the xSpecified to the class x where x is an element of a
complex type B in the sequence of A then .NET will respect the Specified
semantic, even though it doesn't generate this indicator for complex types
(as opposed to "valuetypes", by which I take it you mean "primitives" like
int, etc.)? I don't follow the reasoning why this should be optional: you
seem to suggest that this is valid because if both ends are a CLR host then,
well, a null is a null. But of one end is NOT a CLR, and I NEED to
distinguish between them to send the specific message I need at the other
end, then this reasoning would be invalid. Why in a web service should the
design be predicated on the assumption that both ends are CLR? I thought
interoperability was the whole point. Am I missing something?

In any case is this treatment of xxxSpecified documented somewhere? I've
only seen the behaviour with primitives.

BTW, I tried to submit a bug, but I'm asked for profile information. I fill
in every field and hit ok or cancel and am always taken back to the profile
information form. I can't seem to get past it to file the bug report.

"Zafar Abbas" wrote:
This is by design: by default we only generate xSepcified for optional
valuetypes, because from CLR point of view, null is a null. If you need to
differentiate between

<outer> <x xsi:nil="true"/> </outer>

and

<outer/>

You can add the xSpecified by hand to the generated OM, it will be honored.

"HQM" <HQ*@discussions.microsoft.com> wrote in message
news:F8**********************************@microsof t.com...

> If I create an element X of a primitive type with minOccurs=0 and
> nillable=true and run it through the WSDL generator I get a class with a
> property "X" of the primitive type plus a boolean "XSpecified" attribute
to
> say if it was not specified rather than null. But if I have a complex type
> with minOccurs=0 and nillable=true you don't get the "XSpecified"
property.
> This means you can't tell the difference between
>
> <outer>
> <x xsi:nil="true"/>
> </outer>
>
> and
>
> <outer/>
>
> This is a bug, I think. Now if I could only find the place in MSDN to log
> bugs...FWIW I tried reporting this to a newsgroup through Visual Studio
2005
> beta 2 but it would crash when it brought up the entry box. How does one
> report a bug that the bug reporting system crashes?
>

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Erik Klein | last post by:
I have a WebService whose WSDL contains the following snippet: <complexType abstract="true" name="Type"> <sequence> <element name="localId" nillable="true" type="xsd:string"/> <element...
8
by: Marc | last post by:
Hi! I'm calling a web service using C# and a wrapper class generated by wsdl tool. The web service specification contains some nillable parameters which types are Value Types in .NET (long, int,...
7
by: stephan querengaesser | last post by:
hi ng, i try to invoke a webservice-method with an filter-object, that contains value types. if i donīt want to filter the return value of the method, i have to pass a new instance of the...
0
by: John Jenkins | last post by:
Hi, can someone tell me why the following scneario occurs. With the nillable attribute set to true on an element that has min occurs set to zero, I generate a class. As expected this adds the...
0
by: John Jenkins | last post by:
Hi, can someone tell me why the following scneario occurs. With the nillable attribute set to true on an element that has min occurs set to zero, I generate a class. As expected this adds the...
0
by: John Jenkins | last post by:
Hi, apologies for tghe repost, but I cannot get an answer to my question and I have noe posted on 7 news groups. Can someone tell me why the following scneario occurs. With the nillable attribute...
1
by: leslie_tighe | last post by:
Hello, I have webservice created with Axis 1.2.1 and that I am trying to consuming in .NET (VB) using the Microsoft provided tools. While I am able to consume methods on the service that return...
1
by: Andy Babiec | last post by:
Assume I have the following web method... public xyzStructure StructureProvider_GetByParentID(System.Int32? parentID, int start, int pageLength) { return...
0
by: dchappelle | last post by:
Hi, I used wsdl.exe to generate a C# client proxy - included is a piece of the wsdl file of interest... <complexType name="GetSubscriberListEntry"> <sequence> <element name="ServiceId"...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.