cancel
Showing results for 
Search instead for 
Did you mean: 

Error in HTTP adapter: "Content is not allowed in prolog"

0 Kudos

Hello,

I recently started working with PI and I`m faced with a requirement that I fear I can´t solve on my own.

We need to send data via proxy to PI and further on to a 3rd party using http post with parameters in the http body. It´s a synchronous interface, so we need to pick up the http body of the incoming response and send it back to the calling proxy.

I´m currently testing with a http 7.3 adapter (xi payload in http-body) with a dummy parameter in the first step. With this I get a response of the 3rd party, but the message mapping of the response runs on following error:

<SAP:Category>Application</SAP:Category><SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>

<SAP:P1>com/sap/xi/tf/_MM_TEST_RESPONSE_</SAP:P1>

<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException:</SAP:P2>

<SAP:P3>Content is not allowed in prolog.</SAP:P3>

The incoming response looks like this (as one big string):

error.1.errorCode=123&error.1.message=FIELD1+is+missing&error.1.consumerMessage=FIELD1+is+missing.&

error.2.errorCode=456&error.2.message=FIELD2+is+missing.&error.2.consumerMessage=FIELD2+is+missing.&status=1

I think the problem is that this string can´t be matched into the data type of the message mapping because a xml structure is expected.

Now I´ve got several questions:

  • What do I have to do that this string fits to the data type of the massage mapping? Actually the data type is a simple type of a xsd:string.
  • I´ve seen that there is a possibility of XI payload manipulation using prolog and epilog. But does it mean that the message of the request is manipulated in this way, or the message of the response, or both? What do if have to declare in this case?
  • Am I using the correct adapter type? I´ve also tested with soap and http_aae adapter, but also without success. The http adapter seems to be first choice to me.
  • Later on, how can I put the parameters of the proxy to the http body? With a UDF and dynamic configuration, or with a java mapping?

Any suggestions are welcome.

Regards,

Marcus

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

I´m still faced with this problem... Does nobody have an idea?

iaki_vila
Active Contributor
0 Kudos

Hi Marcus,

Check Shabarish Vijayakumar's blog 

Regards.

0 Kudos

Thanks Inaki, but I have already checked this and the error still exists.

Regards,

Marcus

Former Member
0 Kudos

Hi Marcus

You need to use Java mapping to pass the parameters in the HTTP body for POST method.For the response mapping also you need a java mapping to read the whole string and generate the xml structure from it and then send back to Proxy.

Below blog will show you how you can do a simple HTTP post

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80104882-c7a8-2f10-c3a3-81f182917...

0 Kudos

Hi Indrajit,

the blog sounds very promising, thanks a lot!

I will need some time to configure this, especially the java mapping, but I think this will resolve my issue. Great!

Regards,

Marcus

Answers (0)