472,992 Members | 3,482 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,992 software developers and data experts.

IXmlSerializable GetSchema Bug in wsdl.exe, Help ?

example:
I have a skill object that implements the XmlSerializable interface
Implementing the getschema gives me some unwanted generations towards
the wsdl.exe Reference.cs generation.

skill is an object with properties name and code

public System.Xml.Schema.XmlSchema GetSchema()
{
string _namespace;
System.Xml.Schema.XmlSchema output;
System.Xml.Schema.XmlSchemaElement skill, name, code;
System.Xml.Schema.XmlSchemaComplexType skillType;
System.Xml.Schema.XmlSchemaSequence sequence;

_namespace = "http://tempuri.org/Skill";
output = new System.Xml.Schema.XmlSchema();
output.Namespaces.Add("xsd", "http://www.w3.org/2001/XMLSchema");
output.Namespaces.Add("xsi",
"http://www.w3.org/2001/XMLSchema-instance");
output.Namespaces.Add("tns", _namespace);
output.Id = "SkillShemaID";
output.TargetNamespace = _namespace;
skill = new System.Xml.Schema.XmlSchemaElement();
skill.Name = "Skill";
skillType = new System.Xml.Schema.XmlSchemaComplexType();

sequence = new System.Xml.Schema.XmlSchemaSequence();
name = new System.Xml.Schema.XmlSchemaElement();
name.Name = "Name";
name.SchemaTypeName = new System.Xml.XmlQualifiedName(
"string",
"http://www.w3.org/2001/XMLSchema"
);
sequence.Items.Add(name);
code = new System.Xml.Schema.XmlSchemaElement();
code.Name = "Code";
code.SchemaTypeName = new System.Xml.XmlQualifiedName(
"string",
"http://www.w3.org/2001/XMLSchema"
);
sequence.Items.Add(code);
skillType.Particle = sequence;
skill.SchemaType = skillType;
output.Items.Add(skill);

return output;

}

A Webservice is created, that only has a method GetSkill and this
returns the object Skill mentioned earlier.

The result in the wsdl is something like this:
<s:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://tempuri.org/Skill"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
targetNamespace="http://tempuri.org/Skill" id="SkillShemaID">
<xsd:element name="Skill">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Name" type="xsd:string" />
<xsd:element name="Code" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</s:schema>

But using this wsdl by the wsdl.exe, so in my reference.cs file, this
will be generated as:

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("http://tempuri.org/GetSkill",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
public SkillShemaID GetSkill(string SkillName, string code) {
object[] results = this.Invoke("GetSkill", new object[] {
SkillName,
code});
return ((SkillShemaID)(results[0]));

where SkillShemaID is the schema id in getschema but no code is
implemented in the reference.cs file to indicate this object.

Any Solutions to avoid this problem?
Custom generation is my last option.
I know that implementing this interface is not recommended by
microsoft but the standard serializer doesn' t help me and I was told
that in version 2.0 framework this will be supported.

Regards,
Steven
Nov 12 '05 #1
1 3780
I have written my custom WSDL proxy generator for Custom Objects
Looks like Getschema has to many problems in the 1.1 version.

regards,
Steven
Nov 12 '05 #2

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

Similar topics

1
by: mattoc | last post by:
Happy new year to all. I have a strange error that I've been trying for a while now to fathom.. Basically I have a hierarchy of state classes that I need to serialize to XML. Some of them can...
0
by: Thomas D. | last post by:
Situation: --------------------------- I have an 'export'-wrapper to my regular objects. For each regular object there is also an export object. An export object derives from the regular object...
1
by: Thomas D. | last post by:
Hello all, I'm using the IXmlSerializable interface for a project and encounter some problems when testing my webservice in a client application. I know this interface is undocumented and not...
1
by: theburnetts | last post by:
I have a complex class heirarchy where all of my classes inherit from a single base class (BaseObject) and this BaseObject class inherits from XPBaseObject. XPBaseObject is a 3rd party base class...
1
by: Peter Nofelt | last post by:
Hey All, I am having issue with serializing a class and its base class using ..net 2.0. I am using IXmlSerializable I've provided code displaying my at the bottom of this post. Thanks ahead...
0
by: burningmidget | last post by:
I am having trouble using IXmlSerializable within a base class and having xsi:type work correctly when deserializing an xml file. Here is a very simplified version of the what is going on in the...
5
by: Ken | last post by:
I'm trying to run a loop to capture column property information from a table in my datasource. Can anybody see where this is going wrong? Dim tbl As New DataTable Dim col As DataColumn Dim x...
0
by: valentin tihomirov | last post by:
I wanted to transfer some binary data to my Web Service. There is an example: Yasser Shohoud -- "Web services and large content in .NET 2.0" @...
0
by: =?Utf-8?B?Ym9iYnk=?= | last post by:
am trying to inherits membership class and implementing IXmlSerializable but it doesn't work. public class SSOMembershipUser : System.Web.Security.MembershipUser ,IXmlSerializable ...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.