473,396 Members | 1,599 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,396 software developers and data experts.

nullable types and the wsdl generated by Studio 2005

Assume I have the following web method...
[WebMethod(Description="Get rows from xyz filtered by the ParentID
column.")]
public xyzStructure StructureProvider_GetByParentID(System.Int32?
parentID, int start, int pageLength)
{
return StructureProvider.GetByParentID(parentID, start, pageLength);
}

(Note the Int32? data type - we want the user to be able to pass in a
null parentID)

Studio 2005 generates the following in the wsdl...
<s:element name="StructureProvider_GetByParentID">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="parentID"
nillable="true" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="start" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="pageLength" type="s:int"
/>
</s:sequence>
</s:complexType>
</s:element>
Is this correct? Can an xsd element be nillable="true" AND
minOccurs="1" ? The biztalk 2006 beta forum guys say this shouldn't be
allowed (since it doesn't like the example above)

Mar 8 '06 #1
1 1707
Yes, it basically means the element must be provided but it can be null
so it goes across the wire like this:

<parentID xsi:nil="true" />

You can achieve the same with standard reference types by decorating
them with [XmlElement(IsNullable=true)].

This can be useful for creating non-ambiguous WSDL when you have
<xs:any> placeholders.

Josh
http://www.thejoyofcode.com/

Mar 9 '06 #2

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

Similar topics

3
by: GavinM | last post by:
I have the same question as andreas.w.h.k asked on 1/5. Our configuration is as follows: The client must use the URL https://clustername.xyz.com/webservice.asmx to access this web service. ...
6
by: Steven Livingstone | last post by:
Bit of advice here folks. I am creating a default constructor that just initializes a new instance of my object and a secon constructor that takes an ID and loads an object with data from the...
8
by: shawnk | last post by:
Given several nullable boolean flags; bool? l_flg_01 = true; bool? l_flg_02 = false; bool? l_flg_03 = true; bool? l_result_flg = null; I would have liked...
1
by: louis_la_brocante | last post by:
Dear all, I am having trouble generating a client proxy for a webservice whose methods return a "complex" type. The type is complex in that it is a class whose members are a mix of primitive...
0
by: Larry Lard | last post by:
There seems to be something a bit lacking in the way the dataset designer thing deals (or rather doesn't) with nullable fields in VS2005. Maybe it's cos I'm using VB2005 Express (which is variously...
5
by: CindyRob | last post by:
Using .NET framework 1.1 SP1, .NET framework SDK 1.1 SP1, Visual Studio .NET 2003, hotfixes 892202 and 823639. I create a proxy class using wsdl.exe, and in the serialized XML request, I see...
0
by: shaily | last post by:
hi I have a java web service called "Registration service" and C# client which is a consumer of that service java web service running under Tomcat has following interface API exposed ...
5
by: =?Utf-8?B?a3Jpcw==?= | last post by:
I created a simple webservice .asmx on Visual Studio 2005. As I plan to deploy it to Sharepoint Portal 2003, I copied asmx to \web server extensions\60\ISAPI directory of the server, where all...
0
by: nightwatch77 | last post by:
Hello, I have recently stumbled upon a problem with serialization of nullable value types in .Net 2.0 and would appreciate any explanation of what's happening. My application is hosted in IIS...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.