on 05-07-2010 6:40 AM
Hi All,
Can you please let me know how to call a HTTP Post method in ABAP or XI?
my HTTP Post is looks like (HTML form)
<form action="http://111.111.111.1:8080/sample_url" method="POST">
<table>
<tr><th>applicationId</th><td><input type="text" name="applicationId" value="test"></td></tr>
<tr><th>authCode</th><td><input type="text" name="authCode" value="test"></td></tr>
<tr><th>message</th><td><input type="text" name="message" value="Hello"></td></tr>
<!--<tr><th>version</th><td><input type="text" name="version" value="3.1"></td></tr> -->
<tr><th>contractId</th><td><input type="text" name="contractId" value="test"></td></tr>
<tr><th>receiverMobileNumber</th><td><input type="text" name="receiver" value="11111111111"></td></tr>
<tr><td colspan="2"><input type="submit" name="send" value="send"></td></tr>
</table>
</form>
I have a requirement to send a message to the above mention URL using the POST method.
Please let me know the possibility of sending it from ABAP or XI adaptor.
Thanks & Regards,
Chaminda
Create an http receive adapter and provide the below url details as host, port and path prefix there. Create any sender side scenario and send test message. HTTP adapter performs the Post call.
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prateek,
shoul we send the below code as the payload?
<tr><th>applicationId</th><td><input type="text" name="applicationId" value="test"></td></tr>
<tr><th>authCode</th><td><input type="text" name="authCode" value="test"></td></tr>
<tr><th>message</th><td><input type="text" name="message" value="Hello"></td></tr>
<!--<tr><th>version</th><td><input type="text" name="version" value="3.1"></td></tr> -->
<tr><th>contractId</th><td><input type="text" name="contractId" value="test"></td></tr>
<tr><th>receiverMobileNumber</th><td><input type="text" name="receiver" value="11111111111"></td></tr>
Thanks.
Chaminda
this is my payload
<?xml version="1.0" encoding="UTF-8" ?>
- <ns1:MT_PM_FAE_RFC_HTTP_RCV xmlns:ns1="http://pm_fae_rfc_http">
<authCode>test</authCode>
<applicationId>test</applicationId>
<contractId>syn_test</contractId>
<version>3.1</version>
<message>tes</message>
<receiverMobileNumber>111111111</receiverMobileNumber>
</ns1:MT_PM_FAE_RFC_HTTP_RCV>
but i got error message .
"com.sap.aii.utilxi.misc.api.BaseRuntimeException:Content is not allowed in prolog"
Can you please explain this.
XML is not valid for form data.
You have to create the whole stream of the HTTP call in a Java mapping proram.
It is a text based call.
Hi Prateek
this is the operational mapping test message result.
<?xml version="1.0" encoding="UTF-8"?>
<ns1:MT_PM_FAE_RFC_HTTP_RCV xmlns:ns1="http://pm_fae_rfc_http">
<authCode>test</authCode>
<applicationId>stest</applicationId>
<contractId>SYNC</contractId>
<version>3.1</version>
<message>1111</message>
<receiverMobileNumber>111</receiverMobileNumber>
</ns1:MT_PM_FAE_RFC_HTTP_RCV>
is this correct ? or do i need to set something to "prolog"?
chaminda
First of all you need the whole HTTP stream of the post. You can use an HTTP sniffer for this.
When you have the stream, build the same with a Java mapping program.
This is not an easy task.
Maybe you can convince the owner of the scenario to provide a web service instead.
HTTP forms are though for human interaction, not for system integration, though it is often used for it.
User | Count |
---|---|
80 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.