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.Sche ma.XmlSchema GetSchema()
{
string _namespace;
System.Xml.Sche ma.XmlSchema output;
System.Xml.Sche ma.XmlSchemaEle ment skill, name, code;
System.Xml.Sche ma.XmlSchemaCom plexType skillType;
System.Xml.Sche ma.XmlSchemaSeq uence sequence;
_namespace = "http://tempuri.org/Skill";
output = new System.Xml.Sche ma.XmlSchema();
output.Namespac es.Add("xsd", "http://www.w3.org/2001/XMLSchema");
output.Namespac es.Add("xsi",
"http://www.w3.org/2001/XMLSchema-instance");
output.Namespac es.Add("tns", _namespace);
output.Id = "SkillShema ID";
output.TargetNa mespace = _namespace;
skill = new System.Xml.Sche ma.XmlSchemaEle ment();
skill.Name = "Skill";
skillType = new System.Xml.Sche ma.XmlSchemaCom plexType();
sequence = new System.Xml.Sche ma.XmlSchemaSeq uence();
name = new System.Xml.Sche ma.XmlSchemaEle ment();
name.Name = "Name";
name.SchemaType Name = new System.Xml.XmlQ ualifiedName(
"string",
"http://www.w3.org/2001/XMLSchema"
);
sequence.Items. Add(name);
code = new System.Xml.Sche ma.XmlSchemaEle ment();
code.Name = "Code";
code.SchemaType Name = new System.Xml.XmlQ ualifiedName(
"string",
"http://www.w3.org/2001/XMLSchema"
);
sequence.Items. Add(code);
skillType.Parti cle = sequence;
skill.SchemaTyp e = skillType;
output.Items.Ad d(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="SkillShemaI D">
<xsd:element name="Skill">
<xsd:complexTyp e>
<xsd:sequence >
<xsd:element name="Name" type="xsd:strin g" />
<xsd:element name="Code" type="xsd:strin g" />
</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.Serv ices.Protocols. SoapDocumentMet hodAttribute("h ttp://tempuri.org/GetSkill",
RequestNamespac e="http://tempuri.org/",
ResponseNamespa ce="http://tempuri.org/",
Use=System.Web. Services.Descri ption.SoapBindi ngUse.Literal,
ParameterStyle= System.Web.Serv ices.Protocols. SoapParameterSt yle.Wrapped)]
public SkillShemaID GetSkill(string SkillName, string code) {
object[] results = this.Invoke("Ge tSkill", 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 1 3833
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 contain Exceptions, so I've decided to
implement IXmlSerializable to get round the fact that Exception is not
serializable.
|
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 and has for each property in the base object an extra boolean
property. That extra properties tells wether to include the base property in
the final export (= webservice) or not. That is because not all the
properties may be exposed all the time...
|
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 intended for use, but I think this is the
only solution for my situation. I searched the web, in the hope finding the
answer, without any luck, so my final hope is with you.
Let me explain the situation:
I have an 'export'-wrapper to my regular...
|
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 from Express
Persistent Objects (XPO) from DevExpress. It looks kind of like
this...
BaseObject - (inherits XPBaseObject)
UserCase - (root object in my heirarchy - inherits from BaseObject)
- UserCase has many properties, some of which are...
|
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 of time for any help or feedback.
Cheers,
Peter
| |
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 code:
public class BaseJunkClass : IXmlSerializable
{
public void ReadXml(XmlReader Reader) { }
public void WriteXml(XmlWriter Writer) { }
|
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 As Integer
Dim colName(99) As String
Dim colType(99) As String
cn.Open()
tbl = cn.GetSchema("Orders") 'Orders is a table in the
|
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" @
http://blogs.msdn.com/yassers/archive/2004/11/10/255212.aspx
It seems that the demo code is a part of some Web Service, since I see the
DownloadSong() method has the attribute. The problem is to
obtain the SongStream schema, which is required to generate the proxy.
Normally, the Web Service...
|
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
'SSO.Security.SSOMembershipUser' does not implement interface member
'System.Xml.Serialization.IXmlSerializable.GetSchema()'
|
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
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...
|
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
| |
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |