Skip to Content
author's profile photo Former Member
Former Member

HTML(HTTP adapter)->SAP XI ->File (File adapter)

HTTP Sender to File

Posted: Apr 27, 2006 10:48 AM Reply E-mail this post

Hi all!

I have a scenario like this:

HTML page(http adapter)->SAP XI->(File Adapter)D:\somedir

I will send a file from some HTML page, for that iam using HTTP sender adapter.It will reach to SAP XI. From there i will post the file to some physical location in my machine. For this am using File adapter.

I am unable to find the xml file i send HTML form in my targer directory.

Please help me!

Add comment
10|10000 characters needed characters exceeded

3 Answers

  • Posted on Apr 28, 2006 at 09:03 AM

    Hi Satish,

    i can give you an XML Requestor written in HTML. You can send with it XML message to HTTP adapter of XI. Take it for testing and as example for your task.

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

    Regards,

    Udo

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 28, 2006 at 09:17 AM

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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 28, 2006 at 01:46 PM

    Hi Satish,

    Please use SXMB_MONI to ensure that you have done the configuration correctly. Remember to update the cache also.

    Please also check adapter messages and Message monitoring to ensure that no errors are logged.

    Feel free to get back if this does not solve your problem,

    Gaurav

    Add comment
    10|10000 characters needed characters exceeded