cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP receiver problem

Former Member
0 Kudos

hi all,

though some of u replied to my previous post regarding http receiver, i'm unable to find a solution for it....so if possible please send me a few snapshots of how a HTTP receiver is configured and a sample jsp program for accesing the payload sent by xi......

the scenario is http>xi->http..the thing is

1)xi gets the input from a web page..this is successfully done.

2)xi does the mapping...this is also successfully done..

3)xi send the mapping result to the http adapter.....problem with configuration i think...i want xi to send the payload to http://sysname:port/virtual-dir/x.jsp .... when it is the case i get some no-mapping error......and i would like to know in what parameter name the payload is fixed in the query string to that url so that i could get it in jsp page a request.getParameter("parametername")......

please do help me in it..i'm struck with it for a long time........thanks in advance...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi vishnu,

thanx for the reply......

but i tried the same code in the sender html page......the thing is the data we send to xi is done using this code......i wanna get data from the xi......will u tell in which format the http payload comes from xi....i saw in help.sap.com but the thing i wanted to know is

==>i have specified the url like this in the receiver http adapter http://mac12:8080/xi/rx.jsp

==>i have specified the prolog in the text box meant for it as given in sap i.e &cmd=y&loadXML=

==>i want to know how the xi interprets the url....whether it gives url as http://mac12:8080/xi/rx.jsp or http://mac12:8080/xi/rx.jsp?cmd=y&loadmXML=<xmldata>;

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi SPS,

Check this link

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

code attached here

sample html code

<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%">&nbsp;</td>

<td width="22%">&nbsp;</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>

&#160;

<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>

&#160;

<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>

the code in that uses an Active X object, but if you can align your JSP code to receive the response in similar way, then probably your prob is solved,

Best of luck

Regards

Vishnu