missing namespace on root element of WCF proxy client



Hi,
I have the following class that is exposed as a webservice method
parameter parameter .


[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:schemas.sequel.com/
genericImport")]

[System.Xml.Serialization.XmlRootAttribute(Namespace="urn:schemas.sequel.com/
genericImport", IsNullable=false)]
public partial class Schema {

private Import importField;

/// <remarks/>
public Import Import {
get {
return this.importField;
}
set {
this.importField = value;
}
}
}

[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:schemas.sequel.com/
genericImport")]
public partial class Import {

private string recordCountField;

private RecordType recordTypeField;

private bool recordTypeFieldSpecified;

private RecordSource recordSourceField;

private bool recordSourceFieldSpecified;

private Policy[] policysField;
}
have ommited the public properties.

When I use the Add Service Reference funtionality on the client to
generate a proxy the folowing code is generated

[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:schemas.sequel.com/
genericImport")]
public partial class Schema
{

private Import importField;

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=0)]
public Import Import
{
get
{
return this.importField;
}
set
{
this.importField = value;
}
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil",
"3.0.4506.30")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]

[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:schemas.sequel.com/
genericImport")]
public partial class Import
{
etc etc

As you can see in the proxy class the Schema type does not have the
System.Xml.Serialization.XmlRootAttribute as a result when i serialize
the object to xml on the client the xml generated is
<Schema have omitted standard xml namespce definitions>
<Import xmlns="urn:schemas.sequel.com/genericImport">
<other elements>
</Schema>
i was expecting the following xml
<Schema xmlns="urn:schemas.sequel.com/genericImport">
<Import >
<other elements>
</Schema>

Also if i want to deserialize an xml file to the object of type schema
on the proxy i need to supply the following xml
<?xml version="1.0">
<Schema >
<Import xmlns="urn:schemas.sequel.com/genericImport">
<other elements>
</Schema>

I was expecting to submit the following xml
<?xml version="1.0">
<Schema xmlns="urn:schemas.sequel.com/genericImport">
<Import >
<other elements>
</Schema>

On the client proxy why is the Schema element loosing the name space.
The original xsd used to generated the classes on the server is
<xs:schema targetNamespace="urn:schemas.sequel.com/genericImport"
elementFormDefault="qualified" attributeFormDefault="qualified"
id="PolicyImport" xmlns="urn:schemas.sequel.com/genericImport"
xmlns:gi="urn:schemas.sequel.com/genericImport" xmlns:xs="http://
www.w3.org/2001/XMLSchema">
<xs:include schemaLocation="SimpleTypes.xsd"/>
<!-- these attributes describe whether the fields are needed for new
or amended data and are only used within this schema-->
<xs:attribute name="mandatoryNew" type="xs:boolean" />
<xs:attribute name="mandatoryAmend" type="xs:boolean" />
<!-- import root element -->
<xs:element name="Schema" type ="gi:Schema" />
<xs:complexType name ="Schema" >
<xs:sequence>
<xs:element name="Import" type="gi:Import" >

</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name ="Import">
<xs:sequence>
<xs:element name="RecordCount" type="xs:positiveInteger"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:Schema>

Any help greatly appreciated.
.



Relevant Pages

  • .NET 2.0 client / Axis 1.3 Server problem with java.lang.Integer
    ... The client consumes the string fine but the Integer value is always ... public partial class ProvisioningServiceService: ... private System.Threading.SendOrPostCallback ...
    (microsoft.public.dotnet.framework)
  • Re: Null value node is causing deserialization problems
    ... public partial class consumer_response_info { ... private System.Xml.XmlNode final_scoreField; ... parse anymore of the document. ... Visual Studio autogenerated classes mark them as type XmlNode. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Null value node is causing deserialization problems
    ... Let's say I have the following wsdl snipet: ... public partial class consumer_response_info { ... private System.Xml.XmlNode final_scoreField; ... Visual Studio autogenerated classes mark them as type XmlNode. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: CLASS PROBLEM
    ... public partial class Form2: Form ... private WebSeTcrb.Tecrube S; ... public string MerhabaDunya() ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Network Browsing Problem
    ... > All of this is behind my firewall. ... > running everything on a private IP schema with no problems. ... > side of firewall I'm using public IP's for my public servers with no ...
    (comp.security.firewalls)