473,512 Members | 15,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# unable to deserialize simpleType enumeration

The problem:
We have an interface (EnumInterface), an enumeration container
(EnumContainer) and an enumeration type (TheEnum). We can set the
EnumContainer through the EnumInterface. However when we retrieve the
EnumContainer from the EnumInterface, the TheEnum within the EnumContainer is
null (Assert.IsNotNull(enumService.getEnumContainer().a nEnum); throws an
exception).

Any reason why C# can't retrieve the enum value ?

The setup:
The server is implemented using Axis 1.4.
The client C# on .Net 2.0

Note 1: we must have an rpc-encoded server.

Note 2: The previous C# client in with .Net 1.1 had no problem with this
scenario. The problem was introduced when we made the switch to .Net 2.0

The WSDL:
http://www.javamart.ca/enumProblem/wsdl/ep.wsdl

The Client code:
EnumInterfaceService enumService = new EnumInterfaceService();
EnumContainer enumContainer = new EnumContainer();
enumContainer.name = "blabla";
enumContainer.anEnum = TheEnum.Foo;
enumService.setEnumContainer(enumContainer);
Assert.IsNotNull(enumService.getEnumContainer().an Enum); //Fails here !!
Assert.AreEqual(enumService.getEnumContainer().anE num, TheEnum.Foo);

SOAP setEnumContainer:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://enumproblem.javamart.ca"
xmlns:types="http://enumproblem.javamart.ca/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:setEnumContainer>
<enumContainer href="#id1"/>
</tns:setEnumContainer>
<tns:EnumContainer id="id1" xsi:type="tns:EnumContainer">
<anEnum xsi:type="tns:TheEnum">Foo</anEnum>
<name xsi:type="xsd:string">blabla</name>
</tns:EnumContainer>
</soap:Body>
</soap:Envelope>

SOAP getEnumContainer:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:getEnumContainerResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://enumproblem.javamart.ca">
<getEnumContainerReturn href="#id0"/>
</ns1:getEnumContainerResponse>
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:EnumContainer"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="http://enumproblem.javamart.ca">
<anEnum href="#id1"/>
<name xsi:type="soapenc:string">blabla</name>
</multiRef>
<multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns3:TheEnum" xmlns:ns3="http://enumproblem.javamart.ca"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">Foo</multiRef>
</soapenv:Body>
</soapenv:Envelope>

Nov 7 '06 #1
0 3985

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

Similar topics

0
438
by: FabFreddy | last post by:
Hi, I can't find out what the problem is with the error message below! I get it when I go from one to another page with controls in these pages. Anyone knows??? THX Unable to validate...
2
6687
by: Ian Griffiths | last post by:
I have been given a schema, instances of which I'm required to be able to consume and generate. I'd like to be able to manipulate these instances as DataSets internally in my application. The...
0
1319
by: Codex Twin | last post by:
hello group: The following is a fragment from a schema which defines the EWethnicCategoryStructure type. As you can see, its type is defined by the SimpleType enumeration EWethnicCategoryType....
2
2275
by: aevans1108 | last post by:
Greetings Please give me a push in the right direction if this the wrong place to ask this question. Why is it that I can get the count of facets for an element restriction if the...
4
5750
by: Mike Fellows | last post by:
running IIS on a single server, hosting pages on an intranet basis, one single user out of 50 is having an unable to validate data issue how do i fix this (the microsoft KB is a little...
3
3120
by: GT | last post by:
I have a .NET client that consumes an Axis web service. A change was made recently to the AXIS web service, and ever since then my .NET proxy class has been throwing an InvalidCastException. The...
0
2296
by: Steven Bolard | last post by:
Hello, I am trying to port my .net 1.1 application to 2.0. I am using vs2005. I am trying to get my webservices to run and although i can compile them and and get wsdl and service descriptions...
0
1415
by: JamesG | last post by:
Hi all, In my WSDL, I have several constraints on the data structure. The problem is, they aren't being enforced. Take the following two as an example. <xsd:simpleType name="consTokenType">...
2
1628
by: JamesG | last post by:
Hi all, I'm developing a web service, and as part of the WSDL I have the following constraints: <xsd:simpleType name="consTokenType"> <xsd:restriction base="xsd:string"> <xsd:pattern...
0
7153
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
7371
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
7432
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...
1
7093
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
7517
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
5676
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
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1583
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 ...
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.