cancel
Showing results for 
Search instead for 
Did you mean: 

Using a HTTP client to connect to XI

Former Member
0 Kudos

Hi All,

I need to configure a http client that sends request to my XI server. XI will send this data to R/3 and pick some data from there. This response has to be sent to my http client.

Can I use a html page for this scenario as my http client?

If this can be done what is the port number I need to give in the html (Is it the http port to connect Integration Server like <8xxx>)?

Also how can I design my datatype for this scenario?

Any inputs on this will be of great help.

Thanks & Regards,

Jai Shankar.

Accepted Solutions (1)

Accepted Solutions (1)

udo_martens
Active Contributor
0 Kudos

Hi Jai,

>Can I use a html page for this scenario as my http client?

Yes, here a example:

<html>
 
<script type="text/javascript">;
<!--
function button1_onclick() {
var result = "Result: ";
var payload = "<?xml version="1.0" encoding="UTF-8" ?>"; 
// escape "http://"
var senderNamespace = escape(document.MessageParameters.SenderNamespace.value);
 
var reqString = "http://"
reqString = reqString + document.MessageParameters.Server.value+":";
reqString = reqString + document.MessageParameters.Port.value + "/sap/xi/adapter_plain?";
reqString = reqString + "namespace=" + senderNamespace;
reqString = reqString + "&interface=" + document.MessageParameters.SenderInterface.value;
reqString = reqString + "&service=" + document.MessageParameters.SenderService.value;
reqString = reqString + "&party=" + document.MessageParameters.SenderParty.value;
reqString = reqString + "&agency=" + document.MessageParameters.SenderAgency.value;
reqString = reqString + "&scheme=" + document.MessageParameters.SenderScheme.value;
reqString = reqString + "&QOS=" + document.MessageParameters.Qos.value;
reqString = reqString + "&sap-user=xiappluser&sap-password=xipass";
reqString = reqString + "&sap-client=" + document.MessageParameters.Client.value + "&sap-language=D";
 
var xhttp = new ActiveXObject("msxml2.xmlhttp"); 
xhttp.open ("POST", reqString, false);
 
if (document.MessageParameters.Source[0].checked == true) {
payload = "<?xml version="1.0" encoding="UTF-8" ?> "+ document.MessageParameters.xmlData.value;
xhttp.send (payload); 
}
else{
var xmlDoc = new ActiveXObject("microsoft.xmldom");
xmlDoc.async=false;
xmlDoc.load (document.MessageParameters.xmlFile.value);
xhttp.send (xmlDoc); 
}
result = result + "n" + xhttp.responseText;
xhttp.close;
document.MessageParameters.response.value=result;
}
//-->
</script>
<head></head>
 
<body>
 
<h3>Client Http Adapter </h3>
<form name="MessageParameters">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<h4>Header</h4>
<tbody>
<tr>
<td width="10%"><label>ServerHost</label> </td>
<td width="22%">
<input type="text" id="host" name="Server" 
value="sapcoe01" size="20"/> </td>
<td width="10%"><label>ServerPort</label> </td>
<td width="22%"><input type="text" id="port" name="Port" value="8000" size="10"/> </td>
</tr>
<tr>
<td width="10%">Client</td>
<td width="22%">
<input type="text" id="client" name="Client" 
value="020" size="3"/></td>
<td width="10%"> </td>
<td width="22%"> </td>
</tr>
<tr>
<td width="10%"><label>SenderService</label> </td>
<td width="22%"><input type="text" id="senderService" 
name="SenderService" value="TravelAgencyCS" size="40"/> </td>
<td width="10%">QOS</td>
<td width="22%"><input type="text" id="qos" name="Qos" value="EO" size="4"/> </td>
</tr>
<tr>
<td width="10%"><label>SenderInterface</label> </td>
<td width="22%"><input type="text" id="senderInterface" 
name="SenderInterface" value="BookingOrdersOut" size="40"/> </td>
<td width="10%"><label>SenderNamespace</label> </td>
<td width="22%">
<input type="text" id="senderNamespace" 
name="SenderNamespace" value="http://sap.com/xi/rkt/CaseStudy/group99" 
size="40"/></td>
</tr>
</tbody>
</table>
 
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<h4>Optional Parameters</h4>
<tbody>
<tr>
<td width="10%">SenderParty</td>
<td width="22%"><input type="text" id="senderParty" name="SenderParty" 
size="40"/> </td>
</tr>
<tr>
<td width="10%">SenderAgency</td>
<td width="22%"><input type="text" id="senderAgency" name="SenderAgency" 
size="40"/> </td>
<td width="10%">SenderScheme</td>
<td width="22%"><input type="text" id="senderScheme" name="SenderScheme" 
size="40"/> </td>
</tr>
</tbody>
</table>
 
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<h4>Payload</h4>
<tbody>
<tr>
<fieldset style="padding: 2">
<td width="50%"><input type="radio" name="Source" value="Textarea" checked="checked"/>Type in XML</td>
<td width="50%"><input type="radio" name="Source" value="File"/>Upload File</td>
</fieldset>
</tr>
<tr>
<td width="50%"><textarea name="xmlData" rows="10" cols="60">&lt;a&gt;test&lt;/a&gt;</textarea></td>
<td width="50%"><input type="file" name="xmlFile" size="40"/> </td>
</tr>
</tbody>
</table>
<p>
<input type="button" value="Send" id="button1" name="button1" LANGUAGE="javascript" onclick="button1_onclick()"/>
</p>
<hr/>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<h4>Result</h4>
<tbody>
<tr>
<td width="50%"><textarea name="response" rows="5" cols="60"></textarea></td>
</tr>
</tbody>
</table>
</form>
 
</body>
 
</html>

what is the port number? usually 8000 - just try

Also how can I design my datatype for this scenario?

You need 4 datatypes: Request & Response for HTTP and for RFC or ABAP Proxy. If you use RFC then you create them in R/3 otherwise at XI. If you have a WAS system under your R/3 you should use proxies because of better performance and more stability.

Regards,

Udo

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Jai,

Look at this thread too.. Will be helpful..

/message/266750#266750 [original link is broken]

cheers,

Prashanth

P.S please mark helpful answers

Former Member
0 Kudos

Hi Jai,

For a HHTP -> XI -> FILE Scenario:

DESIGN:

1. Create DataTypes for source and Destinations. Create elements for all the text fields of your HTTP Client so that they can all be mapped into the destination file

2. Create MessageTypes for the two datatypes.

3. Create Message Interfaces. The One for HTTP is the sender, Asynchronous ( as no response is expected) and one for File is receiver, asynchronous.

4. Do the mapping. It will be mostly a one to one mapping of the fields.

5. Create the Interface Mapping.

Configuration:

1. Import your Business System under your Configuration Scenario.

2. Create 2 communication channels. One for Http as a sender and one for File as a receiver.

Check these links for the configuration part.

http://help.sap.com/saphelp_nw04/helpdata/en/43/64db4daf9f30b4e10000000a11466f/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/44/79973cc73af456e10000000a114084/content.htm

3. Do the Receiver Agreement for file. HTTP doesn’t need a sender agreement.

4. DO the Receiver Determination and Interface Determination.

Weblog which talk about the same scenario:-

/people/sriram.vasudevan3/blog/2005/01/11/demonstrating-use-of-synchronous-asynchronous-bridge-to-integrate-synchronous-and-asynchronous-systems-using-ccbpm-in-sap-xi - although this weblog is

aimed at explaining the sync-async bridge.. Sriram has taken http-to-file scenario as the example

(use case) and explained it...

Check this SDN tv demo, it has detail of HTTP adapter setup.

https://media.sdn.sap.com/SDNTV/main.asp?mediaId=107

Refer to this link for adapter settings.

http://help.sap.com/saphelp_nw04/helpdata/en/0d/5ab43b274a960de10000000a114084/frameset.htm

You should also have a HTTP client to send message to XI. In the connecting parameters to XI u have to use the URL in the pattern mentioned . U have to give all the configuration details in the URL.

Regards,

Abhy

Former Member
0 Kudos

Hi Jai,

If you give me your mail id or if you can mail me at abhy.thomas@wipro.com, i can send you a HTTP CLIENT.....In which you need to view the source code and change the username and password to send message to XI.

Regards,

Abhy

Former Member
0 Kudos

Hi Abhy,

My id is jaishankar.ramakrishnan@caritor.com

Pls send the docs to my id.

Thanks & Regards,

Jai Shankar.

bhavesh_kantilal
Active Contributor
0 Kudos

Jai,

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/66dadc6e-0a01-0010-9ea9-bb6...

This document should address the HTTP client info you need.

Regards,

bhavesh

bhavesh_kantilal
Active Contributor
0 Kudos

Jai,

For a HTTP --- RFC , this is what you will be doing in your IR,

1. Import the RFC.

2. Create a Datatype , Message Type for the Request message and Response message for HTTP. Create message interface Synchronous Ountbound for HTTP

3. Do 2 message mappings . One HTTP and RFC request and another between RFC response and HTTP response.

3. Create one Interface mapping.

The Confiugration Scenario will be similar to any other scenaio, Receiver Determiantion, Interface determiantion and Receiver Agreeement.

Note , you do need a Sender HTTP adapter as HTTP adapter interacts directly with the Integrationm Engine.

Regards,

Bhavesh

Former Member
0 Kudos

Hi Jai,

I guess you got my mail with the HTTP Client by now. I am sure it clearly explains the changes you have to do before using it.

Regards,

Abhy

Former Member
0 Kudos

Hi All,

Thanks a lot for all your help. I can try with these clients to connect to my XI server.

I l get back to you if I have any problems in that.

Thanks again.

Regards,

Jai Shankar.