cancel
Showing results for 
Search instead for 
Did you mean: 

Can HTTP receiver comm channel take more than six dynamic URL parameters?

Former Member
0 Kudos

Hi All,

We are on PI 7.1. The scenario we have here is to post data to an existing 3rd party web application (not XML –based, not webserive-enabled) using HTTPS. On HTTP receiver comm channel screen, there are 6 parameters (from Parameter 1 to Parameter 6) are available. We need to post a dynamic URL with 8 parameters of changing values. Do you see a way to have the dynamic URL constructed with 8 parameters?

Thanks,

Shawn

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

Hi Shawn,

Yes, it's possible, check this Note 1105368 - HTTP adapter: Dynamic URL and HTTP parameters

Regards.

Former Member
0 Kudos

HThanks Vila.

   I checked “Apply URL parameters” and “Apply HTTP Header Fields” in the Comm channel and specified field names in the corresponding parameters in and fields. In the mapping, I added one UDF to address TargetURL, UrlParamOne, UrlParamTwo, UrlParamThree, UrlParamFour, UrlParamFive, UrlParamSix; and another one for SAP_URL_EXTENSION, urlext01 and urlext02 (I used Field1 and Field2 in HTTP Header Fields for parm7 and parm8). I am getting error on <SAP:Stack>Dynamic Header - Missing Message Attributes: Fields/Parameters</SAP:Stack>. 

The content of DynamicConfiguration is shown as below. Do you see anything that I missed or did wrong here?

 

<SAP:DynamicConfiguration SOAP:mustUnderstand="1" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

  <SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="UrlParamOne">1348522667</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="SAP_URL_EXTENSION">urlext</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="UrlParamThree">f3fcaa0d1dbe2bf4ef8c5b01d9e45ad8</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="TargetURL">https://XXXXXXXXXXXXX.com/api/submission?data_collection_point=XXXX_XXXXX_TEST</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="UrlParamFour">7db5a9eec76032a0d36d82c05e6226e9</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="UrlParamFive">H</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="UrlParamSix">200</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="urlext01">20</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="urlext02">10</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="UrlParamTwo">5f1c1482ed48d3bbf4c534731d50b8eb</SAP:Record>

  </SAP:DynamicConfiguration>

The whole URL should be

https://XXXXXXXXXXXXX.com/api/submission?data_collection_point=XXXX_XXXXX_TEST&parm1=1348522667&parm...

Thanks again for your time.

iaki_vila
Active Contributor
0 Kudos

Hi Swan,

Have you tried this?:

  <SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="urlext01">parm7=20</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="urlext02">parm8=10</SAP:Record>

Regards

Former Member
0 Kudos

Hi Vila,

In the http receiver comm channel, Besides "Apply URL Parameters" I checked “Apply HTTP Header Fields” and put “parm7” in Field1, “parm8” in Field2. I did the similar setting as on URL Parameters when there were only 6 parameters and it worked ok. Does it work differently on Header fields? Will the parm7 and parm8 be appended to the end of the URL (constructed with the 6 URL parameters then plus the addition two parameters in header field)?  Could you please provide me details on how to make parm7=20 into the statement as mentioned in your message above? I thought the system will automatically assign the value (var7) from mapping to parm7 defined in header field1.

     parmValue = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "urlext01");

     conf.put(parmValue, var7);

Thanks,

Shawn

Former Member
0 Kudos

I figured it out to make it work. The trick is to include the additional parameter names along with the value of the paramenters in the source data that is sent to PI. I incliuded the simple document below and hope it helps in case someone faces the same problem.

Thanks,

Shawn

HTTP dynamic URL sending more than six parameters

Scenario: proxy to plain HTTP. HTTP URL sends eight dynamic values. The URL is something like below.

https://xxx.yyyyyyyyyy.com/api/submission?data_collection_point=MBSS_ZZZZ_TEST &period=1348687139&site_key=f7cd5905db483f7d53ecb9e816aec91b&retailer_key=5895789e6da19025b9632910b45ce8a8&store_key=de0d3d200f559f1c003fa305c12f9054&document_type=H&sales_amount=100.00&sales_tax=10.00&quantity=2.00

Where the value of the following eight fields are changing.

Dynamic fields: period, site_key, retailer_key, store_key, document_type, sales_amount, sales_tax and quantity.

Message Mapping: Create a UDF that takes eight input parameters and assigns the input to six URL parameters (UrlParamOne to UrlParamSix) and to the two URL extension (urlext01, urlext02).  

UDF code:

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey parmValue;

//the url below is not the one in the real coding due to security reason

String url = https://xxx.yyyyyyyyyy.com/api/submission?data_collection_point=MBSS_ZZZZ_TEST; 

// TargetURL

                parmValue = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "TargetURL");             conf.put(parmValue, url);

                  parmValue = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "UrlParamOne");

                  conf.put(parmValue, var1);

                  parmValue = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "UrlParamTwo");

                  conf.put(parmValue, var2);

                  parmValue = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "UrlParamThree");

                  conf.put(parmValue,  var3);

                  parmValue = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "UrlParamFour");

                  conf.put(parmValue,  var4);

                  parmValue = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "UrlParamFive");

                  conf.put(parmValue,  var5);

                  parmValue = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "UrlParamSix");

                  conf.put(parmValue,  var6);

String extension = "urlext";

// Additional field

                parmValue = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "SAP_URL_EXTENSION");

                conf.put(parmValue, extension);

                  parmValue = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "urlext01=");

                  conf.put(parmValue, var7);

                  parmValue = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "urlext02=");

                  conf.put(parmValue, var8);

return "";

HTTP Adapter configulation:

1.     1.    Add SAP_URL_EXTENSION under Header fields

1.       2. Provide the first six dynamic parameters under URL Parameters

fd     

m

 

          

ABAP code in the source system: sends the value of the eight parameters via ABAP proxy. For the two additional parameters, the trick is to include the parameter name as part of the output value to PI.

TRY.

  v_brd_record-PERIOD = parameter1.

  v_brd_record-SITE_KEY = parameter2.

  v_brd_record-Retailer_key = parameter3.

  v_brd_record-Store_KEy = parameter4.

  v_brd_record-doctype = parameter5.

  v_brd_record-Salesamt = parameter6.

* to simplify testing, sales_tax and quantity are assigned value directly here

    v_brd_record-salestax = 'sales_tax=10.00'.  include parameter7 name “sales_tax”

    v_brd_record-quantity = 'quantity=2.00'.    include parameter8 name “quantity”

  append v_brd_record to it-mt_mbs_out-record.

    CALL METHOD prxy->SI_MBS_SAP_OUT

      EXPORTING

        output = it.

     commit work

    .

  CATCH cx_ai_system_fault .

    DATA fault TYPE REF TO cx_ai_system_fault .

    CREATE OBJECT fault.

    WRITE 😕 fault->errortext.

ENDTRY.

The Value of Dynamic Configuration:

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

- <!-- Call Adapter -->

- <SAP:DynamicConfiguration SOAP:mustUnderstand="1" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

<SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="UrlParamOne">1350417835</SAP:Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="SAP_URL_EXTENSION">urlext</SAP:Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="UrlParamThree">4cca1cd0f9131b07934fdba30901a059</SAP:Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="urlext01=">sales_tax=10.00</SAP:Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="TargetURL">https://xxx.yyyyyyyyy.com/api/submission?data_collection_point=MBSS_ZZZZ_TEST</SAP:Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="UrlParamFour">70cfcf92e20a2a0ad7edfcf8fa73f6a9</SAP:Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="urlext02=">quantity=2.00</SAP:Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="UrlParamFive">H</SAP:Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="UrlParamSix">200</SAP:Record>

<SAP:Record namespace="http://sap.com/xi/XI/System/HTTP" name="UrlParamTwo">e635c61a8aea34efd19cedf53e4bacc0</SAP:Record>

</SAP:DynamicConfiguration>

The Trace of HTTP Adapter Outbound:

  <Trace level="1" type="T">---------------------------------------------</Trace>

<Trace level="1" type="T">---- Plain HTTP Adapter Outbound----</Trace>

<Trace level="1" type="T">---------------------------------------------</Trace>

<Trace level="1" type="B" name="CL_HTTP_PLAIN_OUTBOUND-ENTER_PLSRV" />

- <!--

************************************

-->   

<Trace level="3" type="T">Quality of Service EO</Trace>

<Trace level="1" type="T">Get XML-Dokument from the Message-Objekt</Trace>

<Trace level="3" type="T">URL https://xxx.yyyyyyyyyy.com/api/submission?data_collection_point=MBSS_ZZZZ_TEST</Trace>

<Trace level="3" type="T">Proxy Host:</Trace>

<Trace level="3" type="T">Proxy Service:</Trace>

<Trace level="3" type="T">Proxy User:</Trace>

<Trace level="3" type="T">~request_method POST</Trace>

<Trace level="3" type="T">~server_protocol HTTP/1.0</Trace>

<Trace level="3" type="T">accept: */*</Trace>

<Trace level="3" type="T">msgguid: 507BB665A18009E0E1008000AC1C2D76</Trace>

<Trace level="3" type="T">service: BRD_001</Trace>

<Trace level="3" type="T">interface namespace: http://xxxxxx.com/retail/MBSPOC</Trace>

<Trace level="3" type="T">interface name: SI_MBS_Mall_in</Trace>

<Trace level="3" type="T">quality of service: EO</Trace>

<Trace level="3" type="T">Header-Fields</Trace>

<Trace level="3" type="T">SAP_URL_EXTENSION urlext</Trace>

<Trace level="3" type="T">Prolog conversion Codepage: UTF-8</Trace>

<Trace level="3" type="T">Epilog conversion Codepage: UTF-8</Trace>

<Trace level="3" type="T">content-length 115</Trace>

<Trace level="3" type="T">content-type: text/xml; charset=UTF-8</Trace>

<Trace level="2" type="T">HTTP-Response :</Trace>

<Trace level="1" type="T">Ok</Trace>

<Trace level="2" type="T">Code : 200</Trace>

<Trace level="2" type="T">Reason: Ok</Trace>

</Trace>

Note: the host name, namesapce and some other fields are not in the real value due to security reason.

iaki_vila
Active Contributor
0 Kudos

Hi Shawn,

I'm really happy for you, and thank you very much indeed to share the final solution and very well explained and detailed. In my opinion, your solution deserves to stay in a blog, i encourage you to put it in your SCN blog.

Regards.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Shawn,

I am using SAP PI 7.31 Java Single stack and GET method in receiver HTTP communication channel. Is it possible to generate 7 dynamic parameters in HTTP url in my scenario.

Thanks

Dipankar

Former Member
0 Kudos

Dear users,

we have requirement sending SMS to the customers mobiles. I am successfully sending the messages to the customers mobiles by using the above method. Facing issues with response message. The response messages is in plain text fromat in single line like...Sent

Using HTTP_AAE Receiver adapter.

The response message was failed while excution of the message mapping with the error

Mapping failed in runtimeRuntime Exception when executing application mapping program com/sap/xi/tf/_MM_SMS_CUST_RES_; Details: com.sap.aii.utilxi.misc.api.BaseRuntimeException; Content is not allowed in prolog.


please share the comments how to pass the Status of the message to SAP ECC from SAP HTTP adapter


Regards,

Teja.

former_member317957
Participant
0 Kudos

Thanks...got it.

Former Member
0 Kudos

Hi Shwan,

We've got the same scenario as yours  but in our case we've imported certificate into the ABAP stack using STRUST and then selected Addressing Type: HTTP Destination. Can you please guide me on how yo imported your certificate to get your scenario to work  with Addressing Type: URL Address.

thanks and regards,

Katlego

Former Member
0 Kudos

Hi Katlego,

In our case, the certificate needs to be installed in both ABAP and JAVA stack. You may want to check with your Basis person to have the certificate installed in JAVA stack as well.

Thanks,

Shawn