cancel
Showing results for 
Search instead for 
Did you mean: 

Create / Test A Scenario With a HTTPCall with method POST B1if

Former Member
0 Kudos

Hello experts...

Somebody knows how to create a Scenario with

a HTTP Call with method POST and test it with a

some data in XML file or other way to probe

the POST method??

Regards. Enrique

Accepted Solutions (1)

Accepted Solutions (1)

bastian_schaefer
Active Contributor
0 Kudos

Hello Enrique,

please check B1i Online documentation and search fro term "Call HTTP Atom":

As result you get:

  1. Call HTTP Atom, a description how-to use a httpCall atom in your integration flow
  2. HTTP Call Atom Schema; an example how a HTTP call schema needs to look like:

The following example is handing over a Business Partner CardCode towards another HTTP System (second B1i system) using the HTTP POST method (using the ssl trustStoreURI is only neccessary for https related calls):


<xsl:template name="transform">

<call xmlns="">

<query id="identifier" value="value"/>

<!--optional - define your own query parameters - multiple elements allowed-->

<connect>

<!--the connect section is optional - you can also define a reference to the sld-->

<destProtocol>http</destProtocol>

<destHost>xxxx</destHost>

<destPort>8080</destPort>

<destPath>B1iXcellerator/exec/ipo/vP.001sap0000.in_HCSX/com.sap.b1i.vplatform.runtime/INB_HT_CALL_SYNC_XPT/INB_HT_CALL_SYNC_XPT.ipo/proc</destPath>

<query/>

<proxyHost/>

<proxyPort/>

<method>POST</method>

<authentification>NONE</authentification>

<user/>

<password/>

<user2query/>

<password2query/>

<sslTruststorePath/>

<sslTruststorePassword></sslTruststorePassword>

<trustStoreURI></trustStoreURI>

<keyStoreURI/>

</connect>

<dtd>

<!--optional - document type definition-->

</dtd>

<pltype></pltype>

<payload>

<!--optional - in case of POST request you specify here your request document-->

<BusinessPartner>

<row>

<CardCode>EDI</CardCode>

</row>

</BusinessPartner>

</payload>

<htta>

<par id="httpheader.???" value="">

<!--<par id="httpheader.Content-Type" value="application/x-www-form-urlencoded;charset=UTF-8">-->

<!--optional - you can specify here your own http header definitions - multiple elements allowed-->

</par>

<par id="htta.returnpltypeforce" value="">

<!--optional-->

</par>

<par id="htta.returnpltypedefault" value="">

<!--optional-->

</par>

</htta>

</call>

</xsl:template>

Best regards

Bastian

Former Member
0 Kudos

Hello Bastian,

Thanks for the support, now have another trouble...

How to send post parameters through a form, in HTML.

In other words, when i submmit the information in a little form call the

HTTP call and in a first step, wanna see the parameters i send.

Do you know has that?

Regards

Enrique.

bastian_schaefer
Active Contributor
0 Kudos

Please compare to following thread about the GET method: Get CSV file from a call http atom

Please check the B1i message log for your HTTP Call result, activating debugging gives you additional information within the HTTP Call attom.

 

Best regards

Bastian

bastian_schaefer
Active Contributor
0 Kudos

Hi Enrique,

the parameters should be filled in field <query>:


<query>getCSV=CSVTest0000.csv&amp;parameter2=parameter2value&amp;parameter3=parameter3value</query>

in this example following parameter are handed over via HTML Header:

  • getCSV
  • parameter2
  • parameter3

please use


"&amp;"

as delimiter for your parameters, it will be translated automatically.

If you want to handover URL parameters containing special characters,  you must URL encode the string. The integration framework provides the encode  Java function in the utils2 namespace. To ensure that the function works  correctly, cast the string with the string XPath  function.

Define the call as follows:


   <xsl:variable name="var">{"myPar":"myVal"}</xsl:variable>

   <query  id="json" value="{utils2:encode(string($var))}"/>

 

Best regards

Bastian

Former Member
0 Kudos

Hi Bastian...

Thank so much for the support, finally i can see, in the Message Log, the parameters i sent through HTML form with POST method, but i have another question...

You can help me or give me a orientation to how to do the XSLT transformation to obtain only the values of the parameters i sent from the HTML form?

THANKS!!!

Best regards

Enrique

bastian_schaefer
Active Contributor
0 Kudos

Hi Enrique,

it seems that I misunderstood you before.

You're not sending a HTTP POST via B1i: You're receiving a HTTP Post with B1i!

Please check online Help for "HTTP Inbound".

To read out e.g. the first attribute from the payload Role=S, just add an XFORM transformation atom und use XSLT logic:

/vpf:Msg/vpf:Body/vpf:Payload[./@Role='S']/bfa:io/bfa:key[./@name='user']/@value

Best regards

Bastian

Former Member
0 Kudos

Hi Bastian

I have no words to thank for the support!!

I finally got what I wanted, see the parameters what i sent to b1if through html form.

Thank so much!!!

Best regards

Enrique

Answers (0)