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

Problem with enumeration with an empty value

I have a WSDL containing this enumeration type

<xsd:simpleType name="item_type_enum">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="VCD"/>
<xsd:enumeration value="SVCD"/>
<xsd:enumeration value="CDAUDIO"/>
<xsd:enumeration value="DVD"/>
<xsd:enumeration value=""/><!-- can be an empty string -->
</xsd:restriction>
</xsd:simpleType>

Compiling a proxy i get this enumeration
item_type_enum.VCD
item_type_enum.SVCD
item_type_enum.CDAUDIO
item_type_enum.DVD
item_type_enum.Item
^^^^^^
Why the empty string becomes "Item"? I've tested it with webservice
studio ( http://tinyurl.com/2t8gd ). Composing the soap envelope it sends
the string "Item".
Is there something wrong in the WSDL? I just can't understand what
happens.

--
L'indirizzo di posta non č valido! Per contattarmi in privato usate il
form: http://www.gerry.it/serve/mail/
The mail address given is invalid, if you want to contact me, please use
this form instead: http://www.gerry.it/serve/mail/

Non so dire se cercassi qualcosa, o se fossi inseguito: ricordo che erano
tempi difficili ma io ero, per qualche strana ragione, felice. (S. Benni)
Nov 23 '05 #1
1 4954
Playing with whitespace and empty string is XML sometime can lead to
unexpected behaviour, although it a valid XML schema i would strongly
suggest for you to use nillable attribute instead. BTW you can decorate your
proxy "Item" enum value with this attribute
[XmlEnum("")]
Item,
Regards
Erymuzuan Mustapa
"Stefano G." <ne*******@gerry.it> wrote in message
news:Xn***************************@130.133.1.4...
I have a WSDL containing this enumeration type

<xsd:simpleType name="item_type_enum">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="VCD"/>
<xsd:enumeration value="SVCD"/>
<xsd:enumeration value="CDAUDIO"/>
<xsd:enumeration value="DVD"/>
<xsd:enumeration value=""/><!-- can be an empty string -->
</xsd:restriction>
</xsd:simpleType>

Compiling a proxy i get this enumeration
item_type_enum.VCD
item_type_enum.SVCD
item_type_enum.CDAUDIO
item_type_enum.DVD
item_type_enum.Item
^^^^^^
Why the empty string becomes "Item"? I've tested it with webservice
studio ( http://tinyurl.com/2t8gd ). Composing the soap envelope it sends
the string "Item".
Is there something wrong in the WSDL? I just can't understand what
happens.

--
L'indirizzo di posta non č valido! Per contattarmi in privato usate il
form: http://www.gerry.it/serve/mail/
The mail address given is invalid, if you want to contact me, please use
this form instead: http://www.gerry.it/serve/mail/

Non so dire se cercassi qualcosa, o se fossi inseguito: ricordo che erano
tempi difficili ma io ero, per qualche strana ragione, felice. (S. Benni)

Nov 23 '05 #2

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

Similar topics

0
by: John Resler | last post by:
I am receiving the following validation error in the latest version of XMLSpy : This file is not valid: The complex type of element 'wx:Identifier' does not allow attribute 'ICAO_ID' and no...
2
by: yqlu | last post by:
I hava developed a client in C# that is connected to a 3-party XML Web Services developed in Java based on the AXIS 1.1. Most methods call are successful except for one method named "findObjects"...
2
by: Steven Blair | last post by:
I have been supplied an xsd file. This represents a message I must send a client. My approach to build the message is as follows: DataSet ds = new DataSet(); ds.ReadXmlScheme("myfile.xsd"); ...
2
by: babe20042004 | last post by:
#include<iostream> #include<string> using namespace std; void details( string fNum,int dHour,int dMin,int aHour,int aMin, string aircraft); int main() { //Flights...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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,...
0
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...

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.