PI 7.1 HTTP Adapter - overwritte Prolog dynamically
I use a HTTP Adapter to send XML Data via HTTP as form field. Therefore i use the prolog constant. Example: xmlfile=.... Now i need two new parameter (user and password) as post parameters. I can change to prolog like user=...&password=....&xmlfile=.. But in this case the prolog with the user is hard coded. in my scenaria the user and password should dynamically load from Message Mapping. The solution with the dynamic URL Parameter 1-6 could not be used, because this values are GET Parameters which are visible in der URI!
Is there a solution for post parameters dynamically via HTTP Adapter?
The operation mapping aka Interface mapping's need not only use 1 single mapping.
In the interface mapping you can add multiple message mappings and / or other mapping programs.
The mappings get executed sequentially and the output of first mapping is input to second mapping and so on.
In this case, write a java mapping that will take the input as the output of your graphical mapping; add the prolog to this and make it the output of your Java Mapping and this is the final output of your Operation mapping!
Regards
Bhavesh
Similar Messages
-
HTTP adapter post prolog question.
Hi all,
I have a scenario where I need to send an XML message through the HTTP adapter (no SOAP) to an external service. THE HTTP Service requires a user password as parameters to be passed in order to process the message. Since HTTP adapters is doing only POST I used the prolog in order to pass these parameters (&user=xxx&password=XXXX) but i get a 401 error. In order to test I created a static HTML form with hidden inputs the user and password variable and did a POST (using iexplorer) and it worked!!! Am I doing something wrong?? Isn't the prolog filed in the adapter suppose to do the same ?? i.e. post two variable user, and password??? How does the prolog field worked? Any help will be appreciated.Thanks for the reply,
actually the problem was on the Content-Type. The default text/xml was the problem since the application was expecting a application/www-form-ulencode (or something like this, i don't remeber). Now it works!!! -
Hi all
Could you please to help. I need to use receiver with HTTP adapter which in this adapter that I need to pass dynamic URL into this. I had try follow this document
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/64dbb0af9f30b4e10000000a11466f/content.htm
but when I test it I got this error
<SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
<SAP:Category>XIAdapter</SAP:Category>
<SAP:Code area="PLAINHTTP_ADAPTER"><b>ATTRIBUTE_MISSING_URL</b></SAP:Code>
<SAP:P1 />
<SAP:P2 />
<SAP:P3 />
<SAP:P4 />
<SAP:AdditionalText />
<SAP:ApplicationFaultMessage namespace="" />
<SAP:Stack>Dynamic Header - Missing Message Attributes: URL/HTTP Destination</SAP:Stack>
<SAP:Retry>N</SAP:Retry>
</SAP:Error>
I think my XML source message format that is incorrect. This is my XML source message
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_OB xmlns:ns0="http://xxxx.com:db6">
<type>
<TargetURL>http://xx.xx.xx.xx</TargetURL>
</type>
</ns0:MT_OB>
Could you please to suggest.
Thanks
ParkHi,
Use the UDF in mapping to create the dynamic URL.
DynamicConfigurationKey keyURL = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/HTTP", <b>XXXXX</b>);
// access dynamic configuration
DynamicConfiguration conf = (DynamicConfiguration) param.get (StreamTransformationConstants.DYNAMIC_CONFIGURATION);
// set value
conf.put(keyURL, url);
See the belowlinks
dynamic URL - adapter specific properties (http receiver adapter)
/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
Regards
Chilla -
Plain HTTP Adapter - How to add CR/LF into Prolog?
Hi all!
I have to do a multipart/formdata request to an external HTTP Server. This requires to set boundaries etc. AND
to add Carriage Returns / Line Feeds into the HTTP-Body.
I think I could solve the problem using the Prolog / Epilog functionality of the HTTP Plain adapter - the only
thing that is missing now is <b>how to add Carriage Returns / Line Feeds into the Prolog / Epilog Field</b> within the communication channel configuration. It seems
that there is no "escaping possibility" - the HTTP Adapter writes the prolog "as it is entered" into the htto-Body of the request.
Any ideas?
Many thanks in advance,
AndyI recommend using Java Mapping.
Stefan -
Receiver HTTP Adapter Dynamic Query String
Hello,
I am using HTTP Adapter on receiver side.
My URL is <b>http://server:port/abc/def?xyz=123&luw=345</b>
When I am using Adapter specific attributes.
If I check apply Parameters and pass
Parameter 1 as xyz and Parameter 2 as luw and pass their values through dynamic configuration will they get appended to the dynamic querystring
http://server:port/abc/def at the end and I get back the complete URL.
Can this be achieved? I am stuck on this.
Regards,Srihari,
The best way to debug this and check what is happening would be to use the TCP gateway tool as shown in this blog by Stefan Grube.
/people/stefan.grube/blog/2007/03/29/troubleshooting-soap-http-and-mail-adapter-scenarios-with-tcpgateway
Send the request to the TCP gateway and forward it from there to the correspionding target.
You will be able to see the URL being passed including the Query String parameters.
Regards
Bhavesh -
Want to send information in Header dynamically using HTTP adapter using post method
Hi ,
I have a requirement to send below information in http Adapter header dynamically using post method. which will be authenticated by third party system.
Authorization : WSSE realm="SDP", profile="UsernameToken", type="AppKey" X-WSSE : UsernameToken Username="XXXX", PasswordDigest="Qd0QnQn0eaAHpOiuk/0QhV+Bzdc=", Nonce="eUZZZXpSczFycXJCNVhCWU1mS3ZScldOYg==", Created="2013-09-05T02:12:21Z"
I have followed below link to create UDF
http://scn.sap.com/thread/3241568
As if now my third party system is not available while sending request I am getting 504 gateway error. is there any approach I can validate my request is working fine?
Regards,Hi Abhay,
Correct me if I'm wrong but I think WSSE requires a SOAP Envelope. If that is the case, there are two approaches: the first one is to use SOAP Axis and the second one is just to build SOAP Envelope via Java mapping.
You also need to test it successfully externally, capture the request and replicate it in XI.
Hope this helps,
Mark -
How to build the "Path Prefix" HTTP Adapter at run time
Hi All,
I have a scenario wherein I have to call the HTTP Url of a thiird party system from R/3 via PI.
The third party url looks liike this:
http://gis/ias/cgi-bin/siscgi.exe?request=batch&command=<requests><request><name>sis_neighbouring_knos_for_sambandh_service</name><buffer>20</buffer><same_premise_kno>123</same_premise_kno><l
eft_kno>331</left_kno><gis_id>4019589</gis_id><priority>same_premise_kno,left_kno,right_kno,gis_id</priority></request></requests>&user_name=sambandh.sias&pa
ssword=sambandhsias
I have successfully created a HTTP Recevier comm channel and provided the following in the "Path Prefix"
/ias/cgi-bin/siscgi.exe?request=batch&command=<requests><request><name>sis_neighbouring_knos_for_sambandh_service</name><buffer>20</buffer><same_premise_kno>123</same_premise_kno><l
eft_kno>331</left_kno><gis_id>4019589</gis_id><priority>same_premise_kno,left_kno,right_kno,gis_id</priority></request></requests>&user_name=sambandh.sias&pa
ssword=sambandhsias
But If I need to pass the values inside the xml tags specified above e.g. "name" at run time, How do I do that?
I have explored the "Apply URL Parameters" option in the HTTP Comm channel but it has fixed names for the HTTP URL parameter.
Please let me know how is this possible hopefully without a UDF
thanks,
PiyushHi Piyush,
Have you checked the option of ASMA of the adapter?
http://help.sap.com/saphelp_nw04/helpdata/en/43/64dbb0af9f30b4e10000000a11466f/content.htm
Also see Note 1101338 - Dynamic configuration of HTTP adapter
Regards
Suraj -
Convert XML payload to HTML form data in Receiver HTTP Adapter
Hi,
I want to make a HTTP request ( Receiver HTTP Adapter ) to a servlet where I need to send the payload in HTML form format ( name=value ). As per the help document:
A typical HTML form comprises named fields. When transferring a completed form to the server or a CGI program, the data must be transferred in such a way that the CGI script can recognize the fields that make up the form, and which data was entered in which field.
The plain HTTP adapter constructs this format using a prolog and an epilog
Has anyone done this before? I looked through all help documents and forums but in vain. I can resort to Java Mapping to do this but I do not want to re-invent the wheel if I can do it easily using HTTP Adapter Configuration. Please help.The parameters available in HTTP adapter for message header are:
HeaderFieldFive http://sap.com/xi/XI/System/HTTP
HeaderFieldFour http://sap.com/xi/XI/System/HTTP
HeaderFieldOne http://sap.com/xi/XI/System/HTTP
HeaderFieldSix http://sap.com/xi/XI/System/HTTP
HeaderFieldThree http://sap.com/xi/XI/System/HTTP
HeaderFieldTwo http://sap.com/xi/XI/System/HTTP
HTTPDest http://sap.com/xi/XI/System/HTTP
TargetURL http://sap.com/xi/XI/System/HTTP
URLParamFive http://sap.com/xi/XI/System/HTTP
URLParamFour http://sap.com/xi/XI/System/HTTP
URLParamOne http://sap.com/xi/XI/System/HTTP
URLParamSix http://sap.com/xi/XI/System/HTTP
URLParamThree http://sap.com/xi/XI/System/HTTP
URLParamTwo http://sap.com/xi/XI/System/HTTP -
How to send the payload to a jsp using receiver Http adapter?
Hi experts,
I have this scenario from Legacy to XI to external app server.I have a test jsp to execute that functionality .Its a jsp which has 1 textarea named "test" and when I click on the submit buton I get a response back.This way I am able to test this independently.Now from XI when I am executing my scenario I am getting status code '1250' and message as ' http request(test) is null'.Now in the scenario in http adapter I just provide the target host : ip of server ,
service number : port no ,
path: the container or the request handler. But this scenario fails and gives me the above erroneous response.Now Basically I am not able to get how to send the value to the textarea "test"? please provide help as soon as possible.Do we have to put the name of the jsp in the "path" in http adapter and use prolog as test=.I tried this but it doesnt work.
Is there any way to check the URL that it forms after appending the querystring in the url ...?
So please provide help on this or suggest a solution to [email protected] as soon as possible.....
Thanx in advance.
Akshatahey Shekhar,
thanx for that prompt reply but I have configured the communication channel in the same manner as suggested by u.
actually I have this jsp page http://xx.xx.xx.xx:8080/abcdef/try/efg.jsp where there is a textarea "test" which has to be filled and there is a submit button.When I test this http client i.e the above jsp page independently then it goes to handler
http://xx.xx.xx.xx:8080/abcdef/trial/ And it gives a proper response message after clicking on the submit button.
now I want to carry out the same using receiver http adapter. I need to pass the value for this inputfield names "test" on that jsp . so right now I have configyured the adapter as
addressing type: url
target host : xx.xx.xx.xx
service no:8080
path : here I have given the path of handler i.e /abcdef/trial I tried giving the jsp page also but logically I guess it should be the handler.
content type: text/xml; charset=iso-8859-1
xml code: UTF-8
Mask special characters (URL escaping) checked.
now since the name of the inputfield is "test" in the prolog I gave test=
But it doesnt work I get this error "http request parameter [test] is null" in the response message which I guess suggests that it is not able to send the value for the field"test" to that handler.Please suggest how to send this and tell me if there are any other configurations that I have to do in the receiver communication channel.
Thanx ,
Akshata -
Hello All,
I'm want to use the ASMA in http adapters.
I tried in file adapters and got the expected result but in HTTP couldn't get it.
In file adapter:
I have selected the ASMA option in sender communication channel and selected the filename so that filename is included in message header.
When selected the ASMA in receiver communication channel and selected the filename so that the filename which is added in message header is getting reflected here by overwriting the constant file name given in filename schema.
In HTTP adapter:
In sender communication channel i'm selecting the ASMA. But i have doubt in using the
HTTP Header Fields .
Field 1, …, 6: (technical name: HeaderFieldOne, .... HeaderFieldSix)
URL Parameters
Parameter 1, …, 6: (technical name: URLParamOne, …, URLParamSix)
here url parameters implies what? is it the optional parameters like msgguid, party....etc other than mandatory parameters namespace,interface,senderservice?
What is this HTTP fields...? is it any additional fields other than above optional and mandatory fields, which are coming in HTTP reuest url.
I have used the HTTP client tool to send payload to my PI system. I sent the xml payload to pi by providing the mandatory fields. it's fine. when i gave the optional parameters in the input filed, automatically it is including in xi message header(without selecting the option URL parameters).
Also i have added two input fields and entered value in them, they got added in fields in URL. But they are not reflecting in messgae header inspite of selecting HTTP Header Fields and gave that input field.
Please give detail description. I have checked in several blogs but didn't get enough info.
Please help me.
Regards,
Ch.VenkatHi Venkat,
Please refer the SAP Note 1386621 - Plain HTTP Adapter: Dynamic parameter.
here url parameters implies what? is it the optional parameters like msgguid, party....etc other than mandatory parameters namespace,interface,senderservice?
URL parameter is to create or retrieve URL. for receiver HTTP adapter you can set this parameter on UDF and create dynamic HTTP url at run time.
What is this HTTP fields...? is it any additional fields other than above optional and mandatory fields, which are coming in HTTP reuest url.
HTTP fileds is to create or retrieve HTTP header values (If present).
Please check the SAP note for more detail.
regards,
Harish -
Hi...
I have a sender file adapter and HTTP receiver adapter.
In HTTP adapter, in the parameter "ent-filename" , I want to retain the name of the file that was picked.
In Sender File adapter, I have checked the File Name under Adapter specific message attributes.
In the HTTP receiver , I tried putting the value for ent-filename as %FileName% .
When I check in sxmb_moni, it shows me the ent-filename = %FileName%, but not the actual file name.
Kindly help!
Thanks,
Pratibha.Here is a blog how to provide the HTTP header fields:
/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
If you do not want to write a UDF, you can do it like described in that blog:
/people/stefan.grube/blog/2009/06/19/unknown-use-case-of-dynamicconfigurationbean-store-file-name-to-jms-header-without-mapping
Put the modules in sender channel and use the parameters of HTTP adapter. -
HTTP adapter - change encoding from UTF-8 to ISO-8859-1
Hi,
I am trying to change the encoding used by the HTTP sender adapter in a scenario.
However, when I enter ISO-8859-1 in the XML Code under XI Payload Manipulation on the comms channel it has no effect - the paylad still shows as UTF-8 in SXI_MONITOR.
Am I missing a step or entering the field incorrectly ??
Thanks
Colin.Hi,
From help
Enhancing the Payload
Some external systems, for example, Web servers in marketplaces, can only process data if it is sent as an HTML form using HTTP.
A typical HTML form comprises named fields. When transferring a completed form to the server or a CGI program, the data must be transferred in such a way that the CGI script can recognize the fields that make up the form, and which data was entered in which field.
The plain HTTP adapter constructs this format using a prolog and an epilog. Therefore, there is a particular code method that separates form fields and their data from each other. This code method uses the following rules:
Individual form elements, including their data, are separated from each other by the character &.
The name and data of a form element are separated from each other by an equals sign (=).
Blanks in the entered data (for example, in multiple words) are replaced by a plus sign (+).
All characters with the (enhanced) ASCII values 128 to 255 (hexadecimal 80 to FF) are transcribed using a hexadecimal sequence, beginning with a percentage sign (%) followed by the hexadecimal value of the character (for example, the German umlaut ö in the character set ISO-8859-1 is transcribed as %F6).
All characters that occur in these rules as control characters (&, +, =, and %) are also transcribed hexadecimally in the same way as high value ASCII characters
http://help.sap.com/saphelp_nw2004s/helpdata/en/44/79973cc73af456e10000000a114084/content.htm
Regards
Chilla -
Header Fields not picked in Http Adapter
Hi ,
I am sending a few custom header fields that have been set up in the HTTP adapter but for some reason they are not picked.
Any suggestions..
-TeresaThanks Sameer,
This note did help us pick up the header fields but on picking up it returns the header fields in lower case instead of the case Sensitive format I sent it in ..I looked at the trace log too and its in case sensitive format but when my 3rd party receives it, it is in lower case format...funny even the <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
is also in lowercase..I am running XI 3.0 SP4..Is it an XI issue or something to do with my integration server which processes my HTTP adapter??? Or any other notes also needs to be applied??
Please help..
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 http://xkqbdev.ampton.net:50080/abc/Web/servlet/XMLChannelServlet</Trace>
<Trace level="3" type="T">Proxy Host: 10.69.14.98</Trace>
<Trace level="3" type="T">Proxy Service: 80</Trace>
<Trace level="3" type="T">Authorization: Basic NDQ0NDQ0NDQ0OjQ0NDQ0NDQ0NA==</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">content-type: text/xml</Trace>
<Trace level="3" type="T">Header-Fields</Trace>
<Trace level="3" type="T">X-Extricity-Sender-ID 444444444</Trace>
<Trace level="3" type="T">X-Extricity-BO-Type-ID http://xml.cXML.org/schemas/cXML/1.2.011/cXML.dtd</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 3023</Trace>
<Trace level="2" type="T">HTTP-Response :</Trace>
<Trace level="2" type="T">Code : 500</Trace>
<Trace level="2" type="T">Reason: Internal Server Error</Trace>
<Trace level="2" type="T">Code : 500</Trace>
<Trace level="2" type="T">Reason: Internal Server Error</Trace>
</Trace>
</Trace>
-Teresa -
Hai All,
Is there any option to add header fields dynamically in the HTTp adapter header fields?
I am doing a file to HTTp scenario.In this i have to pick a file using file adapter and add some header values(header values are both static and dynamic)and using HTTP adapter place it at a target URL.Is it possible to avoid mapping since there is only picking up of file and adding some headers to it.I can see header fields in the HTTP reseiver adapter.Can i use these to add the static and dynamiuc header fields.specifically i have two questions.
1)I want to include the source file name which is DYNAMIC as a field in the header fields in the target payload.How can this be achieved?Should i go for mapping and write a UDF for the same or is there any option to add dynamic values in the HTTP receiver adapter header fields?
2)what are these header fields for?
Can somebody explain it to me.I have gone through the Blogs like http receiver adapter configuration etc..would be of great help if anybody could explain it to me in detail.Thanks for the replies but my question is still un answered.please guide me on how to proceed?
I am going to send a txt file.On top of the contents of the file i want these headers to be attached
In the header fields of HTTP receiver adapter configuration can i give the following format?
Header Value
AS2 from: hgdfdjfhd
AS2 to: fhdfjdfdfnd
subject: hdsjdhsdsd
will it appear in the target file as
AS2 from: hgdfdjfhd
AS2 to: fhdfjdfdfnd
subject: hdsjdhsdsd
//file content starts here
dsgdsjfgdsfggf
hfdjhfdhfdjfdfhhdsfh
hgdsjfgdsjfgdfdgfdg
gfdsahdgsdfdgfgdsg
what is to be done for acheiving this kind of target file?
"If you choose to use HTTP Header fields then you can enter Field1 to Field 6 values. This will be embeded into the HTTP request as HeaderFieldOne and so on."
can this HeaderFieldOne to HeaderFieldsix be populated with any valueslike
AS2 from: ggdhfsdf and all?
please help me out. -
Hi,
Can anyone please explain meaning of "Header fields in HTTP adapter" ? It has "Name" and "Value" fields in the receiver HTTP channel.
If I enter values like:
Name Value
Source XYZ
Destination ABC
Where will these appear in outbound HTTP post ?
Also, is this different from "HTTP Header Fields" checkbox available in "Adapter specific message attributes" section ?
Thanks
Bhaven> Also, is this different from "HTTP Header Fields" checkbox available in "Adapter specific message attributes" section ?
You use this, when you want to have dynamic header fields. You put here a key, but instead of a value you put a parameter name, which can be filled with a value during mapping runtime.
Regards
Stefan
Maybe you are looking for
-
Tecra M4: TV s-video out does not work with Vista
I have windows vista ultimate on Tecra m4. I tried to get tv out through s-video but nothing happened. I tried fn+f5 but it shows only Lcd choice with no other choices. While it works good with windows xp tablet edition I installed the newest driver
-
No Network given for transaction 0020
While posting invoice (tcode MIRO) against PO, i am having error "No Network Given for transaction 0020". The PO is having account assignment "N" Network and 0020 is the activity number. Any idea how to resolve this. Regards, Shahzad Shakoor
-
Sigil, error and bug reporting
I finally got around to updating my desktop to Arch, I have been running my file and print servers with Arch and without problems for over a year. So far everything has gone pretty well, a few problems, mainly caused by me misstyping something, all p
-
Hi, Can anyone please explain the step by step configuration in XI to send an Idoc from R3 to a File in XI. Thanks in Advance.
-
I am attempting to install the free 60-day trial of LiveCycle ES4. It downloads all files into the temp folder. When I begin install I can see the English and Core files in same folder. Install reaches a certain point and then states it can't recogni