473,416 Members | 1,859 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,416 software developers and data experts.

The data at the root level is invalid exception

MR
I get the following Exception "The data at the root level is invalid. Line
1, position 642" whenever I try to deserialize an incoming SOAP message. The
incoming message is formed well and its length is 642 bytes ( I have
appended it to the end of this message).
I suspect that the reason may have something to do with an incorrect
declaration of which class to de-serialize to.
In the attached code I substituted @@@@@@@ in the code below with
"submitOrderBatchResponse" and "response" but still get the same exception.
Am I overlooking something?
I appreciate your suggestions
thanks
m
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle= System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
public @@@@@@@ submitOrderBatch(Element orderBatchElement)
{
object[] results = this.Invoke("submitOrderBatch", new object[]
{orderBatchElement});
return ((@@@@@@@)(results[0]));
}
[System.Xml.Serialization.SoapTypeAttribute("respon se",
"http://xml.apache.org/xml-soap")]
public class response
{
public submitOrderBatchResponse SubmitOrderBatchResponse;
}
[System.Xml.Serialization.SoapTypeAttribute("submit OrderBatchResponse",
"urn:OrderOperations")]
public class submitOrderBatchResponse
{
[System.Xml.Serialization.XmlElementAttribute("erro rDetail",
typeof(errorDetail))]
[System.Xml.Serialization.XmlElementAttribute("resp onseMessage",
typeof(string))]
[System.Xml.Serialization.XmlElementAttribute("resp onseDetail",
typeof(responseDetail))]
public object Item;
}

<?xml version="1.0" encoding="UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBatchResponse xmlns="urn:OrderOperations">
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="2">
<errorItem customerBatchID="70">
<errorMessage>[OrderOperations].submitOrderBatch() Found badly
formed or missing Xml in following elements Order/OrderHeader
Order/OrderLines</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</submitOrderBatchResponse>
</soap:Body>
</soap:Envelope>
Nov 23 '05 #1
9 6593
HI MR,

See you again. Seems you're still suffering some problem on the webservice
issue. I think the elements and service code in this thread is the current
implement of your service mentioned in your former post ,yes?

From the pasted SOAP Message and class definition, I think all of them are
OK and didn't have any syntax or declaration problems. I'm wondering what
does the
"whenever I try to deserialize an incoming SOAP message"

means, do you mean the .NET webservice client's auto deserialize or you're
manually intercept the SOAP stream and do custom deserializing? If it's
the latter, would you provide some further code on your custom
deserializing steps so that I can have a further test?

In addition, from your service code, you used the following attributes to
control the SOAP request/response message of the webservice
==================
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle= System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
==================

I think you can also consider using the following style attributes:

Using SoapParameterStyle.Bare can help us ingore the .net function
signature and return type. We can just define our custom type for
representing the request / response SOAP element. For example, the
following webservice:

=====================
[WebMethod()]
[SoapDocumentMethod(
ParameterStyle=SoapParameterStyle.Bare
)]

public VariantOperationResponse VariantOperation(VariantOperationRequest
request)
{
VariantOperationResponse response = new VariantOperationResponse();

switch(request.ItemType)
{
case "int":
response.Item = 12345;
break;
case "string":
response.Item = "My String";
break;
case "bool":
response.Item = true;
break;
}

return response;

}
=========================

custom classes
======================
[XmlRoot("variantOperationRequest")]
public class VariantOperationRequest
{
public VariantOperationRequest()
{
}

[XmlElement("itemType")]
public string ItemType;
}
[XmlRoot("variantOperationResponse")]
public class VariantOperationResponse
{
public VariantOperationResponse()
{
}

[XmlElement("intValue",typeof(int))]
[XmlElement("stringValue",typeof(string))]
[XmlElement("boolValue",typeof(bool))]
public object Item;

}
========================

can help generate the following SOAP message:
====request====
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<variantOperationRequest xmlns="http://tempuri.org/">
<itemType>string</itemType></variantOperationRequest>
</soap:Body>
</soap:Envelope>

====response=====
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>
<variantOperationResponse xmlns="http://tempuri.org/">
<stringValue>My String</stringValue></variantOperationResponse>
</soap:Body>
</soap:Envelope>
which is much more clear since it doesn't contain any other element that
specific to the implement platform. This is a preferred approach for
developing SOA services.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
Subject: The data at the root level is invalid exception
Date: Tue, 27 Sep 2005 19:04:17 +0300
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <uy**************@TK2MSFTNGP11.phx.gbl>
Newsgroups:
microsoft.public.dotnet.framework.webservices,micr osoft.public.xml.soap
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
microsoft.public.dotnet.framework.webservices:8036
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I get the following Exception "The data at the root level is invalid. Line
1, position 642" whenever I try to deserialize an incoming SOAP message.
The
incoming message is formed well and its length is 642 bytes ( I have
appended it to the end of this message).
I suspect that the reason may have something to do with an incorrect
declaration of which class to de-serialize to.
In the attached code I substituted @@@@@@@ in the code below with
"submitOrderBatchResponse" and "response" but still get the same exception.
Am I overlooking something?
I appreciate your suggestions
thanks
m
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle= System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
public @@@@@@@ submitOrderBatch(Element orderBatchElement)
{
object[] results = this.Invoke("submitOrderBatch", new object[]
{orderBatchElement});
return ((@@@@@@@)(results[0]));
}
[System.Xml.Serialization.SoapTypeAttribute("respon se",
"http://xml.apache.org/xml-soap")]
public class response
{
public submitOrderBatchResponse SubmitOrderBatchResponse;
}
[System.Xml.Serialization.SoapTypeAttribute("submit OrderBatchResponse",
"urn:OrderOperations")]
public class submitOrderBatchResponse
{
[System.Xml.Serialization.XmlElementAttribute("erro rDetail",
typeof(errorDetail))]
[System.Xml.Serialization.XmlElementAttribute("resp onseMessage",
typeof(string))]
[System.Xml.Serialization.XmlElementAttribute("resp onseDetail",
typeof(responseDetail))]
public object Item;
}

<?xml version="1.0" encoding="UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBatchResponse xmlns="urn:OrderOperations">
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="2">
<errorItem customerBatchID="70">
<errorMessage>[OrderOperations].submitOrderBatch() Found
badly
formed or missing Xml in following elements Order/OrderHeader
Order/OrderLines</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</submitOrderBatchResponse>
</soap:Body>
</soap:Envelope>

Nov 23 '05 #2
MR
Hi Steven,
Yes this is a continuation of the previous problem except that I solved the
previous problem by intercepting the SOAP message on the way out and
converting from SOAP 1.1 to SOAP 1.0
I am intercepting the SOAP message on the way in as well and converting it
back from version 1.0 to 1.1. the SOAP message i posted is after I have
converted it.
Since i do not own the Web Service, I do not have the ability to change the
Web Service, so i have to handle everything in the client. Apparently the
DTD files that I received are not accurate so that client/proxy code does
not match the incoming message.
I need to know what changes do i need to make to my client/proxy code to be
able to handle the incoming message OR what changes do i have to make to the
incoming message so that i can handle it with my existing classes
thanks
mr
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:Xi****************@TK2MSFTNGXA01.phx.gbl...
HI MR,

See you again. Seems you're still suffering some problem on the webservice
issue. I think the elements and service code in this thread is the current
implement of your service mentioned in your former post ,yes?

From the pasted SOAP Message and class definition, I think all of them are
OK and didn't have any syntax or declaration problems. I'm wondering what
does the
"whenever I try to deserialize an incoming SOAP message"

means, do you mean the .NET webservice client's auto deserialize or you're
manually intercept the SOAP stream and do custom deserializing? If it's
the latter, would you provide some further code on your custom
deserializing steps so that I can have a further test?

In addition, from your service code, you used the following attributes to
control the SOAP request/response message of the webservice
==================
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle= System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
==================

I think you can also consider using the following style attributes:

Using SoapParameterStyle.Bare can help us ingore the .net function
signature and return type. We can just define our custom type for
representing the request / response SOAP element. For example, the
following webservice:

=====================
[WebMethod()]
[SoapDocumentMethod(
ParameterStyle=SoapParameterStyle.Bare
)]

public VariantOperationResponse VariantOperation(VariantOperationRequest
request)
{
VariantOperationResponse response = new VariantOperationResponse();

switch(request.ItemType)
{
case "int":
response.Item = 12345;
break;
case "string":
response.Item = "My String";
break;
case "bool":
response.Item = true;
break;
}

return response;

}
=========================

custom classes
======================
[XmlRoot("variantOperationRequest")]
public class VariantOperationRequest
{
public VariantOperationRequest()
{
}

[XmlElement("itemType")]
public string ItemType;
}
[XmlRoot("variantOperationResponse")]
public class VariantOperationResponse
{
public VariantOperationResponse()
{
}

[XmlElement("intValue",typeof(int))]
[XmlElement("stringValue",typeof(string))]
[XmlElement("boolValue",typeof(bool))]
public object Item;

}
========================

can help generate the following SOAP message:
====request====
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<variantOperationRequest xmlns="http://tempuri.org/">
<itemType>string</itemType></variantOperationRequest>
</soap:Body>
</soap:Envelope>

====response=====
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>
<variantOperationResponse xmlns="http://tempuri.org/">
<stringValue>My String</stringValue></variantOperationResponse>
</soap:Body>
</soap:Envelope>
which is much more clear since it doesn't contain any other element that
specific to the implement platform. This is a preferred approach for
developing SOA services.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
Subject: The data at the root level is invalid exception
Date: Tue, 27 Sep 2005 19:04:17 +0300
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <uy**************@TK2MSFTNGP11.phx.gbl>
Newsgroups:
microsoft.public.dotnet.framework.webservices,micr osoft.public.xml.soap
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.xml.soap:1165
microsoft.public.dotnet.framework.webservices:8036
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I get the following Exception "The data at the root level is invalid. Line
1, position 642" whenever I try to deserialize an incoming SOAP message.
The
incoming message is formed well and its length is 642 bytes ( I have
appended it to the end of this message).
I suspect that the reason may have something to do with an incorrect
declaration of which class to de-serialize to.
In the attached code I substituted @@@@@@@ in the code below with
"submitOrderBatchResponse" and "response" but still get the same
exception.
Am I overlooking something?
I appreciate your suggestions
thanks
m
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle= System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
public @@@@@@@ submitOrderBatch(Element orderBatchElement)
{
object[] results = this.Invoke("submitOrderBatch", new object[]
{orderBatchElement});
return ((@@@@@@@)(results[0]));
}
[System.Xml.Serialization.SoapTypeAttribute("respon se",
"http://xml.apache.org/xml-soap")]
public class response
{
public submitOrderBatchResponse SubmitOrderBatchResponse;
}
[System.Xml.Serialization.SoapTypeAttribute("submit OrderBatchResponse",
"urn:OrderOperations")]
public class submitOrderBatchResponse
{
[System.Xml.Serialization.XmlElementAttribute("erro rDetail",
typeof(errorDetail))]
[System.Xml.Serialization.XmlElementAttribute("resp onseMessage",
typeof(string))]
[System.Xml.Serialization.XmlElementAttribute("resp onseDetail",
typeof(responseDetail))]
public object Item;
}

<?xml version="1.0" encoding="UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBatchResponse xmlns="urn:OrderOperations">
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="2">
<errorItem customerBatchID="70">
<errorMessage>[OrderOperations].submitOrderBatch() Found
badly
formed or missing Xml in following elements Order/OrderHeader
Order/OrderLines</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</submitOrderBatchResponse>
</soap:Body>
</soap:Envelope>

Nov 23 '05 #3
Thanks for your followup MR,

So the
<?xml version="1.0" encoding="UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBatchResponse xmlns="urn:OrderOperations">
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="2">
<errorItem customerBatchID="70">
<errorMessage>[OrderOperations].submitOrderBatch() Found
badly
formed or missing Xml in following elements Order/OrderHeader
Order/OrderLines</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</submitOrderBatchResponse>
</soap:Body>
</soap:Envelope>
message is the one after you manually converting from 1.0 message to 1.1,
yes? Then, how is your current used client proxy generated? Through which
WSDL file?

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
Subject: Re: The data at the root level is invalid exception
Date: Wed, 28 Sep 2005 17:24:07 +0300
Lines: 252
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <ep**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
microsoft.public.dotnet.framework.webservices:8048
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Hi Steven,
Yes this is a continuation of the previous problem except that I solved the
previous problem by intercepting the SOAP message on the way out and
converting from SOAP 1.1 to SOAP 1.0
I am intercepting the SOAP message on the way in as well and converting it
back from version 1.0 to 1.1. the SOAP message i posted is after I have
converted it.
Since i do not own the Web Service, I do not have the ability to change the
Web Service, so i have to handle everything in the client. Apparently the
DTD files that I received are not accurate so that client/proxy code does
not match the incoming message.
I need to know what changes do i need to make to my client/proxy code to be
able to handle the incoming message OR what changes do i have to make to
the
incoming message so that i can handle it with my existing classes
thanks
mr
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:Xi****************@TK2MSFTNGXA01.phx.gbl...
HI MR,

See you again. Seems you're still suffering some problem on the webservice
issue. I think the elements and service code in this thread is the current
implement of your service mentioned in your former post ,yes?

From the pasted SOAP Message and class definition, I think all of them are
OK and didn't have any syntax or declaration problems. I'm wondering what
does the
"whenever I try to deserialize an incoming SOAP message"

means, do you mean the .NET webservice client's auto deserialize or you're
manually intercept the SOAP stream and do custom deserializing? If it's
the latter, would you provide some further code on your custom
deserializing steps so that I can have a further test?

In addition, from your service code, you used the following attributes to
control the SOAP request/response message of the webservice
==================
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle= System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
==================

I think you can also consider using the following style attributes:

Using SoapParameterStyle.Bare can help us ingore the .net function
signature and return type. We can just define our custom type for
representing the request / response SOAP element. For example, the
following webservice:

=====================
[WebMethod()]
[SoapDocumentMethod(
ParameterStyle=SoapParameterStyle.Bare
)]

public VariantOperationResponse VariantOperation(VariantOperationRequest
request)
{
VariantOperationResponse response = new VariantOperationResponse();

switch(request.ItemType)
{
case "int":
response.Item = 12345;
break;
case "string":
response.Item = "My String";
break;
case "bool":
response.Item = true;
break;
}

return response;

}
=========================

custom classes
======================
[XmlRoot("variantOperationRequest")]
public class VariantOperationRequest
{
public VariantOperationRequest()
{
}

[XmlElement("itemType")]
public string ItemType;
}
[XmlRoot("variantOperationResponse")]
public class VariantOperationResponse
{
public VariantOperationResponse()
{
}

[XmlElement("intValue",typeof(int))]
[XmlElement("stringValue",typeof(string))]
[XmlElement("boolValue",typeof(bool))]
public object Item;

}
========================

can help generate the following SOAP message:
====request====
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<variantOperationRequest xmlns="http://tempuri.org/">
<itemType>string</itemType></variantOperationRequest>
</soap:Body>
</soap:Envelope>

====response=====
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>
<variantOperationResponse xmlns="http://tempuri.org/">
<stringValue>My String</stringValue></variantOperationResponse>
</soap:Body>
</soap:Envelope>
which is much more clear since it doesn't contain any other element that
specific to the implement platform. This is a preferred approach for
developing SOA services.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
Subject: The data at the root level is invalid exception
Date: Tue, 27 Sep 2005 19:04:17 +0300
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <uy**************@TK2MSFTNGP11.phx.gbl>
Newsgroups:
microsoft.public.dotnet.framework.webservices,micr osoft.public.xml.soap
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.xml.soap:1165
microsoft.public.dotnet.framework.webservices:8036
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I get the following Exception "The data at the root level is invalid. Line
1, position 642" whenever I try to deserialize an incoming SOAP message.
The
incoming message is formed well and its length is 642 bytes ( I have
appended it to the end of this message).
I suspect that the reason may have something to do with an incorrect
declaration of which class to de-serialize to.
In the attached code I substituted @@@@@@@ in the code below with
"submitOrderBatchResponse" and "response" but still get the same
exception.
Am I overlooking something?
I appreciate your suggestions
thanks
m
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle= System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
public @@@@@@@ submitOrderBatch(Element orderBatchElement)
{
object[] results = this.Invoke("submitOrderBatch", new object[]
{orderBatchElement});
return ((@@@@@@@)(results[0]));
}
[System.Xml.Serialization.SoapTypeAttribute("respon se",
"http://xml.apache.org/xml-soap")]
public class response
{
public submitOrderBatchResponse SubmitOrderBatchResponse;
}
[System.Xml.Serialization.SoapTypeAttribute("submit OrderBatchResponse",
"urn:OrderOperations")]
public class submitOrderBatchResponse
{
[System.Xml.Serialization.XmlElementAttribute("erro rDetail",
typeof(errorDetail))]
[System.Xml.Serialization.XmlElementAttribute("resp onseMessage",
typeof(string))]
[System.Xml.Serialization.XmlElementAttribute("resp onseDetail",
typeof(responseDetail))]
public object Item;
}

<?xml version="1.0" encoding="UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBatchResponse xmlns="urn:OrderOperations">
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="2">
<errorItem customerBatchID="70">
<errorMessage>[OrderOperations].submitOrderBatch() Found
badly
formed or missing Xml in following elements Order/OrderHeader
Order/OrderLines</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</submitOrderBatchResponse>
</soap:Body>
</soap:Envelope>


Nov 23 '05 #4
MR
the problem is that there is no WSDL document.

"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:HV*************@TK2MSFTNGXA01.phx.gbl...
Thanks for your followup MR,

So the
<?xml version="1.0" encoding="UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBatchResponse xmlns="urn:OrderOperations">
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="2">
<errorItem customerBatchID="70">
<errorMessage>[OrderOperations].submitOrderBatch() Found
badly
formed or missing Xml in following elements Order/OrderHeader
Order/OrderLines</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</submitOrderBatchResponse>
</soap:Body>
</soap:Envelope>
message is the one after you manually converting from 1.0 message to 1.1,
yes? Then, how is your current used client proxy generated? Through which
WSDL file?

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
Subject: Re: The data at the root level is invalid exception
Date: Wed, 28 Sep 2005 17:24:07 +0300
Lines: 252
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <ep**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8048
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Hi Steven,
Yes this is a continuation of the previous problem except that I solved
the
previous problem by intercepting the SOAP message on the way out and
converting from SOAP 1.1 to SOAP 1.0
I am intercepting the SOAP message on the way in as well and converting it
back from version 1.0 to 1.1. the SOAP message i posted is after I have
converted it.
Since i do not own the Web Service, I do not have the ability to change
the
Web Service, so i have to handle everything in the client. Apparently the
DTD files that I received are not accurate so that client/proxy code does
not match the incoming message.
I need to know what changes do i need to make to my client/proxy code to
be
able to handle the incoming message OR what changes do i have to make to
the
incoming message so that i can handle it with my existing classes
thanks
mr
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:Xi****************@TK2MSFTNGXA01.phx.gbl...
HI MR,

See you again. Seems you're still suffering some problem on the
webservice
issue. I think the elements and service code in this thread is the
current
implement of your service mentioned in your former post ,yes?

From the pasted SOAP Message and class definition, I think all of them
are
OK and didn't have any syntax or declaration problems. I'm wondering
what
does the
"whenever I try to deserialize an incoming SOAP message"

means, do you mean the .NET webservice client's auto deserialize or
you're
manually intercept the SOAP stream and do custom deserializing? If it's
the latter, would you provide some further code on your custom
deserializing steps so that I can have a further test?

In addition, from your service code, you used the following attributes to
control the SOAP request/response message of the webservice
==================
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=
System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
==================

I think you can also consider using the following style attributes:

Using SoapParameterStyle.Bare can help us ingore the .net function
signature and return type. We can just define our custom type for
representing the request / response SOAP element. For example, the
following webservice:

=====================
[WebMethod()]
[SoapDocumentMethod(
ParameterStyle=SoapParameterStyle.Bare
)]

public VariantOperationResponse VariantOperation(VariantOperationRequest
request)
{
VariantOperationResponse response = new VariantOperationResponse();

switch(request.ItemType)
{
case "int":
response.Item = 12345;
break;
case "string":
response.Item = "My String";
break;
case "bool":
response.Item = true;
break;
}

return response;

}
=========================

custom classes
======================
[XmlRoot("variantOperationRequest")]
public class VariantOperationRequest
{
public VariantOperationRequest()
{
}

[XmlElement("itemType")]
public string ItemType;
}
[XmlRoot("variantOperationResponse")]
public class VariantOperationResponse
{
public VariantOperationResponse()
{
}

[XmlElement("intValue",typeof(int))]
[XmlElement("stringValue",typeof(string))]
[XmlElement("boolValue",typeof(bool))]
public object Item;

}
========================

can help generate the following SOAP message:
====request====
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<variantOperationRequest xmlns="http://tempuri.org/">
<itemType>string</itemType></variantOperationRequest>
</soap:Body>
</soap:Envelope>

====response=====
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>
<variantOperationResponse xmlns="http://tempuri.org/">
<stringValue>My String</stringValue></variantOperationResponse>
</soap:Body>
</soap:Envelope>
which is much more clear since it doesn't contain any other element that
specific to the implement platform. This is a preferred approach for
developing SOA services.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
Subject: The data at the root level is invalid exception
Date: Tue, 27 Sep 2005 19:04:17 +0300
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <uy**************@TK2MSFTNGP11.phx.gbl>
Newsgroups:
microsoft.public.dotnet.framework.webservices,micr osoft.public.xml.soap
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.xml.soap:1165
microsoft.public.dotnet.framework.webservices:8036
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I get the following Exception "The data at the root level is invalid.
Line
1, position 642" whenever I try to deserialize an incoming SOAP message.
The
incoming message is formed well and its length is 642 bytes ( I have
appended it to the end of this message).
I suspect that the reason may have something to do with an incorrect
declaration of which class to de-serialize to.
In the attached code I substituted @@@@@@@ in the code below with
"submitOrderBatchResponse" and "response" but still get the same
exception.
Am I overlooking something?
I appreciate your suggestions
thanks
m
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=
System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
public @@@@@@@ submitOrderBatch(Element orderBatchElement)
{
object[] results = this.Invoke("submitOrderBatch", new object[]
{orderBatchElement});
return ((@@@@@@@)(results[0]));
}
[System.Xml.Serialization.SoapTypeAttribute("respon se",
"http://xml.apache.org/xml-soap")]
public class response
{
public submitOrderBatchResponse SubmitOrderBatchResponse;
}
[System.Xml.Serialization.SoapTypeAttribute("submit OrderBatchResponse",
"urn:OrderOperations")]
public class submitOrderBatchResponse
{
[System.Xml.Serialization.XmlElementAttribute("erro rDetail",
typeof(errorDetail))]
[System.Xml.Serialization.XmlElementAttribute("resp onseMessage",
typeof(string))]
[System.Xml.Serialization.XmlElementAttribute("resp onseDetail",
typeof(responseDetail))]
public object Item;
}

<?xml version="1.0" encoding="UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBatchResponse xmlns="urn:OrderOperations">
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="2">
<errorItem customerBatchID="70">
<errorMessage>[OrderOperations].submitOrderBatch() Found
badly
formed or missing Xml in following elements Order/OrderHeader
Order/OrderLines</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</submitOrderBatchResponse>
</soap:Body>
</soap:Envelope>


Nov 23 '05 #5
Thanks for your reply MR,

So how did you build the proxy class you currently using? Or just a class
which use XmlSerializer to deserizlie the soap message?

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
<ep**************@TK2MSFTNGP09.phx.gbl>
<HV*************@TK2MSFTNGXA01.phx.gbl>
Subject: Re: The data at the root level is invalid exception
Date: Thu, 29 Sep 2005 13:11:34 +0300
Lines: 330
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <uL**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
microsoft.public.dotnet.framework.webservices:8058
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

the problem is that there is no WSDL document.

"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:HV*************@TK2MSFTNGXA01.phx.gbl...
Thanks for your followup MR,

So the
<?xml version="1.0" encoding="UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBatchResponse xmlns="urn:OrderOperations">
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="2">
<errorItem customerBatchID="70">
<errorMessage>[OrderOperations].submitOrderBatch() Found
badly
formed or missing Xml in following elements Order/OrderHeader
Order/OrderLines</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</submitOrderBatchResponse>
</soap:Body>
</soap:Envelope>
message is the one after you manually converting from 1.0 message to 1.1,
yes? Then, how is your current used client proxy generated? Through which
WSDL file?

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
Subject: Re: The data at the root level is invalid exception
Date: Wed, 28 Sep 2005 17:24:07 +0300
Lines: 252
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <ep**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8048
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Hi Steven,
Yes this is a continuation of the previous problem except that I solved
the
previous problem by intercepting the SOAP message on the way out and
converting from SOAP 1.1 to SOAP 1.0
I am intercepting the SOAP message on the way in as well and converting it
back from version 1.0 to 1.1. the SOAP message i posted is after I have
converted it.
Since i do not own the Web Service, I do not have the ability to change
the
Web Service, so i have to handle everything in the client. Apparently the
DTD files that I received are not accurate so that client/proxy code does
not match the incoming message.
I need to know what changes do i need to make to my client/proxy code to
be
able to handle the incoming message OR what changes do i have to make to
the
incoming message so that i can handle it with my existing classes
thanks
mr
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:Xi****************@TK2MSFTNGXA01.phx.gbl...
HI MR,

See you again. Seems you're still suffering some problem on the
webservice
issue. I think the elements and service code in this thread is the
current
implement of your service mentioned in your former post ,yes?

From the pasted SOAP Message and class definition, I think all of them
are
OK and didn't have any syntax or declaration problems. I'm wondering
what
does the
"whenever I try to deserialize an incoming SOAP message"

means, do you mean the .NET webservice client's auto deserialize or
you're
manually intercept the SOAP stream and do custom deserializing? If it's
the latter, would you provide some further code on your custom
deserializing steps so that I can have a further test?

In addition, from your service code, you used the following attributes to
control the SOAP request/response message of the webservice
==================
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=
System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
==================

I think you can also consider using the following style attributes:

Using SoapParameterStyle.Bare can help us ingore the .net function
signature and return type. We can just define our custom type for
representing the request / response SOAP element. For example, the
following webservice:

=====================
[WebMethod()]
[SoapDocumentMethod(
ParameterStyle=SoapParameterStyle.Bare
)]

public VariantOperationResponse VariantOperation(VariantOperationRequest
request)
{
VariantOperationResponse response = new VariantOperationResponse();

switch(request.ItemType)
{
case "int":
response.Item = 12345;
break;
case "string":
response.Item = "My String";
break;
case "bool":
response.Item = true;
break;
}

return response;

}
=========================

custom classes
======================
[XmlRoot("variantOperationRequest")]
public class VariantOperationRequest
{
public VariantOperationRequest()
{
}

[XmlElement("itemType")]
public string ItemType;
}
[XmlRoot("variantOperationResponse")]
public class VariantOperationResponse
{
public VariantOperationResponse()
{
}

[XmlElement("intValue",typeof(int))]
[XmlElement("stringValue",typeof(string))]
[XmlElement("boolValue",typeof(bool))]
public object Item;

}
========================

can help generate the following SOAP message:
====request====
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<variantOperationRequest xmlns="http://tempuri.org/">
<itemType>string</itemType></variantOperationRequest>
</soap:Body>
</soap:Envelope>

====response=====
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>
<variantOperationResponse xmlns="http://tempuri.org/">
<stringValue>My String</stringValue></variantOperationResponse>
</soap:Body>
</soap:Envelope>
which is much more clear since it doesn't contain any other element that
specific to the implement platform. This is a preferred approach for
developing SOA services.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
Subject: The data at the root level is invalid exception
Date: Tue, 27 Sep 2005 19:04:17 +0300
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <uy**************@TK2MSFTNGP11.phx.gbl>
Newsgroups:
microsoft.public.dotnet.framework.webservices,micr osoft.public.xml.soap
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.xml.soap:1165
microsoft.public.dotnet.framework.webservices:8036
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I get the following Exception "The data at the root level is invalid.
Line
1, position 642" whenever I try to deserialize an incoming SOAP message.
The
incoming message is formed well and its length is 642 bytes ( I have
appended it to the end of this message).
I suspect that the reason may have something to do with an incorrect
declaration of which class to de-serialize to.
In the attached code I substituted @@@@@@@ in the code below with
"submitOrderBatchResponse" and "response" but still get the same
exception.
Am I overlooking something?
I appreciate your suggestions
thanks
m
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=
System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
public @@@@@@@ submitOrderBatch(Element orderBatchElement)
{
object[] results = this.Invoke("submitOrderBatch", new object[]
{orderBatchElement});
return ((@@@@@@@)(results[0]));
}
[System.Xml.Serialization.SoapTypeAttribute("respon se",
"http://xml.apache.org/xml-soap")]
public class response
{
public submitOrderBatchResponse SubmitOrderBatchResponse;
}
[System.Xml.Serialization.SoapTypeAttribute("submit OrderBatchResponse",
"urn:OrderOperations")]
public class submitOrderBatchResponse
{
[System.Xml.Serialization.XmlElementAttribute("erro rDetail",
typeof(errorDetail))]
[System.Xml.Serialization.XmlElementAttribute("resp onseMessage",
typeof(string))]
[System.Xml.Serialization.XmlElementAttribute("resp onseDetail",
typeof(responseDetail))]
public object Item;
}

<?xml version="1.0" encoding="UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBatchResponse xmlns="urn:OrderOperations">
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="2">
<errorItem customerBatchID="70">
<errorMessage>[OrderOperations].submitOrderBatch() Found
badly
formed or missing Xml in following elements Order/OrderHeader
Order/OrderLines</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</submitOrderBatchResponse>
</soap:Body>
</soap:Envelope>



Nov 23 '05 #6
MR
i created a parallel ASP.NET site using the DTD files they gave me, created
the proxy based on that and then manually modified the attributes of the
proxy. i also modified the outgoing message using WSE. now i am trying to
de-serialize the message that i am receiving, but i am not able to. i
thought this would be easier because i can see exactly what is being
received from the server.
i am not sure what the structure of the class that it should be
de-serialized to should be or what the attributes should be.
m
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:Cd*************@TK2MSFTNGXA01.phx.gbl...
Thanks for your reply MR,

So how did you build the proxy class you currently using? Or just a class
which use XmlSerializer to deserizlie the soap message?

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
<ep**************@TK2MSFTNGP09.phx.gbl>
<HV*************@TK2MSFTNGXA01.phx.gbl>
Subject: Re: The data at the root level is invalid exception
Date: Thu, 29 Sep 2005 13:11:34 +0300
Lines: 330
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <uL**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8058
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

the problem is that there is no WSDL document.

"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:HV*************@TK2MSFTNGXA01.phx.gbl...
Thanks for your followup MR,

So the
<?xml version="1.0" encoding="UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBatchResponse xmlns="urn:OrderOperations">
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="2">
<errorItem customerBatchID="70">
<errorMessage>[OrderOperations].submitOrderBatch() Found
badly
formed or missing Xml in following elements Order/OrderHeader
Order/OrderLines</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</submitOrderBatchResponse>
</soap:Body>
</soap:Envelope>
message is the one after you manually converting from 1.0 message to 1.1,
yes? Then, how is your current used client proxy generated? Through which
WSDL file?

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
Subject: Re: The data at the root level is invalid exception
Date: Wed, 28 Sep 2005 17:24:07 +0300
Lines: 252
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <ep**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8048
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Hi Steven,
Yes this is a continuation of the previous problem except that I solved
the
previous problem by intercepting the SOAP message on the way out and
converting from SOAP 1.1 to SOAP 1.0
I am intercepting the SOAP message on the way in as well and converting
it
back from version 1.0 to 1.1. the SOAP message i posted is after I have
converted it.
Since i do not own the Web Service, I do not have the ability to change
the
Web Service, so i have to handle everything in the client. Apparently the
DTD files that I received are not accurate so that client/proxy code does
not match the incoming message.
I need to know what changes do i need to make to my client/proxy code to
be
able to handle the incoming message OR what changes do i have to make to
the
incoming message so that i can handle it with my existing classes
thanks
mr
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:Xi****************@TK2MSFTNGXA01.phx.gbl...
HI MR,

See you again. Seems you're still suffering some problem on the
webservice
issue. I think the elements and service code in this thread is the
current
implement of your service mentioned in your former post ,yes?

From the pasted SOAP Message and class definition, I think all of them
are
OK and didn't have any syntax or declaration problems. I'm wondering
what
does the
"whenever I try to deserialize an incoming SOAP message"

means, do you mean the .NET webservice client's auto deserialize or
you're
manually intercept the SOAP stream and do custom deserializing? If it's
the latter, would you provide some further code on your custom
deserializing steps so that I can have a further test?

In addition, from your service code, you used the following attributes
to
control the SOAP request/response message of the webservice
==================
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=
System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
==================

I think you can also consider using the following style attributes:

Using SoapParameterStyle.Bare can help us ingore the .net function
signature and return type. We can just define our custom type for
representing the request / response SOAP element. For example, the
following webservice:

=====================
[WebMethod()]
[SoapDocumentMethod(
ParameterStyle=SoapParameterStyle.Bare
)]

public VariantOperationResponse VariantOperation(VariantOperationRequest
request)
{
VariantOperationResponse response = new VariantOperationResponse();

switch(request.ItemType)
{
case "int":
response.Item = 12345;
break;
case "string":
response.Item = "My String";
break;
case "bool":
response.Item = true;
break;
}

return response;

}
=========================

custom classes
======================
[XmlRoot("variantOperationRequest")]
public class VariantOperationRequest
{
public VariantOperationRequest()
{
}

[XmlElement("itemType")]
public string ItemType;
}
[XmlRoot("variantOperationResponse")]
public class VariantOperationResponse
{
public VariantOperationResponse()
{
}

[XmlElement("intValue",typeof(int))]
[XmlElement("stringValue",typeof(string))]
[XmlElement("boolValue",typeof(bool))]
public object Item;

}
========================

can help generate the following SOAP message:
====request====
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<variantOperationRequest xmlns="http://tempuri.org/">
<itemType>string</itemType></variantOperationRequest>
</soap:Body>
</soap:Envelope>

====response=====
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>
<variantOperationResponse xmlns="http://tempuri.org/">
<stringValue>My String</stringValue></variantOperationResponse>
</soap:Body>
</soap:Envelope>
which is much more clear since it doesn't contain any other element that
specific to the implement platform. This is a preferred approach for
developing SOA services.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
Subject: The data at the root level is invalid exception
Date: Tue, 27 Sep 2005 19:04:17 +0300
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <uy**************@TK2MSFTNGP11.phx.gbl>
Newsgroups:
microsoft.public.dotnet.framework.webservices,micr osoft.public.xml.soap
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.xml.soap:1165
microsoft.public.dotnet.framework.webservices:8036
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I get the following Exception "The data at the root level is invalid.
Line
1, position 642" whenever I try to deserialize an incoming SOAP message.
The
incoming message is formed well and its length is 642 bytes ( I have
appended it to the end of this message).
I suspect that the reason may have something to do with an incorrect
declaration of which class to de-serialize to.
In the attached code I substituted @@@@@@@ in the code below with
"submitOrderBatchResponse" and "response" but still get the same
exception.
Am I overlooking something?
I appreciate your suggestions
thanks
m
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=
System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
public @@@@@@@ submitOrderBatch(Element orderBatchElement)
{
object[] results = this.Invoke("submitOrderBatch", new object[]
{orderBatchElement});
return ((@@@@@@@)(results[0]));
}
[System.Xml.Serialization.SoapTypeAttribute("respon se",
"http://xml.apache.org/xml-soap")]
public class response
{
public submitOrderBatchResponse SubmitOrderBatchResponse;
}
[System.Xml.Serialization.SoapTypeAttribute("submit OrderBatchResponse",
"urn:OrderOperations")]
public class submitOrderBatchResponse
{
[System.Xml.Serialization.XmlElementAttribute("erro rDetail",
typeof(errorDetail))]
[System.Xml.Serialization.XmlElementAttribute("resp onseMessage",
typeof(string))]
[System.Xml.Serialization.XmlElementAttribute("resp onseDetail",
typeof(responseDetail))]
public object Item;
}

<?xml version="1.0" encoding="UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBatchResponse xmlns="urn:OrderOperations">
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="2">
<errorItem customerBatchID="70">
<errorMessage>[OrderOperations].submitOrderBatch() Found
badly
formed or missing Xml in following elements Order/OrderHeader
Order/OrderLines</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</submitOrderBatchResponse>
</soap:Body>
</soap:Envelope>



Nov 23 '05 #7
Thanks for your response MR,

So would you please provide me a complete sample SOAP request and
response messages list your service client will currently need to produce
and receive (the SOAP 1.1 one after you converted). I can try building a
webservice and client proxy on my side to see whether I can correctly
consume it.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
From: "MR" <co******@newsgroup.nospam>
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
<ep**************@TK2MSFTNGP09.phx.gbl>
<HV*************@TK2MSFTNGXA01.phx.gbl>
<uL**************@tk2msftngp13.phx.gbl>
<Cd*************@TK2MSFTNGXA01.phx.gbl>
Subject: Re: The data at the root level is invalid exception
Date: Sun, 2 Oct 2005 18:39:10 +0300
Lines: 382
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
Message-ID: <uJ**************@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
microsoft.public.dotnet.framework.webservices:8083
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

i created a parallel ASP.NET site using the DTD files they gave me, created
the proxy based on that and then manually modified the attributes of the
proxy. i also modified the outgoing message using WSE. now i am trying to
de-serialize the message that i am receiving, but i am not able to. i
thought this would be easier because i can see exactly what is being
received from the server.
i am not sure what the structure of the class that it should be
de-serialized to should be or what the attributes should be.
m
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:Cd*************@TK2MSFTNGXA01.phx.gbl...
Thanks for your reply MR,

So how did you build the proxy class you currently using? Or just a class
which use XmlSerializer to deserizlie the soap message?

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
<ep**************@TK2MSFTNGP09.phx.gbl>
<HV*************@TK2MSFTNGXA01.phx.gbl>
Subject: Re: The data at the root level is invalid exception
Date: Thu, 29 Sep 2005 13:11:34 +0300
Lines: 330
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <uL**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8058
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

the problem is that there is no WSDL document.

"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:HV*************@TK2MSFTNGXA01.phx.gbl...
Thanks for your followup MR,

So the
<?xml version="1.0" encoding="UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBatchResponse xmlns="urn:OrderOperations">
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="2">
<errorItem customerBatchID="70">
<errorMessage>[OrderOperations].submitOrderBatch() Found
badly
formed or missing Xml in following elements Order/OrderHeader
Order/OrderLines</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</submitOrderBatchResponse>
</soap:Body>
</soap:Envelope>
message is the one after you manually converting from 1.0 message to 1.1,
yes? Then, how is your current used client proxy generated? Through which
WSDL file?

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
Subject: Re: The data at the root level is invalid exception
Date: Wed, 28 Sep 2005 17:24:07 +0300
Lines: 252
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <ep**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8048
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Hi Steven,
Yes this is a continuation of the previous problem except that I solved
the
previous problem by intercepting the SOAP message on the way out and
converting from SOAP 1.1 to SOAP 1.0
I am intercepting the SOAP message on the way in as well and converting
it
back from version 1.0 to 1.1. the SOAP message i posted is after I have
converted it.
Since i do not own the Web Service, I do not have the ability to change
the
Web Service, so i have to handle everything in the client. Apparently the
DTD files that I received are not accurate so that client/proxy code does
not match the incoming message.
I need to know what changes do i need to make to my client/proxy code to
be
able to handle the incoming message OR what changes do i have to make to
the
incoming message so that i can handle it with my existing classes
thanks
mr
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:Xi****************@TK2MSFTNGXA01.phx.gbl...
HI MR,

See you again. Seems you're still suffering some problem on the
webservice
issue. I think the elements and service code in this thread is the
current
implement of your service mentioned in your former post ,yes?

From the pasted SOAP Message and class definition, I think all of them
are
OK and didn't have any syntax or declaration problems. I'm wondering
what
does the
"whenever I try to deserialize an incoming SOAP message"

means, do you mean the .NET webservice client's auto deserialize or
you're
manually intercept the SOAP stream and do custom deserializing? If it's
the latter, would you provide some further code on your custom
deserializing steps so that I can have a further test?

In addition, from your service code, you used the following attributes
to
control the SOAP request/response message of the webservice
==================
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=
System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
==================

I think you can also consider using the following style attributes:

Using SoapParameterStyle.Bare can help us ingore the .net function
signature and return type. We can just define our custom type for
representing the request / response SOAP element. For example, the
following webservice:

=====================
[WebMethod()]
[SoapDocumentMethod(
ParameterStyle=SoapParameterStyle.Bare
)]

public VariantOperationResponse VariantOperation(VariantOperationRequest
request)
{
VariantOperationResponse response = new VariantOperationResponse();

switch(request.ItemType)
{
case "int":
response.Item = 12345;
break;
case "string":
response.Item = "My String";
break;
case "bool":
response.Item = true;
break;
}

return response;

}
=========================

custom classes
======================
[XmlRoot("variantOperationRequest")]
public class VariantOperationRequest
{
public VariantOperationRequest()
{
}

[XmlElement("itemType")]
public string ItemType;
}
[XmlRoot("variantOperationResponse")]
public class VariantOperationResponse
{
public VariantOperationResponse()
{
}

[XmlElement("intValue",typeof(int))]
[XmlElement("stringValue",typeof(string))]
[XmlElement("boolValue",typeof(bool))]
public object Item;

}
========================

can help generate the following SOAP message:
====request====
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<variantOperationRequest xmlns="http://tempuri.org/">
<itemType>string</itemType></variantOperationRequest>
</soap:Body>
</soap:Envelope>

====response=====
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>
<variantOperationResponse xmlns="http://tempuri.org/">
<stringValue>My String</stringValue></variantOperationResponse>
</soap:Body>
</soap:Envelope>
which is much more clear since it doesn't contain any other element that
specific to the implement platform. This is a preferred approach for
developing SOA services.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
Subject: The data at the root level is invalid exception
Date: Tue, 27 Sep 2005 19:04:17 +0300
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <uy**************@TK2MSFTNGP11.phx.gbl>
Newsgroups:
microsoft.public.dotnet.framework.webservices,micr osoft.public.xml.soap
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.xml.soap:1165
microsoft.public.dotnet.framework.webservices:8036
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I get the following Exception "The data at the root level is invalid.
Line
1, position 642" whenever I try to deserialize an incoming SOAP message.
The
incoming message is formed well and its length is 642 bytes ( I have
appended it to the end of this message).
I suspect that the reason may have something to do with an incorrect
declaration of which class to de-serialize to.
In the attached code I substituted @@@@@@@ in the code below with
"submitOrderBatchResponse" and "response" but still get the same
exception.
Am I overlooking something?
I appreciate your suggestions
thanks
m
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=
System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
public @@@@@@@ submitOrderBatch(Element orderBatchElement)
{
object[] results = this.Invoke("submitOrderBatch", new object[]
{orderBatchElement});
return ((@@@@@@@)(results[0]));
}
[System.Xml.Serialization.SoapTypeAttribute("respon se",
"http://xml.apache.org/xml-soap")]
public class response
{
public submitOrderBatchResponse SubmitOrderBatchResponse;
}
[System.Xml.Serialization.SoapTypeAttribute("submit OrderBatchResponse",
"urn:OrderOperations")]
public class submitOrderBatchResponse
{
[System.Xml.Serialization.XmlElementAttribute("erro rDetail",
typeof(errorDetail))]
[System.Xml.Serialization.XmlElementAttribute("resp onseMessage",
typeof(string))]
[System.Xml.Serialization.XmlElementAttribute("resp onseDetail",
typeof(responseDetail))]
public object Item;
}

<?xml version="1.0" encoding="UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBatchResponse xmlns="urn:OrderOperations">
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="2">
<errorItem customerBatchID="70">
<errorMessage>[OrderOperations].submitOrderBatch() Found
badly
formed or missing Xml in following elements Order/OrderHeader
Order/OrderLines</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</submitOrderBatchResponse>
</soap:Body>
</soap:Envelope>




Nov 23 '05 #8
Hi MR,

From the three SOAP message you provided (two request , one respones), the
following one :
use the
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">

namespace seems a bit strange since not all the elements under <body>
element be marked with "ns1" namespace prefix
=================================
<?xml version="1.0" encoding="utf-8" ?>
- <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
- <SOAP-ENV:Body>
- <ns1:submitOrderBatch xmlns:ns1="urn:OrderOperations"
SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml">
- <orderBatchElement>
- <submitOrderBatch CustomerBatchID="71">
<Customer OrderSource="NVL TEST CUSTOMER (CUSTOMER)" CustomerID="1097" />
- <Orders>
- <Order GiftOrder="N" GiftWrapOrder="N" OrderType="STND"
CustomerOrderID="25001" AddressOverrideFlag="Y">
- <OrderHeader>
<OrderDate>08/01/05</OrderDate>
- <Consumer Type="SoldTo" ConsumerID="58653">
- <Name>
<FirstName>Testfirstname</FirstName>
<MiddleName />
<LastName>Testlastname</LastName>
</Name>
<CompanyName />
- <Address>
<AddressLine1>1 Testaddress Street</AddressLine1>
<AddressLine2 />
<City>Testcity</City>
<State>DE</State>
<Zip>12345</Zip>
<Country>United States</Country>
</Address>
<Phone>1234567890</Phone>
<Email>jo**@bartucz.com</Email>
<AgeConfirm>Y</AgeConfirm>
<Birthdate />
</Consumer>
- <Consumer Type="ShipTo" ConsumerID="58653">
- <Name>
<FirstName>Testfirstname</FirstName>
<MiddleName />
<LastName>Testlastname</LastName>
</Name>
<CompanyName />
- <Address>
<AddressLine1>1 Testaddress Street</AddressLine1>
<AddressLine2 />
<City>Testcity</City>
<State>DE</State>
<Zip>12345</Zip>
<Country>United States</Country>
</Address>
<Phone>1234567890</Phone>
<Email>jo**@bartucz.com</Email>
<AgeConfirm>Y</AgeConfirm>
<Birthdate />
</Consumer>
<ConsumerHandlingFee />
- <OrderShipping>
<ConsumerShippingCharge>0</ConsumerShippingCharge>
<ShippingPriority>STANDARD</ShippingPriority>
<ShippingInstructions />
</OrderShipping>
<OrderSalesTax>0.00</OrderSalesTax>
<BottleDeposit />
<OrderTotal>14.95</OrderTotal>
<Rebate />
- <OrderHeaderMisc>
<GiftMessage>N</GiftMessage>
</OrderHeaderMisc>
<ConsumerInsurance ConsumerInsuranceFlag="N" />
</OrderHeader>
- <OrderLines>
- <OrderLine>
<LineNumber>4</LineNumber>
<Quantity>1</Quantity>
- <Product>
<CustomerSKU>22</CustomerSKU>
<RetailPrice>14.95</RetailPrice>
<NVLSKU />
<Description />
<LabelName>Gruner Veltliner</LabelName>
<Vintage />
<BottleSize />
</Product>
<LineSubtotal>14.95</LineSubtotal>
</OrderLine>
- <OrderLine>
<LineNumber>4</LineNumber>
<Quantity>1</Quantity>
- <Product>
<CustomerSKU>22</CustomerSKU>
<RetailPrice>14.95</RetailPrice>
<NVLSKU />
<Description />
<LabelName>Gruner Veltliner</LabelName>
<Vintage />
<BottleSize />
</Product>
<LineSubtotal>14.95</LineSubtotal>
</OrderLine>
</OrderLines>
</Order>
</Orders>
</submitOrderBatch>
</orderBatchElement>
</ns1:submitOrderBatch>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
===============================

So I'll just try creating a service according the other two request/respons
pair.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security

--------------------
From: "MR" <co******@newsgroup.nospam>
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
<ep**************@TK2MSFTNGP09.phx.gbl>
<HV*************@TK2MSFTNGXA01.phx.gbl>
<uL**************@tk2msftngp13.phx.gbl>
<Cd*************@TK2MSFTNGXA01.phx.gbl>
<uJ**************@TK2MSFTNGP11.phx.gbl>
<T1*************@TK2MSFTNGXA01.phx.gbl>
Subject: Re: The data at the root level is invalid exception
Date: Mon, 3 Oct 2005 13:14:54 +0300
Lines: 1040
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <uO*************@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
microsoft.public.dotnet.framework.webservices:8088
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

This is a request message that is a created, but before it is reformatted

<?xml version="1.0" encoding="utf-8" ?>
- <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <soap:Body>
- <submitOrderBatch xmlns="urn:OrderOperations">
- <orderBatchElement>
- <submitOrderBatch CustomerBatchID="71">
<Customer OrderSource="NVL TEST CUSTOMER (CUSTOMER)" CustomerID="1097" />
- <Orders>
- <Order GiftOrder="N" GiftWrapOrder="N" OrderType="STND"
CustomerOrderID="25001" AddressOverrideFlag="Y">
- <OrderHeader>
<OrderDate>08/01/05</OrderDate>
- <Consumer>
- <Consumer Type="SoldTo" ConsumerID="58653">
- <Name>
<FirstName>Testfirstname</FirstName>
<MiddleName />
<LastName>Testlastname</LastName>
</Name>
<CompanyName />
- <Address>
<AddressLine1>1 Testaddress Street</AddressLine1>
<AddressLine2 />
<City>Testcity</City>
<State>DE</State>
<Zip>12345</Zip>
<Country>United States</Country>
</Address>
<Phone>1234567890</Phone>
<Email>jo**@bartucz.com</Email>
<AgeConfirm>Y</AgeConfirm>
<Birthdate />
</Consumer>
- <Consumer Type="ShipTo" ConsumerID="58653">
- <Name>
<FirstName>Testfirstname</FirstName>
<MiddleName />
<LastName>Testlastname</LastName>
</Name>
<CompanyName />
- <Address>
<AddressLine1>1 Testaddress Street</AddressLine1>
<AddressLine2 />
<City>Testcity</City>
<State>DE</State>
<Zip>12345</Zip>
<Country>United States</Country>
</Address>
<Phone>1234567890</Phone>
<Email>jo**@bartucz.com</Email>
<AgeConfirm>Y</AgeConfirm>
<Birthdate />
</Consumer>
</Consumer>
<ConsumerHandlingFee />
- <OrderShipping>
<ConsumerShippingCharge>0</ConsumerShippingCharge>
<ShippingPriority>STANDARD</ShippingPriority>
<ShippingInstructions />
</OrderShipping>
<OrderSalesTax>0.00</OrderSalesTax>
<BottleDeposit />
<OrderTotal>14.95</OrderTotal>
<Rebate />
- <OrderHeaderMisc>
<GiftMessage>N</GiftMessage>
</OrderHeaderMisc>
<ConsumerInsurance ConsumerInsuranceFlag="N" />
</OrderHeader>
- <OrderLines>
- <OrderLine>
<LineNumber>4</LineNumber>
<Quantity>1</Quantity>
- <Product>
<CustomerSKU>22</CustomerSKU>
<RetailPrice>14.95</RetailPrice>
<NVLSKU />
<Description />
<LabelName>Gruner Veltliner</LabelName>
<Vintage />
<BottleSize />
</Product>
<LineSubtotal>14.95</LineSubtotal>
</OrderLine>
- <OrderLine>
<LineNumber>4</LineNumber>
<Quantity>1</Quantity>
- <Product>
<CustomerSKU>22</CustomerSKU>
<RetailPrice>14.95</RetailPrice>
<NVLSKU />
<Description />
<LabelName>Gruner Veltliner</LabelName>
<Vintage />
<BottleSize />
</Product>
<LineSubtotal>14.95</LineSubtotal>
</OrderLine>
</OrderLines>
</Order>
</Orders>
</submitOrderBatch>
</orderBatchElement>
</submitOrderBatch>
</soap:Body>
</soap:Envelope>
This is a request message after it is formatted:
<?xml version="1.0" encoding="utf-8" ?>
- <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
- <SOAP-ENV:Body>
- <ns1:submitOrderBatch xmlns:ns1="urn:OrderOperations"
SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml">
- <orderBatchElement>
- <submitOrderBatch CustomerBatchID="71">
<Customer OrderSource="NVL TEST CUSTOMER (CUSTOMER)" CustomerID="1097" />
- <Orders>
- <Order GiftOrder="N" GiftWrapOrder="N" OrderType="STND"
CustomerOrderID="25001" AddressOverrideFlag="Y">
- <OrderHeader>
<OrderDate>08/01/05</OrderDate>
- <Consumer Type="SoldTo" ConsumerID="58653">
- <Name>
<FirstName>Testfirstname</FirstName>
<MiddleName />
<LastName>Testlastname</LastName>
</Name>
<CompanyName />
- <Address>
<AddressLine1>1 Testaddress Street</AddressLine1>
<AddressLine2 />
<City>Testcity</City>
<State>DE</State>
<Zip>12345</Zip>
<Country>United States</Country>
</Address>
<Phone>1234567890</Phone>
<Email>jo**@bartucz.com</Email>
<AgeConfirm>Y</AgeConfirm>
<Birthdate />
</Consumer>
- <Consumer Type="ShipTo" ConsumerID="58653">
- <Name>
<FirstName>Testfirstname</FirstName>
<MiddleName />
<LastName>Testlastname</LastName>
</Name>
<CompanyName />
- <Address>
<AddressLine1>1 Testaddress Street</AddressLine1>
<AddressLine2 />
<City>Testcity</City>
<State>DE</State>
<Zip>12345</Zip>
<Country>United States</Country>
</Address>
<Phone>1234567890</Phone>
<Email>jo**@bartucz.com</Email>
<AgeConfirm>Y</AgeConfirm>
<Birthdate />
</Consumer>
<ConsumerHandlingFee />
- <OrderShipping>
<ConsumerShippingCharge>0</ConsumerShippingCharge>
<ShippingPriority>STANDARD</ShippingPriority>
<ShippingInstructions />
</OrderShipping>
<OrderSalesTax>0.00</OrderSalesTax>
<BottleDeposit />
<OrderTotal>14.95</OrderTotal>
<Rebate />
- <OrderHeaderMisc>
<GiftMessage>N</GiftMessage>
</OrderHeaderMisc>
<ConsumerInsurance ConsumerInsuranceFlag="N" />
</OrderHeader>
- <OrderLines>
- <OrderLine>
<LineNumber>4</LineNumber>
<Quantity>1</Quantity>
- <Product>
<CustomerSKU>22</CustomerSKU>
<RetailPrice>14.95</RetailPrice>
<NVLSKU />
<Description />
<LabelName>Gruner Veltliner</LabelName>
<Vintage />
<BottleSize />
</Product>
<LineSubtotal>14.95</LineSubtotal>
</OrderLine>
- <OrderLine>
<LineNumber>4</LineNumber>
<Quantity>1</Quantity>
- <Product>
<CustomerSKU>22</CustomerSKU>
<RetailPrice>14.95</RetailPrice>
<NVLSKU />
<Description />
<LabelName>Gruner Veltliner</LabelName>
<Vintage />
<BottleSize />
</Product>
<LineSubtotal>14.95</LineSubtotal>
</OrderLine>
</OrderLines>
</Order>
</Orders>
</submitOrderBatch>
</orderBatchElement>
</ns1:submitOrderBatch>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

This is the response that I get but cannot de-serialize

<?xml version="1.0" encoding="UTF-8" ?>
- <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
- <SOAP-ENV:Body>
- <ns1:submitOrderBatchResponse xmlns:ns1="urn:OrderOperations"
SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml">
- <return>
- <submitOrderBatchResponse>
- <errorDetail errorTypeID="1">
- <errorItem customerBatchID="71">
<errorMessage>[OrderOperations].submitOrderBatch() couldn't submitBatch
due to catchall Exception:
com.newvinelogistics.chuck.batch.client.BatchExcep tion:
[BatchManagerBean].submitOrderBatchAsync() customerBatchId 71 is not
unique,
cannot submit OrderBatch</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</ns1:submitOrderBatchResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I can take care of the version differences, but cannot create the class
that
gets the de-serialized message

i am attaching the proxy code too
thank you very much,
m

"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:T1*************@TK2MSFTNGXA01.phx.gbl...
Thanks for your response MR,

So would you please provide me a complete sample SOAP request and
response messages list your service client will currently need to produce
and receive (the SOAP 1.1 one after you converted). I can try building a
webservice and client proxy on my side to see whether I can correctly
consume it.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
From: "MR" <co******@newsgroup.nospam>
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
<ep**************@TK2MSFTNGP09.phx.gbl>
<HV*************@TK2MSFTNGXA01.phx.gbl>
<uL**************@tk2msftngp13.phx.gbl>
<Cd*************@TK2MSFTNGXA01.phx.gbl>
Subject: Re: The data at the root level is invalid exception
Date: Sun, 2 Oct 2005 18:39:10 +0300
Lines: 382
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
Message-ID: <uJ**************@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8083
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

i created a parallel ASP.NET site using the DTD files they gave me,
created
the proxy based on that and then manually modified the attributes of the
proxy. i also modified the outgoing message using WSE. now i am trying to
de-serialize the message that i am receiving, but i am not able to. i
thought this would be easier because i can see exactly what is being
received from the server.
i am not sure what the structure of the class that it should be
de-serialized to should be or what the attributes should be.
m
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:Cd*************@TK2MSFTNGXA01.phx.gbl...
Thanks for your reply MR,

So how did you build the proxy class you currently using? Or just a class
which use XmlSerializer to deserizlie the soap message?

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
<ep**************@TK2MSFTNGP09.phx.gbl>
<HV*************@TK2MSFTNGXA01.phx.gbl>
Subject: Re: The data at the root level is invalid exception
Date: Thu, 29 Sep 2005 13:11:34 +0300
Lines: 330
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <uL**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8058
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

the problem is that there is no WSDL document.

"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:HV*************@TK2MSFTNGXA01.phx.gbl...
Thanks for your followup MR,

So the
<?xml version="1.0" encoding="UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBatchResponse xmlns="urn:OrderOperations">
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="2">
<errorItem customerBatchID="70">
<errorMessage>[OrderOperations].submitOrderBatch() Found
badly
formed or missing Xml in following elements Order/OrderHeader
Order/OrderLines</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</submitOrderBatchResponse>
</soap:Body>
</soap:Envelope>
message is the one after you manually converting from 1.0 message to
1.1,
yes? Then, how is your current used client proxy generated? Through
which
WSDL file?

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
Subject: Re: The data at the root level is invalid exception
Date: Wed, 28 Sep 2005 17:24:07 +0300
Lines: 252
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <ep**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8048
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Hi Steven,
Yes this is a continuation of the previous problem except that I solved
the
previous problem by intercepting the SOAP message on the way out and
converting from SOAP 1.1 to SOAP 1.0
I am intercepting the SOAP message on the way in as well and converting
it
back from version 1.0 to 1.1. the SOAP message i posted is after I have
converted it.
Since i do not own the Web Service, I do not have the ability to change
the
Web Service, so i have to handle everything in the client. Apparently
the
DTD files that I received are not accurate so that client/proxy code
does
not match the incoming message.
I need to know what changes do i need to make to my client/proxy code to
be
able to handle the incoming message OR what changes do i have to make to
the
incoming message so that i can handle it with my existing classes
thanks
mr
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:Xi****************@TK2MSFTNGXA01.phx.gbl...
HI MR,

See you again. Seems you're still suffering some problem on the
webservice
issue. I think the elements and service code in this thread is the
current
implement of your service mentioned in your former post ,yes?

From the pasted SOAP Message and class definition, I think all of them
are
OK and didn't have any syntax or declaration problems. I'm wondering
what
does the
"whenever I try to deserialize an incoming SOAP message"

means, do you mean the .NET webservice client's auto deserialize or
you're
manually intercept the SOAP stream and do custom deserializing? If
it's
the latter, would you provide some further code on your custom
deserializing steps so that I can have a further test?

In addition, from your service code, you used the following attributes
to
control the SOAP request/response message of the webservice
==================
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=
System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
==================

I think you can also consider using the following style attributes:

Using SoapParameterStyle.Bare can help us ingore the .net function
signature and return type. We can just define our custom type for
representing the request / response SOAP element. For example, the
following webservice:

=====================
[WebMethod()]
[SoapDocumentMethod(
ParameterStyle=SoapParameterStyle.Bare
)]

public VariantOperationResponse
VariantOperation(VariantOperationRequest
request)
{
VariantOperationResponse response = new VariantOperationResponse();

switch(request.ItemType)
{
case "int":
response.Item = 12345;
break;
case "string":
response.Item = "My String";
break;
case "bool":
response.Item = true;
break;
}

return response;

}
=========================

custom classes
======================
[XmlRoot("variantOperationRequest")]
public class VariantOperationRequest
{
public VariantOperationRequest()
{
}

[XmlElement("itemType")]
public string ItemType;
}
[XmlRoot("variantOperationResponse")]
public class VariantOperationResponse
{
public VariantOperationResponse()
{
}

[XmlElement("intValue",typeof(int))]
[XmlElement("stringValue",typeof(string))]
[XmlElement("boolValue",typeof(bool))]
public object Item;

}
========================

can help generate the following SOAP message:
====request====
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<variantOperationRequest xmlns="http://tempuri.org/">
<itemType>string</itemType></variantOperationRequest>
</soap:Body>
</soap:Envelope>

====response=====
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>
<variantOperationResponse xmlns="http://tempuri.org/">
<stringValue>My String</stringValue></variantOperationResponse>
</soap:Body>
</soap:Envelope>
which is much more clear since it doesn't contain any other element
that
specific to the implement platform. This is a preferred approach for
developing SOA services.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
Subject: The data at the root level is invalid exception
Date: Tue, 27 Sep 2005 19:04:17 +0300
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <uy**************@TK2MSFTNGP11.phx.gbl>
Newsgroups:
microsoft.public.dotnet.framework.webservices,micr osoft.public.xml.soap
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.xml.soap:1165
microsoft.public.dotnet.framework.webservices:8036
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I get the following Exception "The data at the root level is invalid.
Line
1, position 642" whenever I try to deserialize an incoming SOAP
message.
The
incoming message is formed well and its length is 642 bytes ( I have
appended it to the end of this message).
I suspect that the reason may have something to do with an incorrect
declaration of which class to de-serialize to.
In the attached code I substituted @@@@@@@ in the code below with
"submitOrderBatchResponse" and "response" but still get the same
exception.
Am I overlooking something?
I appreciate your suggestions
thanks
m
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=
System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
public @@@@@@@ submitOrderBatch(Element orderBatchElement)
{
object[] results = this.Invoke("submitOrderBatch", new object[]
{orderBatchElement});
return ((@@@@@@@)(results[0]));
}
[System.Xml.Serialization.SoapTypeAttribute("respon se",
"http://xml.apache.org/xml-soap")]
public class response
{
public submitOrderBatchResponse SubmitOrderBatchResponse;
}
[System.Xml.Serialization.SoapTypeAttribute("submit OrderBatchResponse",
"urn:OrderOperations")]
public class submitOrderBatchResponse
{
[System.Xml.Serialization.XmlElementAttribute("erro rDetail",
typeof(errorDetail))]
[System.Xml.Serialization.XmlElementAttribute("resp onseMessage",
typeof(string))]
[System.Xml.Serialization.XmlElementAttribute("resp onseDetail",
typeof(responseDetail))]
public object Item;
}

<?xml version="1.0" encoding="UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBatchResponse xmlns="urn:OrderOperations">
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="2">
<errorItem customerBatchID="70">
<errorMessage>[OrderOperations].submitOrderBatch() Found
badly
formed or missing Xml in following elements Order/OrderHeader
Order/OrderLines</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</submitOrderBatchResponse>
</soap:Body>
</soap:Envelope>





Nov 23 '05 #9
Hi MR,

Sorry for being absense for long time. I've just managed to perform some
further testing on this, seems the following response message (before
deserlialize....)
============================
<ns1:submitOrderBatchResponse xmlns:ns1="urn:OrderOperations" >
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="1">
<errorItem customerBatchID="71">
<errorMessage>[OrderOperations].submitOrderBatch() couldn't submitBatch due
to catchall Exception:
com.newvinelogistics.chuck.batch.client.BatchExcep tion:
[BatchManagerBean].submitOrderBatchAsync() customerBatchId 71 is not
unique,
cannot submit OrderBatch
</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</ns1:submitOrderBatchResponse>
===========================

would be hard for xmlserlizer to deserizlie it into normal custom classes.
If possible, I think we could consider also use soapExtension to format it
first, if we can change it to the below style, it'll be simpler to
deserialize it:

================
<ns1:submitOrderBatchResponse xmlns:ns1="urn:OrderOperations" >
<errorDetail errorTypeID="1">
<errorItem customerBatchID="71">
<errorMessage>[OrderOperations].submitOrderBatch() couldn't submitBatch due
to catchall Exception:
com.newvinelogistics.chuck.batch.client.BatchExcep tion:
[BatchManagerBean].submitOrderBatchAsync() customerBatchId 71 is not
unique,
cannot submit OrderBatch
</errorMessage>
</errorItem>
</errorDetail>
</ns1:submitOrderBatchResponse>

=================

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
X-Tomcat-ID: 271849086
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
<ep**************@TK2MSFTNGP09.phx.gbl>
<HV*************@TK2MSFTNGXA01.phx.gbl>
<uL**************@tk2msftngp13.phx.gbl>
<Cd*************@TK2MSFTNGXA01.phx.gbl>
<uJ**************@TK2MSFTNGP11.phx.gbl>
<T1*************@TK2MSFTNGXA01.phx.gbl>
<uO*************@TK2MSFTNGP11.phx.gbl>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_0001_2BAA98F3"
Content-Transfer-Encoding: 7bit
From: st*****@online.microsoft.com (Steven Cheng[MSFT])
Organization: Microsoft
Date: Fri, 07 Oct 2005 12:59:29 GMT
Subject: Re: The data at the root level is invalid exception
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices
Message-ID: <Tp*************@TK2MSFTNGXA01.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
Lines: 1497
Path: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8149
NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182

Hi MR,

From the three SOAP message you provided (two request , one respones), the
following one :
use the
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">

namespace seems a bit strange since not all the elements under <body>
element be marked with "ns1" namespace prefix
=================================
<?xml version="1.0" encoding="utf-8" ?>
- <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
- <SOAP-ENV:Body>
- <ns1:submitOrderBatch xmlns:ns1="urn:OrderOperations"
SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml">
- <orderBatchElement>
- <submitOrderBatch CustomerBatchID="71">
<Customer OrderSource="NVL TEST CUSTOMER (CUSTOMER)" CustomerID="1097" />
- <Orders>
- <Order GiftOrder="N" GiftWrapOrder="N" OrderType="STND"
CustomerOrderID="25001" AddressOverrideFlag="Y">
- <OrderHeader>
<OrderDate>08/01/05</OrderDate>
- <Consumer Type="SoldTo" ConsumerID="58653">
- <Name>
<FirstName>Testfirstname</FirstName>
<MiddleName />
<LastName>Testlastname</LastName>
</Name>
<CompanyName />
- <Address>
<AddressLine1>1 Testaddress Street</AddressLine1>
<AddressLine2 />
<City>Testcity</City>
<State>DE</State>
<Zip>12345</Zip>
<Country>United States</Country>
</Address>
<Phone>1234567890</Phone>
<Email>jo**@bartucz.com</Email>
<AgeConfirm>Y</AgeConfirm>
<Birthdate />
</Consumer>
- <Consumer Type="ShipTo" ConsumerID="58653">
- <Name>
<FirstName>Testfirstname</FirstName>
<MiddleName />
<LastName>Testlastname</LastName>
</Name>
<CompanyName />
- <Address>
<AddressLine1>1 Testaddress Street</AddressLine1>
<AddressLine2 />
<City>Testcity</City>
<State>DE</State>
<Zip>12345</Zip>
<Country>United States</Country>
</Address>
<Phone>1234567890</Phone>
<Email>jo**@bartucz.com</Email>
<AgeConfirm>Y</AgeConfirm>
<Birthdate />
</Consumer>
<ConsumerHandlingFee />
- <OrderShipping>
<ConsumerShippingCharge>0</ConsumerShippingCharge>
<ShippingPriority>STANDARD</ShippingPriority>
<ShippingInstructions />
</OrderShipping>
<OrderSalesTax>0.00</OrderSalesTax>
<BottleDeposit />
<OrderTotal>14.95</OrderTotal>
<Rebate />
- <OrderHeaderMisc>
<GiftMessage>N</GiftMessage>
</OrderHeaderMisc>
<ConsumerInsurance ConsumerInsuranceFlag="N" />
</OrderHeader>
- <OrderLines>
- <OrderLine>
<LineNumber>4</LineNumber>
<Quantity>1</Quantity>
- <Product>
<CustomerSKU>22</CustomerSKU>
<RetailPrice>14.95</RetailPrice>
<NVLSKU />
<Description />
<LabelName>Gruner Veltliner</LabelName>
<Vintage />
<BottleSize />
</Product>
<LineSubtotal>14.95</LineSubtotal>
</OrderLine>
- <OrderLine>
<LineNumber>4</LineNumber>
<Quantity>1</Quantity>
- <Product>
<CustomerSKU>22</CustomerSKU>
<RetailPrice>14.95</RetailPrice>
<NVLSKU />
<Description />
<LabelName>Gruner Veltliner</LabelName>
<Vintage />
<BottleSize />
</Product>
<LineSubtotal>14.95</LineSubtotal>
</OrderLine>
</OrderLines>
</Order>
</Orders>
</submitOrderBatch>
</orderBatchElement>
</ns1:submitOrderBatch>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
===============================

So I'll just try creating a service according the other two request/respons
pair.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security

--------------------
From: "MR" <co******@newsgroup.nospam>
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
<ep**************@TK2MSFTNGP09.phx.gbl>
<HV*************@TK2MSFTNGXA01.phx.gbl>
<uL**************@tk2msftngp13.phx.gbl>
<Cd*************@TK2MSFTNGXA01.phx.gbl>
<uJ**************@TK2MSFTNGP11.phx.gbl>
<T1*************@TK2MSFTNGXA01.phx.gbl>
Subject: Re: The data at the root level is invalid exception
Date: Mon, 3 Oct 2005 13:14:54 +0300
Lines: 1040
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <uO*************@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
microsoft.public.dotnet.framework.webservices:8088
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

This is a request message that is a created, but before it is reformatted

<?xml version="1.0" encoding="utf-8" ?>
- <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <soap:Body>
- <submitOrderBatch xmlns="urn:OrderOperations">
- <orderBatchElement>
- <submitOrderBatch CustomerBatchID="71">
<Customer OrderSource="NVL TEST CUSTOMER (CUSTOMER)" CustomerID="1097" />
- <Orders>
- <Order GiftOrder="N" GiftWrapOrder="N" OrderType="STND"
CustomerOrderID="25001" AddressOverrideFlag="Y">
- <OrderHeader>
<OrderDate>08/01/05</OrderDate>
- <Consumer>
- <Consumer Type="SoldTo" ConsumerID="58653">
- <Name>
<FirstName>Testfirstname</FirstName>
<MiddleName />
<LastName>Testlastname</LastName>
</Name>
<CompanyName />
- <Address>
<AddressLine1>1 Testaddress Street</AddressLine1>
<AddressLine2 />
<City>Testcity</City>
<State>DE</State>
<Zip>12345</Zip>
<Country>United States</Country>
</Address>
<Phone>1234567890</Phone>
<Email>jo**@bartucz.com</Email>
<AgeConfirm>Y</AgeConfirm>
<Birthdate />
</Consumer>
- <Consumer Type="ShipTo" ConsumerID="58653">
- <Name>
<FirstName>Testfirstname</FirstName>
<MiddleName />
<LastName>Testlastname</LastName>
</Name>
<CompanyName />
- <Address>
<AddressLine1>1 Testaddress Street</AddressLine1>
<AddressLine2 />
<City>Testcity</City>
<State>DE</State>
<Zip>12345</Zip>
<Country>United States</Country>
</Address>
<Phone>1234567890</Phone>
<Email>jo**@bartucz.com</Email>
<AgeConfirm>Y</AgeConfirm>
<Birthdate />
</Consumer>
</Consumer>
<ConsumerHandlingFee />
- <OrderShipping>
<ConsumerShippingCharge>0</ConsumerShippingCharge>
<ShippingPriority>STANDARD</ShippingPriority>
<ShippingInstructions />
</OrderShipping>
<OrderSalesTax>0.00</OrderSalesTax>
<BottleDeposit />
<OrderTotal>14.95</OrderTotal>
<Rebate />
- <OrderHeaderMisc>
<GiftMessage>N</GiftMessage>
</OrderHeaderMisc>
<ConsumerInsurance ConsumerInsuranceFlag="N" />
</OrderHeader>
- <OrderLines>
- <OrderLine>
<LineNumber>4</LineNumber>
<Quantity>1</Quantity>
- <Product>
<CustomerSKU>22</CustomerSKU>
<RetailPrice>14.95</RetailPrice>
<NVLSKU />
<Description />
<LabelName>Gruner Veltliner</LabelName>
<Vintage />
<BottleSize />
</Product>
<LineSubtotal>14.95</LineSubtotal>
</OrderLine>
- <OrderLine>
<LineNumber>4</LineNumber>
<Quantity>1</Quantity>
- <Product>
<CustomerSKU>22</CustomerSKU>
<RetailPrice>14.95</RetailPrice>
<NVLSKU />
<Description />
<LabelName>Gruner Veltliner</LabelName>
<Vintage />
<BottleSize />
</Product>
<LineSubtotal>14.95</LineSubtotal>
</OrderLine>
</OrderLines>
</Order>
</Orders>
</submitOrderBatch>
</orderBatchElement>
</submitOrderBatch>
</soap:Body>
</soap:Envelope>
This is a request message after it is formatted:
<?xml version="1.0" encoding="utf-8" ?>
- <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
- <SOAP-ENV:Body>
- <ns1:submitOrderBatch xmlns:ns1="urn:OrderOperations"
SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml">
- <orderBatchElement>
- <submitOrderBatch CustomerBatchID="71">
<Customer OrderSource="NVL TEST CUSTOMER (CUSTOMER)" CustomerID="1097" />
- <Orders>
- <Order GiftOrder="N" GiftWrapOrder="N" OrderType="STND"
CustomerOrderID="25001" AddressOverrideFlag="Y">
- <OrderHeader>
<OrderDate>08/01/05</OrderDate>
- <Consumer Type="SoldTo" ConsumerID="58653">
- <Name>
<FirstName>Testfirstname</FirstName>
<MiddleName />
<LastName>Testlastname</LastName>
</Name>
<CompanyName />
- <Address>
<AddressLine1>1 Testaddress Street</AddressLine1>
<AddressLine2 />
<City>Testcity</City>
<State>DE</State>
<Zip>12345</Zip>
<Country>United States</Country>
</Address>
<Phone>1234567890</Phone>
<Email>jo**@bartucz.com</Email>
<AgeConfirm>Y</AgeConfirm>
<Birthdate />
</Consumer>
- <Consumer Type="ShipTo" ConsumerID="58653">
- <Name>
<FirstName>Testfirstname</FirstName>
<MiddleName />
<LastName>Testlastname</LastName>
</Name>
<CompanyName />
- <Address>
<AddressLine1>1 Testaddress Street</AddressLine1>
<AddressLine2 />
<City>Testcity</City>
<State>DE</State>
<Zip>12345</Zip>
<Country>United States</Country>
</Address>
<Phone>1234567890</Phone>
<Email>jo**@bartucz.com</Email>
<AgeConfirm>Y</AgeConfirm>
<Birthdate />
</Consumer>
<ConsumerHandlingFee />
- <OrderShipping>
<ConsumerShippingCharge>0</ConsumerShippingCharge>
<ShippingPriority>STANDARD</ShippingPriority>
<ShippingInstructions />
</OrderShipping>
<OrderSalesTax>0.00</OrderSalesTax>
<BottleDeposit />
<OrderTotal>14.95</OrderTotal>
<Rebate />
- <OrderHeaderMisc>
<GiftMessage>N</GiftMessage>
</OrderHeaderMisc>
<ConsumerInsurance ConsumerInsuranceFlag="N" />
</OrderHeader>
- <OrderLines>
- <OrderLine>
<LineNumber>4</LineNumber>
<Quantity>1</Quantity>
- <Product>
<CustomerSKU>22</CustomerSKU>
<RetailPrice>14.95</RetailPrice>
<NVLSKU />
<Description />
<LabelName>Gruner Veltliner</LabelName>
<Vintage />
<BottleSize />
</Product>
<LineSubtotal>14.95</LineSubtotal>
</OrderLine>
- <OrderLine>
<LineNumber>4</LineNumber>
<Quantity>1</Quantity>
- <Product>
<CustomerSKU>22</CustomerSKU>
<RetailPrice>14.95</RetailPrice>
<NVLSKU />
<Description />
<LabelName>Gruner Veltliner</LabelName>
<Vintage />
<BottleSize />
</Product>
<LineSubtotal>14.95</LineSubtotal>
</OrderLine>
</OrderLines>
</Order>
</Orders>
</submitOrderBatch>
</orderBatchElement>
</ns1:submitOrderBatch>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

This is the response that I get but cannot de-serialize

<?xml version="1.0" encoding="UTF-8" ?>
- <SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
- <SOAP-ENV:Body>
- <ns1:submitOrderBatchResponse xmlns:ns1="urn:OrderOperations"
SOAP-ENV:encodingStyle="http://xml.apache.org/xml-soap/literalxml">
- <return>
- <submitOrderBatchResponse>
- <errorDetail errorTypeID="1">
- <errorItem customerBatchID="71">
<errorMessage>[OrderOperations].submitOrderBatch() couldn't submitBatch
due to catchall Exception:
com.newvinelogistics.chuck.batch.client.BatchExcep tion:
[BatchManagerBean].submitOrderBatchAsync() customerBatchId 71 is not
unique,
cannot submit OrderBatch</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</ns1:submitOrderBatchResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I can take care of the version differences, but cannot create the class
that
gets the de-serialized message

i am attaching the proxy code too
thank you very much,
m

"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:T1*************@TK2MSFTNGXA01.phx.gbl...
Thanks for your response MR,

So would you please provide me a complete sample SOAP request and
response messages list your service client will currently need to produce
and receive (the SOAP 1.1 one after you converted). I can try building a
webservice and client proxy on my side to see whether I can correctly
consume it.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
From: "MR" <co******@newsgroup.nospam>
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
<ep**************@TK2MSFTNGP09.phx.gbl>
<HV*************@TK2MSFTNGXA01.phx.gbl>
<uL**************@tk2msftngp13.phx.gbl>
<Cd*************@TK2MSFTNGXA01.phx.gbl>
Subject: Re: The data at the root level is invalid exception
Date: Sun, 2 Oct 2005 18:39:10 +0300
Lines: 382
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
Message-ID: <uJ**************@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8083
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

i created a parallel ASP.NET site using the DTD files they gave me,
created
the proxy based on that and then manually modified the attributes of the
proxy. i also modified the outgoing message using WSE. now i am trying to
de-serialize the message that i am receiving, but i am not able to. i
thought this would be easier because i can see exactly what is being
received from the server.
i am not sure what the structure of the class that it should be
de-serialized to should be or what the attributes should be.
m
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:Cd*************@TK2MSFTNGXA01.phx.gbl...
Thanks for your reply MR,

So how did you build the proxy class you currently using? Or just a class
which use XmlSerializer to deserizlie the soap message?

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
<ep**************@TK2MSFTNGP09.phx.gbl>
<HV*************@TK2MSFTNGXA01.phx.gbl>
Subject: Re: The data at the root level is invalid exception
Date: Thu, 29 Sep 2005 13:11:34 +0300
Lines: 330
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <uL**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8058
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

the problem is that there is no WSDL document.

"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:HV*************@TK2MSFTNGXA01.phx.gbl...
Thanks for your followup MR,

So the
<?xml version="1.0" encoding="UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBatchResponse xmlns="urn:OrderOperations">
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="2">
<errorItem customerBatchID="70">
<errorMessage>[OrderOperations].submitOrderBatch() Found
badly
formed or missing Xml in following elements Order/OrderHeader
Order/OrderLines</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</submitOrderBatchResponse>
</soap:Body>
</soap:Envelope>
message is the one after you manually converting from 1.0 message to
1.1,
yes? Then, how is your current used client proxy generated? Through
which
WSDL file?

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
References: <uy**************@TK2MSFTNGP11.phx.gbl>
<Xi**************@TK2MSFTNGXA01.phx.gbl>
Subject: Re: The data at the root level is invalid exception
Date: Wed, 28 Sep 2005 17:24:07 +0300
Lines: 252
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <ep**************@TK2MSFTNGP09.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8048
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Hi Steven,
Yes this is a continuation of the previous problem except that I solved
the
previous problem by intercepting the SOAP message on the way out and
converting from SOAP 1.1 to SOAP 1.0
I am intercepting the SOAP message on the way in as well and converting
it
back from version 1.0 to 1.1. the SOAP message i posted is after I have
converted it.
Since i do not own the Web Service, I do not have the ability to change
the
Web Service, so i have to handle everything in the client. Apparently
the
DTD files that I received are not accurate so that client/proxy code
does
not match the incoming message.
I need to know what changes do i need to make to my client/proxy code to
be
able to handle the incoming message OR what changes do i have to make to
the
incoming message so that i can handle it with my existing classes
thanks
mr
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:Xi****************@TK2MSFTNGXA01.phx.gbl...
HI MR,

See you again. Seems you're still suffering some problem on the
webservice
issue. I think the elements and service code in this thread is the
current
implement of your service mentioned in your former post ,yes?

From the pasted SOAP Message and class definition, I think all of them
are
OK and didn't have any syntax or declaration problems. I'm wondering
what
does the
"whenever I try to deserialize an incoming SOAP message"

means, do you mean the .NET webservice client's auto deserialize or
you're
manually intercept the SOAP stream and do custom deserializing? If
it's
the latter, would you provide some further code on your custom
deserializing steps so that I can have a further test?

In addition, from your service code, you used the following attributes
to
control the SOAP request/response message of the webservice
==================
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=
System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
==================

I think you can also consider using the following style attributes:

Using SoapParameterStyle.Bare can help us ingore the .net function
signature and return type. We can just define our custom type for
representing the request / response SOAP element. For example, the
following webservice:

=====================
[WebMethod()]
[SoapDocumentMethod(
ParameterStyle=SoapParameterStyle.Bare
)]

public VariantOperationResponse
VariantOperation(VariantOperationRequest
request)
{
VariantOperationResponse response = new VariantOperationResponse();

switch(request.ItemType)
{
case "int":
response.Item = 12345;
break;
case "string":
response.Item = "My String";
break;
case "bool":
response.Item = true;
break;
}

return response;

}
=========================

custom classes
======================
[XmlRoot("variantOperationRequest")]
public class VariantOperationRequest
{
public VariantOperationRequest()
{
}

[XmlElement("itemType")]
public string ItemType;
}
[XmlRoot("variantOperationResponse")]
public class VariantOperationResponse
{
public VariantOperationResponse()
{
}

[XmlElement("intValue",typeof(int))]
[XmlElement("stringValue",typeof(string))]
[XmlElement("boolValue",typeof(bool))]
public object Item;

}
========================

can help generate the following SOAP message:
====request====
<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<variantOperationRequest xmlns="http://tempuri.org/">
<itemType>string</itemType></variantOperationRequest>
</soap:Body>
</soap:Envelope>

====response=====
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>
<variantOperationResponse xmlns="http://tempuri.org/">
<stringValue>My String</stringValue></variantOperationResponse>
</soap:Body>
</soap:Envelope>
which is much more clear since it doesn't contain any other element
that
specific to the implement platform. This is a preferred approach for
developing SOA services.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "MR" <co******@newsgroup.nospam>
Subject: The data at the root level is invalid exception
Date: Tue, 27 Sep 2005 19:04:17 +0300
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
Message-ID: <uy**************@TK2MSFTNGP11.phx.gbl>
Newsgroups:
microsoft.public.dotnet.framework.webservices,micr osoft.public.xml.soap
NNTP-Posting-Host: hevron.biconix.com 62.90.12.234
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.xml.soap:1165
microsoft.public.dotnet.framework.webservices:8036
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I get the following Exception "The data at the root level is invalid.
Line
1, position 642" whenever I try to deserialize an incoming SOAP
message.
The
incoming message is formed well and its length is 642 bytes ( I have
appended it to the end of this message).
I suspect that the reason may have something to do with an incorrect
declaration of which class to de-serialize to.
In the attached code I substituted @@@@@@@ in the code below with
"submitOrderBatchResponse" and "response" but still get the same
exception.
Am I overlooking something?
I appreciate your suggestions
thanks
m
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(
RequestElementName = "submitOrderBatch",
RequestNamespace="urn:OrderOperations",
ResponseElementName="@@@@@@@",
ResponseNamespace="urn:OrderOperations",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=
System.Web.Services.Protocols.SoapParameterStyle.W rapped)]
[return: System.Xml.Serialization.SoapElementAttribute("@@@ @@@@")]
public @@@@@@@ submitOrderBatch(Element orderBatchElement)
{
object[] results = this.Invoke("submitOrderBatch", new object[]
{orderBatchElement});
return ((@@@@@@@)(results[0]));
}
[System.Xml.Serialization.SoapTypeAttribute("respon se",
"http://xml.apache.org/xml-soap")]
public class response
{
public submitOrderBatchResponse SubmitOrderBatchResponse;
}
[System.Xml.Serialization.SoapTypeAttribute("submit OrderBatchResponse",
"urn:OrderOperations")]
public class submitOrderBatchResponse
{
[System.Xml.Serialization.XmlElementAttribute("erro rDetail",
typeof(errorDetail))]
[System.Xml.Serialization.XmlElementAttribute("resp onseMessage",
typeof(string))]
[System.Xml.Serialization.XmlElementAttribute("resp onseDetail",
typeof(responseDetail))]
public object Item;
}

<?xml version="1.0" encoding="UTF-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<submitOrderBatchResponse xmlns="urn:OrderOperations">
<return>
<submitOrderBatchResponse>
<errorDetail errorTypeID="2">
<errorItem customerBatchID="70">
<errorMessage>[OrderOperations].submitOrderBatch() Found
badly
formed or missing Xml in following elements Order/OrderHeader
Order/OrderLines</errorMessage>
</errorItem>
</errorDetail>
</submitOrderBatchResponse>
</return>
</submitOrderBatchResponse>
</soap:Body>
</soap:Envelope>





Dec 9 '05 #10

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

Similar topics

3
by: Korivo | last post by:
Im getting this error while trying to read a xml file that i receive from a POST heres the code: Dim MyXmlReader As XmlTextReader Dim strNodeResult As String Dim NodeType As XmlNodeType Dim...
1
by: jm | last post by:
I get "data at the root level is invalid." I have changed security for the IUSR_xx to be in the adminstrators (tried anonymous access); changed all the file security I could; tried virtual...
2
by: yxq | last post by:
Hello I want to create and delete the folder share, i found that it is ok for generic folder, but it does not work for Root directory(i.e c:\, d:\) The code...
1
by: jm | last post by:
I get "data at the root level is invalid." I have changed security for the IUSR_xx to be in the adminstrators (tried anonymous access); changed all the file security I could; tried virtual...
2
by: js | last post by:
I got this error when I moved my application to a new Windows 2003 server. I installed and recompiled the 'Microsoft.Practices.EnterpriseLibrary - June 2005" then added these assemblies to the...
2
by: =?Utf-8?B?am1ncm8=?= | last post by:
I created a web service in visual studio 2003, tested it with a sample.xml file from a vendor we are using, and it worked exactly like it should. I depoloyed it to our server, created a project...
4
by: johnsonkt | last post by:
hi all , when m trying to validate my xml using xsd file it gives me the following error "Data at the root level is invalid. Line 1, position 1" i tried to open the XML file using IE and there...
1
by: ayemyat | last post by:
Hi All, I have a remoting service which consumes the web service in another server. I have the following exception throw by the web service. System.Xml.XmlException: The data at the root level...
2
by: Cirene | last post by:
My ASP.NET project builds fine (VS2008). I added a new web deployment project. When I try to build it I get: Data at the root level is invalid. Line1, position 1. (The file is web.config,...
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
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.