cancel
Showing results for 
Search instead for 
Did you mean: 

MultiPart request using HTTP_AAE, SAP PI is sending default boundary

Former Member
0 Kudos

Dear All,

My Scenario is Proxy to HTTP. I am using HTTP_AAE channel . I am using SAP PI7.4

I need to pass a multipart request and attachment to 3rd party HTTP application

For this i have used Java mapping. Here Below is request generated after  java mapping.

b2Lh0weilHCR3Aw6z30XSc-HGGYpw-LcKSA

Content-Disposition: form-data; name="ioCtx"

Content-Type: text/plain; charset=US-ASCII

Content-Transfer-Encoding: 8bit

1

--b2Lh0weilHCR3Aw6z30XSc-HGGYpw-LcKSA

Content-Disposition: form-data; name="requestMode"

Content-Type: text/plain; charset=US-ASCII

Content-Transfer-Encoding: 8bit

0

--b2Lh0weilHCR3Aw6z30XSc-HGGYpw-LcKSA

Content-Disposition: form-data; name="fileType"

Content-Type: text/plain; charset=US-ASCII

Content-Transfer-Encoding: 8bit

0

--b2Lh0weilHCR3Aw6z30XSc-HGGYpw-LcKSA

Content-Disposition: form-data; name="numberLang"

Content-Type: text/plain; charset=US-ASCII

Content-Transfer-Encoding: 8bit

en

--b2Lh0weilHCR3Aw6z30XSc-HGGYpw-LcKSA

Content-Disposition: form-data; name="exportDestination"

Content-Type: text/plain; charset=US-ASCII

Content-Transfer-Encoding: 8bit

3

--b2Lh0weilHCR3Aw6z30XSc-HGGYpw-LcKSA

Content-Disposition: form-data; name="importType"

Content-Type: text/plain; charset=US-ASCII

Content-Transfer-Encoding: 8bit

0

--b2Lh0weilHCR3Aw6z30XSc-HGGYpw-LcKSA

Content-Disposition: form-data; name="ePASSRequestDocs"

Content-Type: text/plain; charset=US-ASCII

Content-Transfer-Encoding: 8bit

C:\SDG\Temp\Import.xml

--b2Lh0weilHCR3Aw6z30XSc-HGGYpw-LcKSA

Content-Disposition: form-data; name="C:\SDG\Temp\Import.xml"; filename="import.xml"

Content-Type: text/xml; charset=ISO-8859-1

Content-Transfer-Encoding: binary

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

<!DOCTYPE ePASSRequest SYSTEM "ePASS3.dtd">

<ePASSRequest requestID="6000285957" submitterOrganization="6200" submitterUser="bam" submitterPassword="Test@1234">

<RFxRequest>

<createRFx>

<RFx RFxStyle="None" OrganizationCode="6200" RFxName="1081600035" RFxType="RFP" RFxBusinessUnit="(Unassigned)" RFxIsTemplate="FALSE" RFxTemplateCode="ZR01" RFxStatus="created" RFxDecimalPlaces="2" RFxDefaultCurrencyCode="INR" RFxCurrencyCodes="INR|USD|EUR" RFxPrimaryContact="bam">

<GeneralRFxBiddingRules RFxUseBundleBid="false" RFxVolumeDiscount="false" RFxUseItemSet="false" RFxEventNotifications="true"/>

<AttachmentRules RFxEventAttachment="true" RFxBidAttachment="true" RFxQuestionnaireResponseAttachment="true" RFxQuestionResponseAttachment="true"/>

<RFQBiddingRules RFxUseVolumeBid="false" RFxAllowOptimizationFeedback="false" RFxAllowSupplierConstraint="false" RFxAllowSingleBidPerItem="false"/>

<RFxBuyerRules RFxLockedBidIndicator="false"/>

<HostAssignment LoginName="bam" ResponderParticipationStatus="accepted" SubscriptionType="rfx" HostAssignmentRole="Lead"/>

<Subscription LoginName="xyz@abc.com" SupplierProfileName="Org Name" ResponderParticipationStatus="unacknowledged" SubscriptionType="rfx"/>

<Requisition RequisitionCode="Default" RequisitionName="Default">

<LineItem LineItemCategoryCode="root category" LineItemCode="10" LineItemLotName="Default" LineItemMinimumBidQuantity="0" LineItemMinimumDesiredQuantity="10.0" LineItemName="10" LineItemType="single">

<ExtendedAttribute ExtendedAttributeCode="Material Code" ExtendedAttributeValue="OPC43"/>

<ExtendedAttribute ExtendedAttributeCode="Material Group" ExtendedAttributeValue="Z200"/>

<ExtendedAttribute ExtendedAttributeCode="Plant" ExtendedAttributeValue="6972"/>

<ExtendedAttribute ExtendedAttributeCode="Plant Region" ExtendedAttributeValue="WEST BENGAL"/>

<ExtendedAttribute ExtendedAttributeCode="Country" ExtendedAttributeValue="India"/>

<ExtendedAttribute ExtendedAttributeCode="Required Delivery Date" ExtendedAttributeValue="01.08.2016"/>

<ExtendedAttribute ExtendedAttributeCode="UOM" ExtendedAttributeValue="Metric Ton"/>

</LineItem>

</Requisition>

</RFx>

</createRFx>

</RFxRequest>

</ePASSRequest>

--b2Lh0weilHCR3Aw6z30XSc-HGGYpw-LcKSA--

---------------------------------------------------------------------------------

But i can see SAP PI is sending default boundary to 3rd party application as below:

ContentType is multipart/form-data;

boundary="----=_Part_902_709655699.1468844264926



also trace log says Request is single part

I also  tried to use message transform bean to change boundary and content type

Module  sequence is  as below

AF_Modules/MessageTransformBean

sap.com/com.sap.aii.adapter.http/HttpAdapterBean  

Parameter name Transform.ContentType       

Parameter value multipart/form-data;boundary="b2Lh0weilHCR3Aw6z30XSc-HGGYpw-LcKSA"

But still at receiver end Header boundary is reaching as

ContentType is multipart/form-data;

boundary="----=_Part_902_709655699.1468844264926


Please suggest me how I can send  content type as  multipart/form-data;boundary="b2Lh0weilHCR3Aw6z30XSc-HGGYpw-LcKSA"   in header request

Thanks

Sandeep Sharma

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

If you do not succeed, maybe you can use SOAP adapter instead? You can set the content type in Java Mapping, that worked for me. Set flag "do not use SOAP envelope" in SOAP adapter, so it works like HTTP adapter. I seen a mismatch in your HTTP stream: Content-Type: text/xml; charset=ISO-8859-1 Content-Transfer-Encoding: binary

The charset and the XML encoding must be the same

Answers (3)

Answers (3)

george_credland
Participant
0 Kudos

Hi Sandeep,

I'm also trying to set up a multipart scenario with HTTP_AAE. PI7.4 SP13.

I found that MessageTransformBean would apply to the MIME header for a section rather than the http headers for the whole message. In my scenario that's o.k. as it only has the main section (but I had to untick "Set Form" for it to work). It won't help with setting the overall message headers.

SAP Help has a list of standard beans for manipulating messages:

Adding Modules to the Module Processor - SAP Library

Information can be sketchy and lacks screenshots, but searching SCN can turn up more details with example screenshots.

I'm hoping to avoid going down the Java mapping route with additional complexity that adds.

George

former_member194786
Active Contributor
0 Kudos

Hi Sandeep,

Have you configured the HTTP channel with content type, as per:

Configuring the Java HTTP Adapter on the Receiver Channel - Advanced Adapter Engine - SAP Library

Also, it's explained in this blog:

Regards,

Sanjeev.

Former Member
0 Kudos

Hi Sanjeev,

I have already configured HTTP_AAE adapter  but Header content type is not getting converted.

Also I have already followed this blog. Infact I have developed java mapping using this blog only.

This blog explains changing boundary and content type in the request body but My issue is changing boundary and content type at header level.

Please  suggest further.

Thanks

former_member194786
Active Contributor
0 Kudos

Hi Sandeep,

If you are using the HTTP_AAE adapter, you shouldn't have to use Java mapping to create multi-part content. It should be done by the adapter configuration. I provided the link to check if you have configured the Content-Type in channel. Can you share a screenshot of channel?

Also, you can use SOAPUI to test your configuration. Host a REST service on the local SOAPUI system and provide the URL in your SAP PI system and see if you can get the payload. Alternatively, you can use XPI inspector to further investigate. Unfortunately, at the moment I am out of ideas. Hope someone else can provide more information.

Cheers,

Sanjeev

Former Member
0 Kudos

Hi Sanjeev,

Initially i tried with standard HTTP_AAE functionality to create multipart request but unsuccessful.

There is no detailed document on this new functionality.

Then i used the java mapping

Also I configured the content type as shown in the link but still no change in boundary

It seems that if i standard adapter module is creating boundary by default.

Is there any parameter which can set content type created by standard adapter?

thanks

Former Member
0 Kudos

Hello Sandeep,
there is parameter "ChangeContentType" from HTTP_AAE advanced mode. You can refer to SAP Note #2203472 for more information about it.

Regards!

Former Member
0 Kudos

Hi Vadym,

I will try this and will definitely get back to you..

thanks

Former Member
0 Kudos

Hi Vadym,

As per this note


HTTP_AAE Adapter has been used in the business scenario for message processing. During message processing, it has been noticed that there is no content type set for the incoming HTTP request to the HTTP_AAE sender. In plain HTTP adapter (ABAP), content-type of the incoming HTTP request is set to application/xml. After migrating from PI <7.11 to PI >7.31 this feature will be missing.

If we set this parameter "ChangeContentType"  value to true then it will change the content type as application/xml.  else it will send the default value


How can i use this parameter to change content type to multiupart/form-data;boundary = "XYZ"



thanks

Former Member
0 Kudos

Experts ... please reply ...

Former Member
0 Kudos

Hello Sandeep,

try to set the parameter "preferredContentTypeHeader" = true for HTTP_AAE adapter.

Also, please pay attention to the minimum required XIAF component versions in PI 7.4 system:

SP008

000040

SP011

000035

SP012

000014

SP013

000001

SP014

000000

Best regards,
Vadym

Former Member
0 Kudos

Hi Vadym,

I have used parameter  "preferredContentTypeHeader" = true for HTTP_AAE adapter

but still I am getting auto generated boundary

ContentType is multipart/form-data;

boundary="----=_Part_910_2020507712.1469001347684


please suggest further



thanks

sandeep

Former Member
0 Kudos

Dear Vadym,

To use message Transform Bean , For which PI version what should be SP level and patch level

If there is any note on this please share

Former Member
0 Kudos

Dear Vadym,

as SP 11 patch 35 is not available, so we have upgraded to SP11 Patch level 000055

I have observed 2 cases :

Case 1- If I uncheck option set multipart in HTTP_AAE receiver channel  then boundary goes as per our expectation but in this case keep attachment option gets disabled and we can not send attachment which is a part of our requirement.

Case2-  If I check option set multipart in HTTP_AAE receiver channel  then keep attachment option appears but SAP sends default boundary in this case.

Experts please suggest is there any way for case 2 using that we can send our fixed boundary

thanks sandeep