Skip to Content
avatar image
Former Member

MultiPart request using HTTP_AAE, SAP PI is sending default boundary

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Jul 22, 2016 at 01:30 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 19, 2016 at 08:58 AM

    Experts ... please reply ...

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • Jul 20, 2016 at 02:51 AM

    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:

    HTML MultiPart Form upload using HTTP Plain adapter with Java mapping

    Regards,

    Sanjeev.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • Sep 13, 2016 at 01:50 PM

    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

    Add comment
    10|10000 characters needed characters exceeded