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

Problem generating Proxy Class from WSDL

The “Add Web Reference” Visual tool generates bad classes (from WSDL schema)
for ComplexType containing only one element (wsdl.exe and wseWsdl3.exe tools
have the same problem) : if a ComplexType A contains only one element, the
tool don’t generate a class for the ComplexType A. It generates a class only
for the element type (B) included in this ComplexType (if this type contains
more than one element...). For types in WSDL schéma including a ComplexType A
element, the generated classes for these types contains a B element (and not
a A element containing a B element).

For example, for this part of WSDL schema:

<xsd:complexType name="ClassInst">
<xsd:sequence>
<xsd:element name="ClassName" type="ClassName"/>
<xsd:element name="Inst" type="Instance" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="StructuredEntitySpec">
<xsd:sequence>
<xsd:element name="EntityClassInst" type="ClassInst" maxOccurs="10"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="EntitySpec">
<xsd:sequence>
<xsd:element name="Structured" type="StructuredEntitySpec" minOccurs="0"/>
<xsd:element name="Syno" type="xsd:string" minOccurs="0"/>
<xsd:element name="Natural" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>

Will generate the following code:

public partial class ClassInst {

private string classNameField;
private Instance instField;
....
}

public partial class EntitySpec {

private ClassInst[] structuredField;
private string synoField;
private string naturalField;

}

The EntitySpec class doesn’t contain a StructuredEntitySpec element but a
ClassInst[] element (declared in the StructuredEntitySpec XML element).

This error cause deserialization problems. when the Web Service client
receive the SOAP message :

....
<entitySpec>
<structured>
<EntityClassInst>
<ClassName>...</ClassName>
<Inst>...<Inst>
</ EntityClassInst>
</structured>
<syno></syno>
<natural></natural>
</entitySpec>
....

the entitySpec XML element is not conform to classes structure : the
<EntityClassInst> element is not declared in classes so deserialization
failed (the <EntityClassInst> is unknown).
Deserializer needs to have this XML element :
....
<entitySpec>
<structured>
<ClassName>...</ClassName>
<Inst>...<Inst>
</structured>
<syno></syno>
<natural></natural>
</entitySpec>
....

To prevent from this bug, in all ComplexType containing only one element, we
had to add a new optional element (unused) :

<xsd:complexType name="ClassInst">
<xsd:sequence>
<xsd:element name="ClassName" type="ClassName"/>
<xsd:element name="Inst" type="Instance" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="StructuredEntitySpec">
<xsd:sequence>
<xsd:element minOccurs="0" name="WorkArounddotNetBug" type="xsd:integer"/>
<xsd:element name="EntityClassInst" type="ClassInst" maxOccurs="10"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="EntitySpec">
<xsd:sequence>
<xsd:element name="Structured" type="StructuredEntitySpec" minOccurs="0"/>
<xsd:element name="Syno" type="xsd:string" minOccurs="0"/>
<xsd:element name="Natural" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>

Generated classes for these XML types :

public partial class ClassInst {

private string classNameField;
private Instance instField;
....
}

public partial class StructuredEntitySpec {

private string workArounddotNetBugField;
private ClassInst[] entityClassInstField;
....
}

public partial class EntitySpec {

private StructuredEntitySpec structuredField;
private string synoField;
private string naturalField;
....
}
Generated classes are now conform to XML document.

Feb 24 '06 #1
0 1972

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

Similar topics

5
by: Bill Hauver | last post by:
I am attempting to use a web service from my work pc which is behind a firewall. I have used wsdl.exe to create the web service reference class and added it to my project. (this seems to work...
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"...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
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: Richard Gregory | last post by:
Hi, I have the wsdl below, for an Axis web service, and when I select Add Web Refernce in Visual Studio the proxy is missing a class representing the returnedElementsType (see reference.cs below...
4
by: Monty | last post by:
VS.Net 2005 on Win XP SP2 I'm trying to add a web reference to an external SOAP application written in RemObjects, but when I attempt to add the reference I get an error message saying "The...
9
by: Cesar | last post by:
Hello there, A java programmer sent me a wsdl file, which I have to use to consume his web methods. When I run the wsld.exe tool to generate the class' code, I get the following message: ...
4
by: devikiran | last post by:
Client has provided me a WSDL file generated using BPEL v10.1.3.3.0. When i try to generate the proxy class in visual studio .net 2003 I am getting the following error. Reading WSDL from:...
0
by: freshj | last post by:
I am attempting to create a C# proxy using WseWsdl3 against a WSDL file created by out Java development staff. I am having the hardest time figuring out what the issue is. Any help would be greatly...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...

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.