473,499 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IsNullable:=true in Proxy class

<NEWBIE ALERT>

Owing to staff lossage, I've been forced to take over maintenance and
upgrade of a completely undocumented web service (VS 2003, VB.NET).

I've been asked to amend a Public Function and, being a lazy sort,
thought about using Optional parameters.

However, I noticed something weird about the Function that was built in
the Proxy class:

VB
==

<WebMethod(), SoapHeader("Credentials"), SoapHeader("ResultHeader",
Direction:=SoapHeaderDirection.Out)_
Public Function CreateGroupBooking(ByVal key As IndividualKey, ByVal
groupName As String, _
ByVal email As String, ByVal address As Address, ByVal
contactFirstName As String, _
ByVal contactLastName As String) As BookingList

PROXY
======

Public Function CreateGroupBooking(ByVal key As IndividualKey, ByVal
groupName As String, ByVal email As String,
<System.Xml.Serialization.XmlElementAttribute(IsNu llable:=true)ByVal
Address As Address, ByVal contactFirstName As String, ByVal
contactLastName As String) As
<System.Xml.Serialization.XmlElementAttribute("Boo kingList",
IsNullable:=true)BookingList
I can't quite figure out what's with the

<System.Xml.Serialization.XmlElementAttribute(IsNu llable:=true)>

that prefixes the Address parameter and the BookingList return.

I note that the class declaration for the BookingList, for example is:

<XmlRoot(ElementName:="BookingList")_
Public Class BookingList

If I remove the line

<XmlRoot(ElementName:="BookingList")_

the tag is not there! The same goes for the Address class.

Is this some kind of kludge to allow nullable parameters? Remember, I
am a newbie!

Thanks

Edward

Nov 24 '06 #1
1 3926
The XML structures being sent on the wire (the SOAP message content) have to
be declared somewhere. As BookingList in your case is a Class, it has to bear
the <XmlRootattribute to be serialized correctly. XmlSerialization is the
default when using WebServices.

This in injected automatically by VS when building.
--
rgds.
/Claus Konrad
MCSD.NET (C#)
"te********@hotmail.com" wrote:
<NEWBIE ALERT>

Owing to staff lossage, I've been forced to take over maintenance and
upgrade of a completely undocumented web service (VS 2003, VB.NET).

I've been asked to amend a Public Function and, being a lazy sort,
thought about using Optional parameters.

However, I noticed something weird about the Function that was built in
the Proxy class:

VB
==

<WebMethod(), SoapHeader("Credentials"), SoapHeader("ResultHeader",
Direction:=SoapHeaderDirection.Out)_
Public Function CreateGroupBooking(ByVal key As IndividualKey, ByVal
groupName As String, _
ByVal email As String, ByVal address As Address, ByVal
contactFirstName As String, _
ByVal contactLastName As String) As BookingList

PROXY
======

Public Function CreateGroupBooking(ByVal key As IndividualKey, ByVal
groupName As String, ByVal email As String,
<System.Xml.Serialization.XmlElementAttribute(IsNu llable:=true)ByVal
Address As Address, ByVal contactFirstName As String, ByVal
contactLastName As String) As
<System.Xml.Serialization.XmlElementAttribute("Boo kingList",
IsNullable:=true)BookingList
I can't quite figure out what's with the

<System.Xml.Serialization.XmlElementAttribute(IsNu llable:=true)>

that prefixes the Address parameter and the BookingList return.

I note that the class declaration for the BookingList, for example is:

<XmlRoot(ElementName:="BookingList")_
Public Class BookingList

If I remove the line

<XmlRoot(ElementName:="BookingList")_

the tag is not there! The same goes for the Address class.

Is this some kind of kludge to allow nullable parameters? Remember, I
am a newbie!

Thanks

Edward

Nov 24 '06 #2

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

Similar topics

0
895
by: Chatterbox | last post by:
Hello all, The XML file generated by the attached code correctly generates the <Items xsi:nil="true"/> element when serializing, but when deserializing, the Items field becomes an zero-sized...
0
3006
by: keith bannister via .NET 247 | last post by:
(Type your message here) -------------------------------- From: keith bannister Hi, I'm new to .net (as of last week) but here goes. I want to serialize/deserialize a file the conforms...
5
7266
by: Keith Bannister | last post by:
I'm new to .net so here goes. I'm tying to deserialize a class that is associated with an XML schema. I created the C# class with xsd.exe as below: xsd.exe /c /n:somenamespace...
0
1455
by: Gastin | last post by:
I am digesting a web serivce from Amazon.Com. I have the following class which was autogenerated by VS.NET when I created a Web Reference to...
2
2303
by: Gastin | last post by:
I am consuming a web serivce from Amazon.Com. I have the following class which was autogenerated by VS.NET when I created a Web Reference to...
0
3497
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
1339
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
1121
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...
0
1535
by: cfatulescu | last post by:
Hello, i'm trying to reproduce a method using Reflection.Emit, everything is going well except one small thing, without all my job is done for nothing. I can not reproduce the keyword...
0
7006
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
7169
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,...
1
6892
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
7385
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
5467
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,...
1
4917
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4597
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1425
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.