cancel
Showing results for 
Search instead for 
Did you mean: 

Paramter setting in URL in the case of HTTP receiver adapter

Former Member
0 Kudos

I have the following requirment: Can you anyone please help me how to define DATATYPE and configure in HTTP adapter:

The web page is developed in JSP page its body contains parameter(for example:<textarea name="xml" cols="70" rows="150" wrap="off">) to pass to the URL.

In this suitation,1) how can define my datatype in XI repository. ,Root element should be start with "xml" tag? 2). what are configuration parameters in HTTP receiver adapter.

3). Using HTTP post application.

Your response is highly appreciated.

Thanks

Venkat

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

check this web blog(/people/siva.maranani/blog/2005/09/15/push-data-to-mvc-architectured-application-using-xi).it hope it explains usage of http receiver adapter.

Thanks and Regards

kausik

Former Member
0 Kudos

Hi Venkat,

just send a message to XI.

Then have a look in SXMB_MONI -> Payload.

The payload is the input for designing your datatype!

Regards Mario

This html-coding will be useful:

<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=schmittf&sap-password=standard";

reqString = reqString + "&sap-client=" + document.MessageParameters.Client.value + "&sap-language=EN";

var xhttp = new ActiveXObject("msxml2.xmlhttp");

xhttp.open ("POST", reqString, false);

document.MessageParameters.URL.value=reqString;

if (document.MessageParameters.Source[0].checked == true) {

payload = 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><title> YourTitle</title></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="ABCXYZ" 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="100" 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="YOUR_SENDER_SERVICE" 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="YourSenderInterface" size="40" /> </td>

<td width="10%"><label>SenderNamespace</label> </td>

<td width="22%">

<input type="text" id="senderNamespace"

name="SenderNamespace" value="YourNameSpace"

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

<?xml version="1.0" encoding="UTF-8"?>

<ns0:AAABBBCCCxmlns:ns0="YourNamespace">

<row>

<FIELD1>Create</FIELD1>

<FIELD2>Create</FIELD2>

</row>

</ns0:MT_Event_Table_Result_NON_SAP_UPPERCASE>

</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 align="left">Result</h4>

<p align="left">URL: <textarea rows="2" name="URL" cols="104"></textarea></p>

<p align="left">&nbsp;</p>

<tbody>

<tr>

<td width="50%"><textarea name="response" rows="5" cols="60"></textarea></td>

</tr>

</tbody>

</table>

</form>

</body>

</html>

Former Member
0 Kudos

Venkat,

You can use the code posted by Mario. It acts as a HTTP client. Just change the User and password name to match your XI server UserId and password.

Regards,

Jai Shankar.

Former Member
0 Kudos

Thank you,

But my actual requirement is to send the Total XML(output of mapping) as paramter value to HTTP url.

How can do that?

1. I did JAVA mapping to convert total XML into string format, but in XI , it is failing..

2. It is required to change the first line in the payload.

Bottom line , how to change the XML payload before sending to HTTP page(before calling HTTP adapter).

Thanks

Venkat

former_member206604
Active Contributor
0 Kudos

Hi,

Have a look at the Receiver HTTP adapter Adapter Specifiy Message attributes.

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

<i>If you want to use an HTTP destination or URL set by the mapping, set the URL or HTTP Destination indicator. (The indicator displayed depends on the Addressing Type you selected above). If you set the indicator, the URL or HTTP destination set dynamically is called by HTTP.</i>

Also have a look at the Header fields in the Adapter Specific Message attributes as its not a good practice in sending the data in query string ans hope you are aware of size limitation of data passed thru query string. Again it depesds on the scenario.

Thanks,

Prakash

Former Member
0 Kudos

Hi ,

Just see the parameters which I have used in this thread...<b>PATH means Query string of the URL</b>

Sekhar