473,395 Members | 2,796 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.

wsdl.exe -when elementFormDefault="qualified" elements have null n

Using .NET framework 1.1 SP1, .NET framework SDK 1.1 SP1, Visual Studio .NET
2003, hotfixes 892202 and 823639.

I create a proxy class using wsdl.exe, and in the serialized XML request, I
see that any elements that are nested elements in the schema (not global
elements) have their namespaces set to the null namespace. I can see that
the proxy classes have serialization attributes specifying these nested
elements as unqualified:
/// <remarks/>

[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public AuthenticationDataLoginData LoginData;

and so in the XML, the namespace is set to null:

<AuthenticationData>
<LoginData xmlns="">
etc...

I expected that this was happening because in the schema file,
elementFormDefault="unqualified". Therefore, I would expect that if I
changed it to elementFormDefault="qualified", I would see the proxy class
change and would get rid of the xmlns="" in the LoginData field. That didn't
happen - the generated proxy is exactly the same. In other words, no matter
what you set for elementFormDefault, wsdl.exe behaves as if the
elementFormDefault is "unqualified", and the namespace is set to null.
Is this a known bug in wsdl.exe - is there a fix available? I'd like to
minimize the changes to the schema if I can, and I have an external
requirement that no manual changes to the generated proxy class be needed.

Thanks,

--
Cindy
May 13 '06 #1
5 4878
Hi
First of all i would like to know what RunTime Version are you using.
I am using version 1.1.4322.573 and its working perfectly fine. The schema
file is generated with elementformdefault="Qualified" value. Yes but you are
right. This is problem and this has been discussed many times on many groups.
I dont have KB number of this bug but what seems to me that this issue gets
resolved if you replace unqualified with qualified value. As solution i will
suggest that you use earlier version of WSDL to generate Stub. As I have seen
similar problem in VS 2005 too.

"CindyRob" wrote:
Using .NET framework 1.1 SP1, .NET framework SDK 1.1 SP1, Visual Studio .NET
2003, hotfixes 892202 and 823639.

I create a proxy class using wsdl.exe, and in the serialized XML request, I
see that any elements that are nested elements in the schema (not global
elements) have their namespaces set to the null namespace. I can see that
the proxy classes have serialization attributes specifying these nested
elements as unqualified:
/// <remarks/>

[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public AuthenticationDataLoginData LoginData;

and so in the XML, the namespace is set to null:

<AuthenticationData>
<LoginData xmlns="">
etc...

I expected that this was happening because in the schema file,
elementFormDefault="unqualified". Therefore, I would expect that if I
changed it to elementFormDefault="qualified", I would see the proxy class
change and would get rid of the xmlns="" in the LoginData field. That didn't
happen - the generated proxy is exactly the same. In other words, no matter
what you set for elementFormDefault, wsdl.exe behaves as if the
elementFormDefault is "unqualified", and the namespace is set to null.
Is this a known bug in wsdl.exe - is there a fix available? I'd like to
minimize the changes to the schema if I can, and I have an external
requirement that no manual changes to the generated proxy class be needed.

Thanks,

--
Cindy

May 14 '06 #2
Though this problem is not coming on my side but i tried to regenerate this
case, the version i m using creates WSDL with the qualified value of
elementformdefault, instead if i tried to remove defaultnamespace of my
webservice, it compiled with this messege

This web service is using http://tempuri.org/ as its default namespace.
Recommendation: Change the default namespace before the XML Web service is
made public.

So, I tempered the generated WSDL and changed value of elementformdefault
from qualified to unqualified, and I came up with the same proxy code as u
posted here. So it means that you need to change this value to Qualified and
use some earlier version Or use autogenerated proxy using .net IDE.

"Altaf Al-Amin Najwani" wrote:
Hi
First of all i would like to know what RunTime Version are you using.
I am using version 1.1.4322.573 and its working perfectly fine. The schema
file is generated with elementformdefault="Qualified" value. Yes but you are
right. This is problem and this has been discussed many times on many groups.
I dont have KB number of this bug but what seems to me that this issue gets
resolved if you replace unqualified with qualified value. As solution i will
suggest that you use earlier version of WSDL to generate Stub. As I have seen
similar problem in VS 2005 too.

"CindyRob" wrote:
Using .NET framework 1.1 SP1, .NET framework SDK 1.1 SP1, Visual Studio .NET
2003, hotfixes 892202 and 823639.

I create a proxy class using wsdl.exe, and in the serialized XML request, I
see that any elements that are nested elements in the schema (not global
elements) have their namespaces set to the null namespace. I can see that
the proxy classes have serialization attributes specifying these nested
elements as unqualified:
/// <remarks/>

[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public AuthenticationDataLoginData LoginData;

and so in the XML, the namespace is set to null:

<AuthenticationData>
<LoginData xmlns="">
etc...

I expected that this was happening because in the schema file,
elementFormDefault="unqualified". Therefore, I would expect that if I
changed it to elementFormDefault="qualified", I would see the proxy class
change and would get rid of the xmlns="" in the LoginData field. That didn't
happen - the generated proxy is exactly the same. In other words, no matter
what you set for elementFormDefault, wsdl.exe behaves as if the
elementFormDefault is "unqualified", and the namespace is set to null.
Is this a known bug in wsdl.exe - is there a fix available? I'd like to
minimize the changes to the schema if I can, and I have an external
requirement that no manual changes to the generated proxy class be needed.

Thanks,

--
Cindy

May 14 '06 #3
Altaf,

Thank you for your response. My runtime version is 1.1.4322.2032. I cannot
go back to 523 as you suggest because of some other wsdl.exe bugs - you may
have noticed the hotfixes I pointed out as having installed. Our wsdl
includes 2 schemas, schema 1 and schema 2, and schema1 and schema2 both
include schema3. The elementFormDefault setting I am referring to is set in
schema1 and schema2 which are imported by the wsdl. Going back to the
runtime you suggest (which I have experimented with) causes a problem because
of the bug 892202 with including external schemas.

Yes, manually changing the proxy class to Qualified instead of unqualified
does work around the problem, but our customer does not want to have to
manually change their proxies. We are generating schemas based on their
datatype, and generating a version of our wsdl which is specific to their
datatype on the fly. However, just a change from unqualified to Qualified
doesn't seem to arduous to me, we'll see if they agree.

Thank you for your response
--
Cindy
"Altaf Al-Amin Najwani" wrote:
Though this problem is not coming on my side but i tried to regenerate this
case, the version i m using creates WSDL with the qualified value of
elementformdefault, instead if i tried to remove defaultnamespace of my
webservice, it compiled with this messege

This web service is using http://tempuri.org/ as its default namespace.
Recommendation: Change the default namespace before the XML Web service is
made public.

So, I tempered the generated WSDL and changed value of elementformdefault
from qualified to unqualified, and I came up with the same proxy code as u
posted here. So it means that you need to change this value to Qualified and
use some earlier version Or use autogenerated proxy using .net IDE.

"Altaf Al-Amin Najwani" wrote:
Hi
First of all i would like to know what RunTime Version are you using.
I am using version 1.1.4322.573 and its working perfectly fine. The schema
file is generated with elementformdefault="Qualified" value. Yes but you are
right. This is problem and this has been discussed many times on many groups.
I dont have KB number of this bug but what seems to me that this issue gets
resolved if you replace unqualified with qualified value. As solution i will
suggest that you use earlier version of WSDL to generate Stub. As I have seen
similar problem in VS 2005 too.

"CindyRob" wrote:
Using .NET framework 1.1 SP1, .NET framework SDK 1.1 SP1, Visual Studio .NET
2003, hotfixes 892202 and 823639.

I create a proxy class using wsdl.exe, and in the serialized XML request, I
see that any elements that are nested elements in the schema (not global
elements) have their namespaces set to the null namespace. I can see that
the proxy classes have serialization attributes specifying these nested
elements as unqualified:
/// <remarks/>

[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public AuthenticationDataLoginData LoginData;

and so in the XML, the namespace is set to null:

<AuthenticationData>
<LoginData xmlns="">
etc...

I expected that this was happening because in the schema file,
elementFormDefault="unqualified". Therefore, I would expect that if I
changed it to elementFormDefault="qualified", I would see the proxy class
change and would get rid of the xmlns="" in the LoginData field. That didn't
happen - the generated proxy is exactly the same. In other words, no matter
what you set for elementFormDefault, wsdl.exe behaves as if the
elementFormDefault is "unqualified", and the namespace is set to null.
Is this a known bug in wsdl.exe - is there a fix available? I'd like to
minimize the changes to the schema if I can, and I have an external
requirement that no manual changes to the generated proxy class be needed.

Thanks,

--
Cindy

May 15 '06 #4
IF you could try to find out the KB number of the bug you are referring to
that would be very helpful. Thanks
--
Cindy
"Altaf Al-Amin Najwani" wrote:
Hi
First of all i would like to know what RunTime Version are you using.
I am using version 1.1.4322.573 and its working perfectly fine. The schema
file is generated with elementformdefault="Qualified" value. Yes but you are
right. This is problem and this has been discussed many times on many groups.
I dont have KB number of this bug but what seems to me that this issue gets
resolved if you replace unqualified with qualified value. As solution i will
suggest that you use earlier version of WSDL to generate Stub. As I have seen
similar problem in VS 2005 too.

"CindyRob" wrote:
Using .NET framework 1.1 SP1, .NET framework SDK 1.1 SP1, Visual Studio .NET
2003, hotfixes 892202 and 823639.

I create a proxy class using wsdl.exe, and in the serialized XML request, I
see that any elements that are nested elements in the schema (not global
elements) have their namespaces set to the null namespace. I can see that
the proxy classes have serialization attributes specifying these nested
elements as unqualified:
/// <remarks/>

[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public AuthenticationDataLoginData LoginData;

and so in the XML, the namespace is set to null:

<AuthenticationData>
<LoginData xmlns="">
etc...

I expected that this was happening because in the schema file,
elementFormDefault="unqualified". Therefore, I would expect that if I
changed it to elementFormDefault="qualified", I would see the proxy class
change and would get rid of the xmlns="" in the LoginData field. That didn't
happen - the generated proxy is exactly the same. In other words, no matter
what you set for elementFormDefault, wsdl.exe behaves as if the
elementFormDefault is "unqualified", and the namespace is set to null.
Is this a known bug in wsdl.exe - is there a fix available? I'd like to
minimize the changes to the schema if I can, and I have an external
requirement that no manual changes to the generated proxy class be needed.

Thanks,

--
Cindy

May 15 '06 #5
As an update, when I changed the wsdl include of the external schema to
specify elementFormDefault="qualified" explicitly, the problem went away.

I didn't realize it was necessary to re-define the elementFormDefault at
include time - I had thought it would pick it up from the definition in the
schema file. But, changing the include statement in the wsdl:types section
from this:

<xsd:schema
targetNamespace="http://www.ibm.com/xmlns/db2/cm/beans/1.0/schema">
<xsd:include schemaLocation="myschema.xsd"/>
</xsd:schema>

to this:

<xsd:schema elementFormDefault="qualified"
targetNamespace="http://www.ibm.com/xmlns/db2/cm/beans/1.0/schema">
<xsd:include schemaLocation="myschema.xsd"/>
</xsd:schema>

got rid of the problem. I had been changing the value of elementFormDefault
in the declaration of myschema.xsd, thinking that it would be picked up by
the include, not realizing that the implicit value for elementFormDefault in
the wsdl, which is of course unqualified by default, would override the
setting in the schema.
--
Cindy
"CindyRob" wrote:
IF you could try to find out the KB number of the bug you are referring to
that would be very helpful. Thanks
--
Cindy
"Altaf Al-Amin Najwani" wrote:
Hi
First of all i would like to know what RunTime Version are you using.
I am using version 1.1.4322.573 and its working perfectly fine. The schema
file is generated with elementformdefault="Qualified" value. Yes but you are
right. This is problem and this has been discussed many times on many groups.
I dont have KB number of this bug but what seems to me that this issue gets
resolved if you replace unqualified with qualified value. As solution i will
suggest that you use earlier version of WSDL to generate Stub. As I have seen
similar problem in VS 2005 too.

"CindyRob" wrote:
Using .NET framework 1.1 SP1, .NET framework SDK 1.1 SP1, Visual Studio .NET
2003, hotfixes 892202 and 823639.

I create a proxy class using wsdl.exe, and in the serialized XML request, I
see that any elements that are nested elements in the schema (not global
elements) have their namespaces set to the null namespace. I can see that
the proxy classes have serialization attributes specifying these nested
elements as unqualified:
/// <remarks/>

[System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
public AuthenticationDataLoginData LoginData;

and so in the XML, the namespace is set to null:

<AuthenticationData>
<LoginData xmlns="">
etc...

I expected that this was happening because in the schema file,
elementFormDefault="unqualified". Therefore, I would expect that if I
changed it to elementFormDefault="qualified", I would see the proxy class
change and would get rid of the xmlns="" in the LoginData field. That didn't
happen - the generated proxy is exactly the same. In other words, no matter
what you set for elementFormDefault, wsdl.exe behaves as if the
elementFormDefault is "unqualified", and the namespace is set to null.
Is this a known bug in wsdl.exe - is there a fix available? I'd like to
minimize the changes to the schema if I can, and I have an external
requirement that no manual changes to the generated proxy class be needed.

Thanks,

--
Cindy

May 15 '06 #6

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

Similar topics

10
by: Matthew Sims | last post by:
Python Newbie here. This is my first time learning object-oriented programming and trying to break out of the usual Korn/Perl/PHP style of programming. Having some difficulty understand some items....
3
by: Charles Kline | last post by:
Hi all, I pretty much set a fields default value to NULL if it not a "required" field in my app. Just wondering if this is the way to go since I just sort of guessed at this method ;) -...
1
by: Jerry Collings | last post by:
I'm getting improperly nested xml when a column contains null. I modified the first row (customer ALFKI) to have a NULL Address column. I'm using the following XSD Annotated Schema against the...
3
by: Steven Blair | last post by:
Hi, Here is a small example function. What I would like to know is when I should be using null: private bool MyTestFunc(string Message) { StreamWriter sw=null; string str=null;
8
by: Brad Wood | last post by:
When I do this: foreach( Button btn in myForm.Controls ) An exception is raised when no buttons exist. I would simply expect execution to continue after the foreach loop (just as would be the...
12
by: Miles Keaton | last post by:
PG peeps: What's the prevailing wisdom & best-practice advice about when to let a varchar (or any) column be NULL, and when to make it NOT NULL DEFAULT '' (or '0000-00-00' or whatever) - in...
19
by: PengYu.UT | last post by:
I see some code use static_cast<some_pointer_type>(0) instead of NULL to describe null pointer. I'm wondering what is the pros and cons of each way. Is there any reason why we should one verses the...
5
by: Web learner | last post by:
while (dr.Read()) //dr is an instance of sqlDataReader { double minAirTemp = (double)(Single)dr; // minAirTemp is column in SQLExpress table (data type: real, allows nulls) } The above...
17
by: Mark A | last post by:
DB2 8.2 for Linux, FP 10 (also performs the same on DB2 8.2 for Windoes, FP 11). Using the SAMPLE database, tables EMP and EMLOYEE. In the followng stored procedure, 2 NULL columns (COMM) are...
2
by: blixit | last post by:
I have a WSDL: <?xml version="1.0" encoding="utf-8"?> <!-- edited with XMLSpy v2008 sp1 (http://www.altova.com) by me --> <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...
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.