Sending xmlDoc string to webservice as input parameter

Hi All,

Im trying to send an xml string to a webservice as an input paramter, however it receives the error:’
Server was unable to read request. --> There is an error in XML document (5, 4). --> The XML declaration is unexpected. Line 5, position 16.’

Here is the xml Doc im trying to send:

<?xml version="1.0" standalone="yes"?>
<ItemDescJde xmlns="http://Integration/itemDesc">
  <Table>
    <ID>1234VBMRBERRO</ID>
    <lineNo>1</lineNo>
    <itemNo>9990327</itemNo>
    <desc_a>                              </desc_a>
    <desc_b>                              </desc_b>
    <mrp_item>2</mrp_item>
    <uom>  </uom>
  </Table>
  </ItemDescJde>

I have tried setting the various pararmeters in the pub.xml:documentToXmlString step of the web service invocation to no avail…

Thanks for any help

Try removing this line. It is not necessary and may be causing the problem.

<?xml version="1.0" standalone="yes"?>

Mark

Thanks Mark, that worked…I had a feeling it was that and the quotes in it… If the webservice then returns an xmlstring should it have the xml declaration removed also?

Just tested it, and it doesnt matter if it includes the xml declaration or not…Thanks

Kewl. Glad that worked. The line “The XML declaration is unexpected” was the clue.

I am trying to call my partner’s webservice and I get this error. I am using certificates. I just renewed our certificate. Prior to expiration everything used to work smoothly. Can someone help on this. Thanks in advance.

<?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
soap:Fault
soap:Client
Server was unable to read request. --> There is an error in XML document (5, 4). --> The XML declaration is unexpected. Line 5, position 16.

</soap:Fault>
</soap:Body>
</soap:Envelope>

What makes you think this issue is related to the expiration of your security certificate?

Can you post the soap request message? It appears that it contains an extraneous XML declaration.

Mark

Only reason i thought certificate could be issue is after renewal its not working.
Below is the first few lines of my request :

<?xml version="1.0" encoding="utf-8"?> 30XYZ PP PP 2 0

Going through this thread i tried removing the xml declaration. But that also did not work.

That’s not enough of the request to understand the issue. Are you sending a soap message? If so, what does the envelope look like? Can you capture the request on the wire and review it for extra xml declarations?

Mark

Thanks Mark. I did that.
Here is soap msg capture on wire :

<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:SOAP-ENC=“http://schemas.xmlsoap.org/soap/encoding/” xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
SOAP-ENV:Body
<tns1:ImportTitle xmlns:tns1=“http://xyz.com/TitleImport/TitleImportService”>
tns1:arg1
<lib_title>
<title_no>XYZ</title_no>
<cust_id></cust_id>
PP 2
<title_desc>PP</title_desc>



<reel_num></reel_num>

<time_code_no>0</time_code_no>

Based on that message fragment, I don’t have the slightest idea.

Does that mean the information i provided is not sufficient for further analysis. OR the message looks good and we are unable to identify what is going on ?

Yes. Yes.

Little different error this time :

<?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
soap:Fault
soap:Client
Server was unable to read request. --> There is an error in XML document (6, 4). --> ‘Element’ is an invalid node type. Line 6, position 4.

</soap:Fault>
</soap:Body>
</soap:Envelope>

One difference I see my earlier between my successful webservice call and failure webservice call. Earlier I did not have SP2 installed in my env. and Now I have SP2 installed. My regular simple webservice is also not working after i upgrade. Can you help in identifying what more i have to take care ?

Thanks in advance

One difference I see between my successful webservice call and failure webservice call. Earlier I did not have SP2 installed in my env. and Now I have SP2 installed. My regular simple webservice is also not working after i upgraded. Can you help in identifying what more i have to take care ?

Need. The. Request.

Sorry Mark. I did not understand. Did you mean complete soap message ?

Please post the complete SOAP request messsage. Feel free to edit out any company-specific information. You should be able to post it as an attachment with a txt or xml file extension.

Mark

Please find the attachment enclosed.
PP305.xml (4.13 KB)

Is your partner’s ImprorTitle operation expecting a single item “arg1” that contains an XML string? Do you have a WSDL that describes this service?

What content-type is being sent in the HTTP properties of the working service invocation and the non-working one?

Mark