Forum Discussion

pascalSoap's avatar
pascalSoap
Occasional Contributor
12 years ago

soapui error "Content is not allowed in prolog" when sending

Hello,

I want to send a request with two attached files
- one I attach in the usual way (referring the file by cid:... and attaching it by using the butoon attachments)
- and the second by using an inline file (file:[absolute path to the file])

(My purpose is afterthat to input the [absolute path to the file] as a parameter so that I can send messages with different files each time without having to change manually it)

I always get the error "Content is not allowed in prolog" (the content of my files are ok included for the second one which is an XML one)

I've searched and read a lot about it and never found a solution

I know that we must choose the right values for various properties such as "enable inline files", "enable mtom" and so on so I tried evryhthing but always got the error

Could anyone help me ? :
- exact list of properties I must set and their right values ?
- joinning or not the inline file, if so, caching or not caching ?
- adding header ?
- ...

Here is my Request :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tran="http://[...]">
<soapenv:Header/>
<soapenv:Body>
<tran:StoreDocument>
<DocumentID>987654321</DocumentID>
<!--Optional:-->
<CreationDate></CreationDate>
<DocumentContent>cid:1243918435607</DocumentContent>
<!--Optional:-->
<DocumentContentFormat>.txt</DocumentContentFormat>
<ConfigFile>file:E:\[MyPath]\Edit1.xml</ConfigFile>
<!--Optional:-->
<ConfigFileFormat>.txt</ConfigFileFormat>
</tran:StoreDocument>
</soapenv:Body>
</soapenv:Envelope>


With inline file = true, the raw request :

POST http://[...] HTTP/1.1
Accept-Encoding: gzip,deflate
SOAPAction: "http://[...]"
Content-Type: multipart/related; type="text/xml"; start="<rootpart@soapui.org>"; boundary="----=_Part_91_5562999.1355746586537"
MIME-Version: 1.0
User-Agent: Jakarta Commons-HttpClient/3.1
Host: [...]
Content-Length: 1781


------=_Part_91_5562999.1355746586537
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-ID: <rootpart@soapui.org>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tran="http://[...]">
<soapenv:Header/>
<soapenv:Body>
<tran:StoreDocument>
<DocumentID>987654321</DocumentID>
<!--Optional:-->
<CreationDate/>
<DocumentContent>Z2poZ2YsaGp5ZGZldnNiZ2Zuamh5Z2YsaGpmanlybGlodXVsaWd0</DocumentContent>
<!--Optional:-->
<DocumentContentFormat>.txt</DocumentContentFormat>
<ConfigFile>file:E:\i][...]\Edit1.xml</ConfigFile>
<!--Optional:-->
<ConfigFileFormat>.txt</ConfigFileFormat>
</tran:StoreDocument>
</soapenv:Body>
</soapenv:Envelope>
------=_Part_91_5562999.1355746586537
Content-Type: text/xml; charset=us-ascii
Content-Transfer-Encoding: 7bit

<?xml version="1.0" encoding="utf-8"?>
<config type = "config-xmlfile" >
<attributes>
<attribute name="Title">test-IRMA100</attribute>
<attribute name="FileName">test-IRMA100</attribute>
<attribute name="Author">PAD</attribute>
<!-- attribute name="Created" >valeur4</attribute -->
<!-- attribute name="Modified" >valeur5</attribute -->
</attributes>
<docbase>test_GEDCLI_G6R0</docbase>
<root>/TEST_PAD_SharePoint</root>
<doclibguid>titi</doclibguid>
<docid>tutu</docid>
<returnuri>http://www.google.fr/bhtpcy-6</returnuri>
<location>/Collab/Doss2/Doss21/</location>
</config>

------=_Part_91_5562999.1355746586537--

and the error in Soap UI Log : Mon Dec 17 13:37:53 CET 2012:WARN:Failed to process inline/MTOM attachments; java.lang.ArrayIndexOutOfBoundsException: 0

With inline files = false, the raw request is the same and there is no such error in Soap UI Log

However I always get the error :
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>Unexpected error during document transfer Content is not allowed in prolog.</faultstring>
<detail/>
</soapenv:Fault>


Thank you in advance for your help
Pascal