473,765 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:complexTyp e name="ClassInst ">
<xsd:sequence >
<xsd:element name="ClassName " type="ClassName "/>
<xsd:element name="Inst" type="Instance" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType >

<xsd:complexTyp e name="Structure dEntitySpec">
<xsd:sequence >
<xsd:element name="EntityCla ssInst" type="ClassInst " maxOccurs="10"/>
</xsd:sequence>
</xsd:complexType >

<xsd:complexTyp e name="EntitySpe c">
<xsd:sequence >
<xsd:element name="Structure d" type="Structure dEntitySpec" minOccurs="0"/>
<xsd:element name="Syno" type="xsd:strin g" minOccurs="0"/>
<xsd:element name="Natural" type="xsd:strin g" 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 StructuredEntit ySpec element but a
ClassInst[] element (declared in the StructuredEntit ySpec XML element).

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

....
<entitySpec>
<structured>
<EntityClassIns t>
<ClassName>.. .</ClassName>
<Inst>...<Ins t>
</ EntityClassInst >
</structured>
<syno></syno>
<natural></natural>
</entitySpec>
....

the entitySpec XML element is not conform to classes structure : the
<EntityClassIns t> element is not declared in classes so deserialization
failed (the <EntityClassIns t> is unknown).
Deserializer needs to have this XML element :
....
<entitySpec>
<structured>
<ClassName>.. .</ClassName>
<Inst>...<Ins t>
</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:complexTyp e name="ClassInst ">
<xsd:sequence >
<xsd:element name="ClassName " type="ClassName "/>
<xsd:element name="Inst" type="Instance" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType >

<xsd:complexTyp e name="Structure dEntitySpec">
<xsd:sequence >
<xsd:element minOccurs="0" name="WorkAroun ddotNetBug" type="xsd:integ er"/>
<xsd:element name="EntityCla ssInst" type="ClassInst " maxOccurs="10"/>
</xsd:sequence>
</xsd:complexType >

<xsd:complexTyp e name="EntitySpe c">
<xsd:sequence >
<xsd:element name="Structure d" type="Structure dEntitySpec" minOccurs="0"/>
<xsd:element name="Syno" type="xsd:strin g" minOccurs="0"/>
<xsd:element name="Natural" type="xsd:strin g" 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 StructuredEntit ySpec {

private string workArounddotNe tBugField;
private ClassInst[] entityClassInst Field;
....
}

public partial class EntitySpec {

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

Feb 24 '06 #1
0 1993

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

Similar topics

5
980
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 without a hitch). Before I use this class, I make the necessary calls to instantiate a WebProxy class and then pass in my credentials to set the WebProxy.Credentials property so I can get through the proxy server.
2
2759
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" and return a complex type "FieldSearchResult". The error message as following : "Cannot assign object of type System.String to an object of type System.String. There is an error in XML document (23, 97)." By the way,I hava written a client in Java...
9
3220
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. What it does is to call a webservice with two parameters, one being a integer, the other one being a "String" which contains XML (not the best practice, however that is the target interface and we cannot change that).
1
2862
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 types and of more elaborate classes implementing IXmlSerializable. The resulting WSDL file for the webservice has two separate schemas in its <types> sections, and the client proxy (generated with wsdl.exe) is missing the definitions of the...
0
5115
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 the wsdl). This complex type is a collection of another complex type(elementType), and the Reference.cs has an array of these rather than the single returnedElementsType. If If I want to be able to obtain these elements from the SOAP response I...
4
7099
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 proxy settings on this computer are not configured correctly for web discovery. Press F1 for more information". I am not using a proxy server or behind a firewall. Other people are able to access the service (from tools other than VS.Net), but I am...
9
11937
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: CODEGEN: The operation binding 'getAvaluos' from namespace 'urn:m15.AvaluosPortType' was ignored. The combination of style=rpc with use=literal is not supported.
4
9783
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: C:\wsdl\Customercheck_rs.wsdl Unable to generate source files from contract: The document was understood, but it could not be processed. - The WSDL document contains links that could not be resolved. - There is an error in XML document (9, 10). -...
0
1609
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 appreciated. The error message is Error: Unable to import binding 'BusinessHierarchyBinding' from namespace 'http://com/jpmc/cio/bhservice'. - Unable to import Operation: 'GetBookList' - Operation Binding 'GetBookList' from Namespace...
0
9568
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9398
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10007
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9951
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7378
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5275
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3924
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 we have to send another system
2
3531
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.