# using FTP gateway i always get error 'content not allowed in

**URL:** <https://techcommunity.softwareag.com/t/using-ftp-gateway-i-always-get-error-content-not-allowed-in/58592>\
**Category:** Forum\
**Tags:** Former-Crossvision-Products, Service-Orchestrator\
**Created:** [July 14, 2004, 5:09pm UTC](https://techcommunity.softwareag.com/t/using-ftp-gateway-i-always-get-error-content-not-allowed-in/58592 "2004-07-14T17:09:07Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichaelK](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@MichaelK](https://techcommunity.softwareag.com/u/MichaelK)\
**Post date:** [July 14, 2004, 5:09pm UTC](https://techcommunity.softwareag.com/t/using-ftp-gateway-i-always-get-error-content-not-allowed-in/58592/1 "2004-07-14T17:09:07Z")

</div>

env: win2000p, mediator 731, JBOSS comming with this mediator  
problem. i try to use the FTP gateway wit a GET command, but always i get error: ‘Exception: com.softwareag.xbridge.exceptions.DocumentParseException: [Fatal Error] :1:1: Content is not allowed in prolog.’  
in the documenttation i don’t see anything.  
what are some important settings for the FTP gatway. do we have any restriction for the file/file content read by the FTP gatway. by the way the file i try to read is located on LINUX  
  
thanks  
  
M

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [July 15, 2004, 12:35pm UTC](https://techcommunity.softwareag.com/t/using-ftp-gateway-i-always-get-error-content-not-allowed-in/58592/2 "2004-07-15T12:35:07Z")

</div>

You are probably picking up a non-xml document, and thus by default replacing the current payload with non-xml.  
If this is the case, what you need to do is specify a different/new message part to hold the document you are GETting. This way the (well-formed XML) payload that existed before the FTPGateway is not replaced after the FTPGatewy. To do this just set the xbd.target.contentID property on the FTPGateway.  
Read the section on “processing multipart messages” in the XML Mediator documentation.  
  
regards,  
- arp

---

<div class="post-metadata">

**Author:** ![MichaelK](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@MichaelK](https://techcommunity.softwareag.com/u/MichaelK)\
**Post date:** [July 19, 2004, 7:44pm UTC](https://techcommunity.softwareag.com/t/using-ftp-gateway-i-always-get-error-content-not-allowed-in/58592/3 "2004-07-19T19:44:32Z")

</div>

hi arp,  
first of all thank you for the hint regarding the multi-part message. after doing some testing with this type of setup i am just wondering if i can read only xml documents using the ftp gateway. my problem is to read a typical csv file into a sequence. checking all the possible properties i found nothing close to  
an inbound transformation or a basic wrapping with just a root element.  
  
do you have any idea about this?  
regards  
MichaelK

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [July 20, 2004, 8:26am UTC](https://techcommunity.softwareag.com/t/using-ftp-gateway-i-always-get-error-content-not-allowed-in/58592/4 "2004-07-20T08:26:29Z")

</div>

Hi Michael;  
  
Just to be clear, FTPGateway will allow you to retrieve any type of content, not just XML.  
  
The issue you raise is how to process the non-XML (in this specific case, CSV) in Mediator.  
  
Mediator itself must have well-formed XML as the current message part in the payload. This is why when you retrieve/create non-XML using any Mediator component you must make sure to direct the result to another message part.  
  
If you need not only to get your CSV file but actually process it, you will need to use the JavaObjectGateway to pass the CSV to a custom Java Class that knows how to handle your CSV. This java class can for example turn your CSV into well-formed XML, and then you can use other mediator components (emergers, transforms etc…) to further process the data.  
  
regards,  
- arp

---

<div class="post-metadata">

**Author:** ![Mike\_Bernat](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Mike\_Bernat](https://techcommunity.softwareag.com/u/Mike_Bernat)\
**Post date:** [July 20, 2004, 7:08pm UTC](https://techcommunity.softwareag.com/t/using-ftp-gateway-i-always-get-error-content-not-allowed-in/58592/5 "2004-07-20T19:08:00Z")

</div>

Hi Michael, Arp:  
  
Testing for well-formed XML in Mediator payload is based on the content-type. If it specifies an XML type, the content is validated as XML. If not, no validation is done.  
  
The content-type of the response defaults to the content-type of the payload before the FTPGateway call. It can be changed by specifying the xbd.ftp.content.type property. Or as Arp said, you can direct the response to another message part with xbd.target.contentType and xbd.target.contentID.  
  
Hope this helps.  
  
Best regards,  
 Mike

---

<div class="post-metadata">

**Author:** ![MichaelK](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@MichaelK](https://techcommunity.softwareag.com/u/MichaelK)\
**Post date:** [July 22, 2004, 2:50pm UTC](https://techcommunity.softwareag.com/t/using-ftp-gateway-i-always-get-error-content-not-allowed-in/58592/6 "2004-07-22T14:50:30Z")

</div>

hi Arp, hi Mike,  
  
i have set the properties as recommended.  
meaning: …target.contentID  
 …target.contentType to text  
but now i am getting the following error from the log:  
com.softwareag.xbridge.exceptions.XException: Payload.setContentType: javax.mail.internet.ParseException  
question:  
what type of content definition is possible and can be set?  
what type of content defintion shall be set for the following file content:  
xxxxxxxm ‘new line’  
dfdfdfd ‘new line’  
  
documentation unfortunately is a little bit short on this topic.  
  
regards  
Michaelk  
  
[This message was edited by Rolf Bahlke on 22 Jul 2004 at 15:14.]

---

<div class="post-metadata">

**Author:** ![Mike\_Bernat](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Mike\_Bernat](https://techcommunity.softwareag.com/u/Mike_Bernat)\
**Post date:** [July 23, 2004, 7:18pm UTC](https://techcommunity.softwareag.com/t/using-ftp-gateway-i-always-get-error-content-not-allowed-in/58592/7 "2004-07-23T19:18:56Z")

</div>

Hi Michael,  
  
Content types are defined by internet standards (RFC2045) and of the form “x/y” where x is the primary type and y is the sub-type. A common value for simple text files is “text/plain”.  
  
Mediator treats “text/xml”, “application/xml”, and any type of the form “x/y+xml” as xml content. All others are not validated.  
  
Best regards,  
 Mike

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [July 26, 2004, 1:24pm UTC](https://techcommunity.softwareag.com/t/using-ftp-gateway-i-always-get-error-content-not-allowed-in/58592/8 "2004-07-26T13:24:27Z")

</div>

Thanks for the correction Mike - I was under the impression that if you put XML into a component you either have to get XML out of the component or redirect the output of the component to another/new message part.  
  
I just tried a simple scenario with the following sequence and stylesheet:  
  
\<?xml version="1.0" encoding="UTF-8"?\>  
  
  
\<step component=“SagTransformer”  
xbd.target.contentType=“text/plain”  
xbd.transformer.pattern=“Trax” xbd.transformer.stylesheets=“[http://localhost:8080/demo/stylesheets/test.xsl](http://localhost:8080/demo/stylesheets/test.xsl)”/\>  
  
  
  
\<?xml version="1.0"?\>  
\<xsl:stylesheet xmlns:xsl=“[XSLT Namespace](http://www.w3.org/1999/XSL/Transform)” version=“1.0”\>  
\<xsl:output method=“text” omit-xml-declaration=“yes”/\>  
\<xsl:template match=“/”\>  
this is a text transform  
\</xsl:template\>  
\</xsl:stylesheet\>  
  
Now this _works_ as you mention, however something is adding an XML prolog such that the response to the client looks like (including the newline between prolog and text):  
  
\<?xml version="1.0" encoding="UTF-8"?\>  
  
this is a text transform  
  
Now I tried another sequence using an FTP gateway:  
  
\<?xml version="1.0" encoding="UTF-8"?\>  
  
  
\<step component=“SagFtpGateway”  
xbd.ftp.commands=“ascii;get test.txt”  
xbd.ftp.error.continue=“no”  
xbd.ftp.host.name=“localhost”  
xbd.ftp.host.port=“21”  
[xbd.ftp.password="a@a.net](mailto:xbd.ftp.password=%22a@a.net)"  
xbd.ftp.user=“anonymous”  
xbd.target.contentType=“text/plain”/\>  
  
  
  
and this worked as expected i.e. without an XML prolog added to the text.  
  
best regards,  
- arp

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [July 26, 2004, 1:31pm UTC](https://techcommunity.softwareag.com/t/using-ftp-gateway-i-always-get-error-content-not-allowed-in/58592/9 "2004-07-26T13:31:47Z")

</div>

> [@](#):
>
> Testing for well-formed XML in Mediator payload is based on the content-type. If it specifies an XML type, the content is validated as XML. If not, no validation is done.

Tsk tsk tsk…  
Validated? Surely you mean “tested for well-formedness”?

---

<div class="post-metadata">

**Author:** ![Mike\_Bernat](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Mike\_Bernat](https://techcommunity.softwareag.com/u/Mike_Bernat)\
**Post date:** [July 26, 2004, 7:11pm UTC](https://techcommunity.softwareag.com/t/using-ftp-gateway-i-always-get-error-content-not-allowed-in/58592/10 "2004-07-26T19:11:28Z")

</div>

Hi Arp,  
  
The stylesheet problem you mention is known. It appears to be an issue with the way Xalan converts from its internal to external form. We are looking into it.  
  
Best regards,  
 Mike

---

<div class="post-metadata">

**Author:** ![Mike\_Bernat](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Mike\_Bernat](https://techcommunity.softwareag.com/u/Mike_Bernat)\
**Post date:** [July 27, 2004, 7:24pm UTC](https://techcommunity.softwareag.com/t/using-ftp-gateway-i-always-get-error-content-not-allowed-in/58592/11 "2004-07-27T19:24:57Z")

</div>

Hi Arp,  
  
You are correct. My answer was not quite “well formed”.  
  
However, if the payload includes a DTD or schema reference, it will be “validated” against that reference.  
  
Best regards,  
 Mike

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:39pm UTC](https://techcommunity.softwareag.com/t/using-ftp-gateway-i-always-get-error-content-not-allowed-in/58592/12 "2021-04-02T14:39:21Z")

</div>

Closed on April 2, 2021, 2:39pm UTC


