Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xml error help 1

Status
Not open for further replies.

ashstampede

Programmer
Aug 30, 2004
104
GB
I was hopping for some liberation on what this possible error message my be coming from a web server after i send a request.

ERROR MESSAGE
Invalid XML The name of the top most element must match the name of the DOCTYPE declaration

my xml request looks like this
Code:
<RateV2Request>
 <Package ID="0">
  <Service>Parcel</Service>
  <ZipOrigination>xxxxx</ZipOrigination>
  <ZipDestination>xxxxx</ZipDestination>
  <Pounds>0</Pounds>
  <Ounces>3</Ounces>
  <Container></Container>
  <Size>REGULAR</Size>
  <Machinable>False</Machinable>
 </Package>
</RateV2Request
 
Your last tag is missing a >. Is this a typo?

--Chessbot

There is a level of Hell reserved for probability theorists in which every monkey that types on a typewriter produces a Shakespearean sonnet.
 
The web server is using a DTD to validate your XML, and it's not passing validation because your element name doesn't match what it expects.

Can you talk to the owner of the web site and see if they can send you a copy of it?

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
yes chessbot that's a typo, i'm building the xml using .NET system.xml.xmldocument.CreateElement that automatically creats the closing element.

chip i have e-mail about that specific error, they havn't responsed. But after reading your post i have e-mail them requesting the dtd. This is the United States Postal Service web tools.

thanks both
 
The examples show that the root node requires userid/password attributes.
Code:
<RateV2Request USERID="xxxxxx" PASSWORD="xxxxxxx">
Have you tried that?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top