473,398 Members | 2,368 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,398 software developers and data experts.

.NET WebService method doesn't understand xsd list

I've posted this before but no one seems to respond. I need to know if this is a bug

I am implementing a webservice against a preexisting schema/wsdl

The schema specifies an element called Type that is a xml schema list of qname (i.e. it wants the message to have a space deimited list of qnames.)

However wsdl.exe interprets this incorrectly as 'XmlQualifiedName Types' rather than 'XmlQualifiedName [] Types'. Simply changing the type in the C# class to an array results in incorrect serialization/exceptions. This is a fairly common piece of schema so I'm surprised at the lack of support for it

Is there anything I can do to force the array to serialize/deserialize as a correct xml schema list? Perhaps a set of Xml Attributes or something? So far I've had no luck

Nov 12 '05 #1
4 2281
can we see the wsdl and or xsd ?
-Dino

"ma***@online.nospam" <an*******@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
I've posted this before but no one seems to respond. I need to know if this is a bug.
I am implementing a webservice against a preexisting schema/wsdl.

The schema specifies an element called Type that is a xml schema list of qname (i.e. it wants the message to have a space deimited list of qnames.)
However wsdl.exe interprets this incorrectly as 'XmlQualifiedName Types' rather than 'XmlQualifiedName [] Types'. Simply changing the type in the C#
class to an array results in incorrect serialization/exceptions. This is a
fairly common piece of schema so I'm surprised at the lack of support for
it.
Is there anything I can do to force the array to serialize/deserialize as a correct xml schema list? Perhaps a set of Xml Attributes or something?
So far I've had no luck.

Nov 12 '05 #2
after seeing your prior post

can you serialize to a string and then do your own parsing of the qnames?

"ma***@online.nospam" <an*******@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
I've posted this before but no one seems to respond. I need to know if this is a bug.
I am implementing a webservice against a preexisting schema/wsdl.

The schema specifies an element called Type that is a xml schema list of qname (i.e. it wants the message to have a space deimited list of qnames.)
However wsdl.exe interprets this incorrectly as 'XmlQualifiedName Types' rather than 'XmlQualifiedName [] Types'. Simply changing the type in the C#
class to an array results in incorrect serialization/exceptions. This is a
fairly common piece of schema so I'm surprised at the lack of support for
it.
Is there anything I can do to force the array to serialize/deserialize as a correct xml schema list? Perhaps a set of Xml Attributes or something?
So far I've had no luck.

Nov 12 '05 #3
Here is the xsd for the list of qnames. The result should be an object called Probe with a member Types that is an array of XmlQualifiedName. Instead it is simply a single XmlQualifiedName. Also the serializer does not seem to know how to serialize a list in the space delimited manner that is required. Incidentally if you make the xsd list an attribute instead of the element contents it does serialize as a list. This is interesting but doesn't help me

<xs:element name='Probe' ><xs:complexType><xs:sequence><xs:element ref='tns:Types' minOccurs='0' /></xs:sequence></xs:complexType></xs:element><!-- Shared global elements --><xs:element name='Types' type='tns:qnlist' /><xs:simpleType name="qnlist"><xs:list itemType='xs:QName' /></xs:simpleType>
Nov 12 '05 #4
I don't know if xsd:list is supported, I haven't used it.

one way to approach this may be to XmlIgnore the actual array of types.
this will prevent the "incorrect serialization" you described previously.
Then add a "shadow member" that helps you serialize the way you want. Make
this member a string. It should have the name specified in your XSD - eg,
Types. You will need a getter and a setter, but the setter should be a
no-op. The getter should examine the array of XmlQualifiedNames and then
build a space-delimited-string that represents the list.

Does this work?

eg

[XmlIgnore]
XmlQualifiedName[] m_Types;

public String Types{
set {
}
get {
String s;
foreach(XmlQualifiedName xqn in m_Types) {.... } // build string
here
return s;
}
}
"ma***@nospam.com" <an*******@discussions.microsoft.com> wrote in message
news:DC**********************************@microsof t.com...
Here is the xsd for the list of qnames. The result should be an object called Probe with a member Types that is an array of XmlQualifiedName.
Instead it is simply a single XmlQualifiedName. Also the serializer does
not seem to know how to serialize a list in the space delimited manner that
is required. Incidentally if you make the xsd list an attribute instead of
the element contents it does serialize as a list. This is interesting but
doesn't help me.
<xs:element name='Probe' ><xs:complexType><xs:sequence><xs:element

ref='tns:Types' minOccurs='0'
/></xs:sequence></xs:complexType></xs:element><!-- Shared global
elements --><xs:element name='Types' type='tns:qnlist' /><xs:simpleType
name="qnlist"><xs:list itemType='xs:QName' /></xs:simpleType>
Nov 12 '05 #5

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

Similar topics

8
by: DraguVaso | last post by:
Hi, I'm new to WebServices, and I'm doing some tests (with a small VB.NET-application) to know the performance-difference between a WebService and the 'normal'-way of getting data (just...
19
by: Adam Short | last post by:
I am trying to write a routine that will connect a .NET server with a classic ASP server. I know the following code doesn't work! The data is being returned as a dataset, however ASP does not...
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
5
by: jb | last post by:
*Please* help --- I'm tearing my hair out. I want to use sessionstate in a webservice, accessed from a client, written in script (JScript, InfoPath). I have written my webservice (C# .NET). I...
7
by: stephan querengaesser | last post by:
hi ng, i try to invoke a webservice-method with an filter-object, that contains value types. if i don´t want to filter the return value of the method, i have to pass a new instance of the...
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...
9
by: Greger | last post by:
Hi, I am building an architecture that passes my custom objects to and from webservices. (Our internal architecture requires me to use webservices to any suggestion to use other remoting...
0
by: Paul Hadfield | last post by:
Hi, From reading various articles on scalability issues, I understand that there is only a finite number of ASP.NET worker threads and any long running task within ASP.NET should be fired off on...
6
by: Peter | last post by:
I have a WebService which returns a List of RunningReport class How do I read this XML data on the client side. How do I convert List<RunningReportfrom the WebService side to List<RunningReporton...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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
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
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
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,...

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.