Link to home
Start Free TrialLog in
Avatar of nanoterabeta
nanoterabeta

asked on

"There is an error in XML document (1, 431)" what does it mean???

i write a perl code as a web service client using SOAP::Lite, it works fine in most cases.
When the server throw out the messege: "There is an error in XML document (1, 431)"
and the inner explanation is "Input string was not in a correct format"
what i want to know is what (1,431) means ??
according to the answer, can experts identify where i format it incorrectly ???

my exact XML document sent to the server is:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">
<wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Timestamp-24854782">
<wsu:Created>2008-04-04T09:43:45Z</wsu:Created>
<wsu:Expires>2008-04-04T09:43:45Z</wsu:Expires></wsu:Timestamp>
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-31056583">
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">pass</wsse:Password>
<wsse:Username>USER</wsse:Username>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<SetAccumulatorValue xmlns="http://mywebsite.com/soap">
<request>
<SubscriberId>912345678</SubscriberId><Identity/>
<Accumulator>ACC_Recharge</Accumulator>
<AccumulatorValue>a</AccumulatorValue>
</request>
</SetAccumulatorValue>
</soapenv:Body>
</soapenv:Envelope>
Avatar of Adam314
Adam314

The (1,431) means the error is on line 1, character 431.  I don't see any problems with the XML you posted though.
Avatar of nanoterabeta

ASKER

hey genius,
1. my XML is formated correctly, the problem is with input string only, i'm asking what string causes the problem.
2. you said line 1, character 431, so:
2.1 what is the first line and where the second line begins ?
2.2 each tag makes a line or the whole XML document makes a line ?
2.3. do you have any docs to reference that your answer right ?
The lines end with the new line character, \n.  Unless you've set $/ to something different.
I didn't see anything in the documentation that states that this error is for (line,character), but have found out through experience.
thanks, so you don't know what a "line" is in a XML document either.
hope that the answer will come from those who know.
Unless you've set $/, a line ends with the new line character, which is "\n", ascii character 10.
In an XML document, there could be a newline almost anywhere, and it still be a valid document.
2.1 what is the first line and where the second line begins ?
If the XML you posted is what you are referring to, then the first line is:
    <?xml version="1.0" encoding="UTF-8"?>
And the second line is:
    <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
ASKER CERTIFIED SOLUTION
Avatar of Siva Prasanna Kumar
Siva Prasanna Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
to shivaspk: thanks for your post, i'll study what you suggested
i can make sure it is not a null request error,
if there is one, there will be a response like "empty request error...'

to adam314: so what is the character 431 you've mentioned in the first line ???
The xml you posted doesn't have a 431 character on the first line.  Is the XML you posted exactly what is causing errors?
yeah, it exactly causes errors, genius
I don't see an error with the syntax of the XML.  There might be an error with the content though.
yeah, this is what i'm asking
nanoterabeta, I fell that the error is not coming for this message, can you check the exact message when you got that error.
this is the exact XML document which causes the error,
maybe the server parsed and identified the error before sent back the error message
don't pay attention to Adam314 genius because
<?xml version="1.0" encoding="UTF-8"?>
can not be the first line

i even met the error message that says
There is an error in XML document (1, 1158)
or even bigger
he only spams the forum the get statistics
Adam314 is a forum spammer