Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem building a synchronous web service in XI 3.0

The scenario: HTTP Client on my desktop <-> XI 3.0 Plain

HTTP Adapter <-> XI 3.0 RFC Adapter -> RFC enabled

function module in a 4.6C backend system

I have been testing this interface with different tools.

Below list the testings I have done and the results.

1. Using an HTTP client with QoS=Exactly Once: The HTTP

client HTML code is attached. If I run this client with

QoS = Exactly Once, the client receives successful return

code 200 and the request does go into the backend system.

But no response payload comes back to the client. Looking

into the XI message monitoring, I could see the request

message but there is no response message.

2. Using the HTTP client with QoS=Best Effort: If I run

this client with QoS = Best Effort, the client receives

successful return code 200 with the response payload

having value 1 (wrong value) in the response data field,

but the request has never reached XI. Looking into the XI

message monitoring, I could not find the request message.

3. Using the Test Message tab of the integration engine

under component monitoring in RWB with QoS=Exactly Once:

After sent the test tool shows a Message sent with a

green light. The message has reached XI and the backend

system. A response message is also found in XI but it

says "Acknowledgement not possible".

4. Using the Test Message tab of the integration engine

under component monitoring in RWB with QoS=Best Effort:

After sent the test tool shows a Message sent with a

green light. But no message can be found in XI message

monitoring for this request.

I could not find much discussion on using the plain HTTP

adapter. Not sure what I did wrong and how I can

troubleshoot. The HTTP client HTML code is attached below

if you like to give it a try. Any hint or pointer to

related discussion will be very appreciated.


<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 + "&queueid=httpclient";
 
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;
result = result + "nhttp-Status:  " + xhttp.status + " " + xhttp.statusText + " nPayload: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>Server Host</label> </td>
<td width="22%">
 
<!-- Change server and port here -->
 
<input type="text" id="host" name="Server" 
value="YourServer" size="20"/> </td>
<td width="10%"><label>Server Port</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%">
 
<!-- Change client here -->
 
<input type="text" id="client" name="Client" 
value="100" size="3"/></td>
<td width="10%"> </td>
<td width="22%"> </td>
</tr>
<tr>
<td width="10%"><label>Sender Service</label> </td>
<td width="22%">
 
<!-- Change sender service here -->
 
<input type="text" id="senderService" 
name="SenderService" value="TravelAgencyCS" size="40"/> </td>
<td width="10%">Quality of Service</td>
<td width="22%">
      <select size="1" name="qos">
      <option value="BE">Best Effort (synchronous)</option>
      <option value="EO" selected>Exactly Once (asynchronous)</option>
      <option value="EOIO">Exactly Once in Order</option>
      </select>
</td>
</tr>
<tr>
<td width="10%"><label>Sender Interface</label> </td>
<td width="22%"><input type="text" id="senderInterface" 
name="SenderInterface" value="BookingOrdersOut" size="40"/> </td>
<td width="10%"><label>Sender Namespace</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>
<br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<h4>Optional Parameters</h4>
<tbody>
<tr>
<td width="10%">Sender Party</td>
<td width="22%"><input type="text" id="senderParty" name="SenderParty" 
size="40"/> </td>
</tr>
<tr>
<td width="10%">Sender Agency</td>
<td width="22%"><input type="text" id="senderAgency" name="SenderAgency" 
size="40"/> </td>
<td width="10%">Sender Scheme</td>
<td width="22%"><input type="text" id="senderScheme" name="SenderScheme" 
size="40"/> </td>
</tr>
</tbody>
</table>
<br>
<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"><a>test</a></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>

Former Member
Not what you were looking for? View more on this topic or Ask a question