HTTP POST from ECC 6.0 to XI

On ECC 6.0, I have an XMLstring that I need to post to an external URL.  I need this to go through XI.  It is actually an HTTPS post.  How can this be accomplished?  Can anyone point me in the right direction as far as how this would work in XI?  Here is a smippet of code on ECC
CALL METHOD cl_http_client=>create
    EXPORTING
      host          = POST_HOST
      service       = '443'
      scheme        = '2'
      ssl_id        = 'ANONYM'
   proxy_host    =  wf_proxy
   proxy_service =  wf_port
    IMPORTING
      client        = http_client.
  http_client->propertytype_logon_popup = http_client->co_disabled.
  wf_user = '' .
  wf_password = '' .
proxy server authentication
  CALL METHOD http_client->authenticate
    EXPORTING
      proxy_authentication = 'X'
      username             = wf_user
      password             = wf_password.
  CALL METHOD http_client->request->set_header_field
    EXPORTING
      name  = '~request_method'
      value = 'POST'.
  CALL METHOD http_client->request->set_header_field
    EXPORTING
      name  = '~request_protocol'
      value = 'HTTPS/1.0'.
  CALL METHOD http_client->request->set_header_field
    EXPORTING
      name  = 'HOST'
      value = POST_HOST.
  CALL METHOD http_client->request->set_header_field
    EXPORTING
      name  = '~request_uri'
      value = L_POST_URI.
  CALL METHOD http_client->request->set_header_field
    EXPORTING
      name  = 'Content-Type'
      value = 'text/xml; charset=utf-8'.
  CALL METHOD http_client->request->set_header_field
    EXPORTING
      name  = 'Content-Length'
      value = txlen.

Hi Tony,
You need to go through multiple steps.
1) Creation of Scenario in XI ( Integration Repository)
     First create datatype which will represent the data that is to be passed to URL. Then message type, message interface, message mapping, Interface mapping.
2) Creation of Directory scenario ( Integration Directory)
     Need to create Communication channel using either SOAP adapter or HTTP adapter as you need to pass the data to url.
3) Proxy:
   Once you create first step then structure will be available in proxy ( SPROXY transaction) . There you will need to call method for outbound proxy.
For above mentioned steps you can search in SDN which will guide you to multiple helping thread.

Similar Messages

  • Http post from an application with file attachment

    Hi ! I didn't know where else to post this message...
    I'm trying to make a HTTP POST from an application and upload a file with it. I have no problems with the posting, just that I haven't got any ideas how to get the file uploaded as well. I've been reading loads of examples regarding the topic, and searching older posts the forum here, without any help.
    Here's the method i'm using:
                   // open connections
                  URL url = new URL ("TheURL");
                   URLConnection urlConn = url.openConnection();
                              // We do input & output, without caching
                   urlConn.setDoInput (true);
                   urlConn.setDoOutput (true);
                   urlConn.setUseCaches (false);
                              // multipart/form-data because we want to upload a file
                     urlConn.setRequestProperty ("Content-Type", "multipart/form-data");
                  // Open output stream
                     DataOutputStream printout = new DataOutputStream (urlConn.getOutputStream ());
                  // Set the actual content
                     String content = "upfile=" + System.getProperty("user.dir") + "\\file.ext&";
                       content += "other_key-value_pairs";
                  // write the data to stream, and flush it.
                     printout.writeBytes (URLEncoder.encode(content));
                   printout.flush ();
                   printout.close ();
                   // Get the response.
                     DataInputStream input = new DataInputStream (urlConn.getInputStream());
                   FileOutputStream fos=new FileOutputStream("postto.txt");
                   String str;
                     BufferedReader bufr = new BufferedReader(new InputStreamReader(input));
                  // Write response to outputfile
                     while (null != ((str = bufr.readLine()))) {
                         if (str.length() >0) {
                         fos.write(str.getBytes());
                         fos.write(new String("\n").getBytes());
                   input.close ();Now, the response here I get from the url i'm posting to is "Failure, no data-file". I've tried many diff methods of writing the file to the stream, but always get the same result.
    I need to file attached like it would be when using a HTML form's <input type="file">.
    Please help ! This is getting really urgent !

    String content = "upfile=" + System.getProperty("user.dir") + "\\file.ext&";
    content += "other_key-value_pairs";
    printout.writeBytes (URLEncoder.encode(content));
    printout.flush ();
    printout.close ();Actually, what this does is create a request like:
    GET /path/to/file/script.language?upfile=/home/user/file.ext&other=params HTTP/1.1
    Content-Type: multipart/form-data
    -- And other HTTP params --
    The file is not actually appended to the request.
    I really don't know how Java handles the file upload, but you could do it by hand, like so:
    public static void doFileUpload(String url, String filename, Hashtable params) throws IOException {
        // Construct the request
        String boundary = "----------------------mUlTiPaRtBoUnDaRy";
        String request_head = "POST " + url + " HTTP/1.0\r\n" +
                                         "Content-type: multipart/form-data; boundary=" + boundary + "\r\n";
        String request_body = boundary + "\r\n\r\nContent-disposition: form-data; name=\"upload\"" +
                                         "\r\n\r\n";
        BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
        int b = -1;
        while((b = in.read()) != -1) {
             request_body += (char)b;
        in.close();
        Enumeration keys = params.keys();
        while(keys.hasMoreElements()) {
            String key = keys.nextElement();
            requst_body += "\r\n" + boundary + "\r\n\r\nContent-type: form-data; name=\"key\"\r\n" +
                                    (String)params.get(key);
        request_body += "\r\n" + boundary + "--\r\n";
        int length = request_head.length() + request_body.length() + "Content-length: \r\n";
        String req_length = "Content-length: " + (length + new String("" + length).length()) + "\r\n";
        Socket socket = new Socket(url,80);
        PrintStream stream = socket.getOutputStream();
        stream.print(request_head + req_length + req_body);
        // And now an option to read the response, I will omit that...   
    }Note: I have not tested this code, just wrote it up out of memory. If it does not work, it will propably need some small fixes.
    Tuomas Rinta

  • Not able to send message - http post from MII 12.1.4.53 to PI 7.1

    Hi ,
    Question
    u2022     Is there any configuration to set up in MII and PI to do posting to PI as a web service? If YES, please guide.
    Situation
    u2022     We are with MII version 12.1.4.53 and trying to send message through http post to PI 7.1 server.
    u2022     We are getting the following error HTTP 500 Internal Error Issue.
    u2022     However we are able to post messages from SOAPUI through the same URL and with the MII system which is running on version 12.1.6.91 and 12.1.9.116
    u2022     HTTP Response received as below points to PI Configuration issue.
    Error
        <SOAP:Fault>
          <faultcode>SOAP:Server</faultcode>
          <faultstring>Server Error</faultstring>
          <detail>
            <s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">
              <context>XIAdapter</context>
              <code>ADAPTER.JAVA_EXCEPTION</code>
              <text><![CDATA[
    com.sap.aii.af.service.cpa.CPAObjectNotFoundException: Couldn't retrieve inbound binding for the given P/S/A values: FP=senderService;TP=;FS=null;TS=;AN=null;ANS=null;
    thanks
    Rajesh

    Hi Anudeep,
    The question isNOT ABOUT the format of the URL which MII should use.
    Using the same URL we are able to post the message from other MII versions with in the landscape( MII version 12.1.6 and MII version12.1.9) and through SOAP UI.
    500 Internal server error Problem arises when the message is sent through the same URL from MII 12,1.4 Build(53) to PI 7.1 ( we tried https Post, XI Webservice, WebService action blocks)
    Question:
    Are thre any configuration settings specific to MII version12.1.4 Build 53 which needds to be set in MII to communicate to PI 7.1.
    Thanks
    Rajesh

  • Manual HTTP POST from ABAP

    I'm trying to use a kind of botched web service implementation that doesn't come with a WSDL file - so, no generated proxy for me to use. It also needs me to send an XML file via an HTTP POST - not in a SOAP envelope. This presents a problem for me - understandably, this isn't part of WebAS 6.40's web services stuff.
    Does anyone know of a way of manually posting something via HTTP in ABAP? I'm sure there must be some function module or class that exposes that functionality - I just can't find it! Any ideas anyone?

    Hi,
    You can get some idea from following code for your requirment
    DATA: WA_DATA TYPE TSRCLIN,
          WA_RESULT TYPE TY_XML,
          WA_INV_REP TYPE TY_INV_REP,
          T_INV_REP TYPE TABLE OF TY_INV_REP,
          WA_ICA_REC_REP TYPE TY_ICA_REC_REP,
          T_ICA_REC_REP TYPE TABLE OF TY_ICA_REC_REP,
          T_RESULT TYPE T_XML,
          SOURCE_ITAB TYPE ABAP_TRANS_SRCBIND_TAB,
          SOURCE_WA   TYPE ABAP_TRANS_SRCBIND,
          WA_ZTICAUSER TYPE ZTICAUSER.
    DATA: XSLTP TYPE REF TO CL_XSLT_PROCESSOR,
          G_IXML TYPE REF TO IF_IXML,
          G_STREAM_FACTORY TYPE REF TO IF_IXML_STREAM_FACTORY,
          G_ENCODING TYPE REF TO IF_IXML_ENCODING,
          RESSTR TYPE REF TO IF_IXML_OSTREAM,
          HTTP_CLIENT TYPE REF TO IF_HTTP_CLIENT .
    DATA: SURL TYPE STRING.
    DATA: WF_PROXY TYPE STRING ,
          WF_PORT TYPE STRING,
          WF_USER TYPE STRING,
          WF_PASSWORD TYPE STRING,
          RLENGTH TYPE I,
          R_CODE TYPE SY-SUBRC,
          USERID1 TYPE CHAR32.
    CONSTANTS: ENCODING     TYPE STRING VALUE 'UTF-8',
               C_COMMA(1)               VALUE ',',
               C_AP(2)                  VALUE 'AP',
               C_AR(2)                  VALUE 'AR',
               C_CF(2)                  VALUE 'CF',
        CONV->READ( IMPORTING DATA = XMLSTRING LEN = LEN ).
        SPLIT XMLSTRING AT CL_ABAP_CHAR_UTILITIES=>CR_LF INTO TABLE T_DATA.
    * Read Header Information
        READ TABLE T_DATA INDEX 1 INTO WA_DATA.
        SPLIT WA_DATA AT C_COMMA INTO DUMMY SOURCE_SYSTEM_ID DUMMY1.
        TRANSLATE DUMMY TO UPPER CASE.
        CONDENSE DUMMY.
        IF DUMMY <> 'SOURCE SYSTEM ID' OR SOURCE_SYSTEM_ID IS INITIAL.
          STRERROR = C_ERROR6.
        ELSE.
          DELETE T_DATA INDEX 1.
        ENDIF.
        CHECK STRERROR IS INITIAL.
        READ TABLE T_DATA INDEX 1 INTO WA_DATA.
        SPLIT WA_DATA AT C_COMMA INTO DUMMY DATE DUMMY1.
        TRANSLATE DUMMY TO UPPER CASE.
        CONDENSE DUMMY.
        IF DUMMY <> 'DATE' OR DATE IS INITIAL.
          STRERROR = C_ERROR6.
        ELSE.
          DELETE T_DATA INDEX 1.
        ENDIF.
        CHECK STRERROR IS INITIAL.
        READ TABLE T_DATA INDEX 1 INTO WA_DATA.
        SPLIT WA_DATA AT C_COMMA INTO DUMMY TIME DUMMY1.
        TRANSLATE DUMMY TO UPPER CASE.
        CONDENSE DUMMY.
        IF DUMMY <> 'TIME' OR TIME IS INITIAL.
          STRERROR = C_ERROR6.
        ELSE.
          DELETE T_DATA INDEX 1.
        ENDIF.
        CHECK STRERROR IS INITIAL.
        READ TABLE T_DATA INDEX 1 INTO WA_DATA.
        SPLIT WA_DATA AT C_COMMA INTO DUMMY CREATED_BY DUMMY1.
        TRANSLATE DUMMY TO UPPER CASE.
        CONDENSE DUMMY.
        IF DUMMY <> 'CREATED BY' OR CREATED_BY IS INITIAL.
          STRERROR = C_ERROR6.
        ELSE.
          DELETE T_DATA INDEX 1.
        ENDIF.
        CHECK STRERROR IS INITIAL.
        READ TABLE T_DATA INDEX 1 INTO WA_DATA.
        SPLIT WA_DATA AT C_COMMA INTO DUMMY TYPE DUMMY1.
        TRANSLATE DUMMY TO UPPER CASE.
        CONDENSE DUMMY.
        IF DUMMY <> 'TYPE' OR TYPE IS INITIAL.
          STRERROR = C_ERROR6.
        ELSE.
          CONDENSE TYPE.
          L_TYPE1 = REPGRP.
          L_TYPE2 = TYPE.
          TRANSLATE L_TYPE1 TO UPPER CASE.
          CONDENSE L_TYPE1.
          TRANSLATE L_TYPE2 TO UPPER CASE.
          CONDENSE L_TYPE2.
          IF L_TYPE1 NE L_TYPE2.
            IF L_TYPE2 = C_AP.
              CONCATENATE C_ERROR1_AP C_ERROR1
                          INTO STRERROR SEPARATED BY SPACE.
            ELSEIF L_TYPE2 = C_AR.
              CONCATENATE C_ERROR1_AR C_ERROR1
                          INTO STRERROR SEPARATED BY SPACE.
            ELSEIF L_TYPE2 = C_CF.
              CONCATENATE C_ERROR1_CF C_ERROR1
                          INTO STRERROR SEPARATED BY SPACE.
            ENDIF.
          ENDIF.
          DELETE T_DATA INDEX 1.
        ENDIF.
        CHECK STRERROR IS INITIAL.
        DELETE T_DATA INDEX 1.
        LOOP AT T_DATA INTO WA_DATA.
          SPLIT WA_DATA AT ',' INTO WA_RESULT-FITF
                                    WA_RESULT-COUNTERPARTYFITF
                                    WA_RESULT-FUCA
                                    WA_RESULT-COUNTERPARTYFUCA
                                    WA_RESULT-RECONCILIATIONACCOUNT
                                    WA_RESULT-INDICATORCUSTOMERVENDOR
                                    WA_RESULT-INVOICENUMBER
                                    WA_RESULT-DOCUMENTDATE
                                    WA_RESULT-POSTINGDATE
                                    WA_RESULT-DUEDATE
                                    WA_RESULT-INVOICEAMOUNT
                                    WA_RESULT-INVOICECURRENCY
                                    WA_RESULT-REPORTINGAMOUNT
                                    WA_RESULT-REPORTINGCURRENCY
                                    WA_RESULT-INDICATOR
                                    WA_RESULT-CREATIONDATE
                                    WA_RESULT-CLEARINGDATE.
    * Validation of the Structure.                               
          WA_RESULT-SOURCESYSTEM = SOURCE_SYSTEM_ID.
          APPEND WA_RESULT TO T_RESULT.
          WA_INV_REP-INVOICEREPORT = WA_RESULT.
          WA_ICA_REC_REP-ICARECONCILIATIONREPORT = WA_INV_REP.
          WA_ICA_REC_REP-REPGRP = REPGRP.
          WA_ICA_REC_REP-NAMESPACE = C_STR.
          APPEND WA_ICA_REC_REP TO T_ICA_REC_REP.
        ENDLOOP.
        TRY.
            CREATE OBJECT XSLTP.
          CATCH CX_XSLT_EXCEPTION.
        ENDTRY.
        G_IXML = CL_IXML=>CREATE( ).
        G_STREAM_FACTORY = G_IXML->CREATE_STREAM_FACTORY( ).
    ****Create an Endcoding and Byte Order
        G_ENCODING = G_IXML->CREATE_ENCODING( CHARACTER_SET = ENCODING
          BYTE_ORDER = 0 ).
    *****Create Output Stream
        RESSTR =
            G_STREAM_FACTORY->CREATE_OSTREAM_XSTRING( CONTENT ).
    ****Set the Encoding into a stream
        RESSTR->SET_ENCODING( ENCODING = G_ENCODING ).
    * Prepare for Transformation
        SOURCE_WA-NAME = 'BSPXML'.
        GET REFERENCE OF T_ICA_REC_REP INTO SOURCE_WA-VALUE.
        APPEND SOURCE_WA TO SOURCE_ITAB.
        CLEAR XMLSTRING.
        CALL TRANSFORMATION Z_BSP_XSLT
        SOURCE (SOURCE_ITAB)
        RESULT XML XMLSTRING.
        IF SY-SUBRC <> 0.
          STRERROR = C_ERROR3.
        ENDIF.
        DATA: X1 TYPE STRING,
              X2 TYPE STRING.
    * Change encoding from UTF-16 to UTF-8
        SPLIT XMLSTRING AT 'utf-16' INTO X1 X2.
        CLEAR XMLSTRING.
        CONCATENATE X1 'UTF-8' X2 INTO XMLSTRING.
        select single * into WA_ZTICAUSER
        from ZTICAUSER.
        if sy-subrc <> 0.
          clear WA_ZTICAUSER.
        endif.
    SURL = 'http://XXXXXYYYYY:8050/sap/xi/adapter_plain?'.
        CONCATENATE SURL
         'namespace=' 'http%3A//XXXX.com/corp/sapbw/fi/ica/xi111fn1'
                    '&interface=' 'IOA_ICA_ReconciliationReport'
                    '&service=' 'Send_ICA_ReconciliationReport'
                    '&party=' 'ICA_ManualUpload'
                    '&agency='
                    '&scheme='
                    '&QOS=EO&sap-user='  WA_ZTICAUSER-USERID
                    '&sap-password=' WA_ZTICAUSER-PTEXT
                    '&sap-client=' '060'
                    '&sap-language=EN'
                    INTO SURL.
    * Test of XML file.
    *    navigation->set_parameter( name = 'xmlstring'
    *                               value = xmlstring ).
    *    navigation->goto_page( 'XMLTest.xml' ).
    * Navigation Code
        RLENGTH = STRLEN( XMLSTRING ).
        CL_HTTP_CLIENT=>CREATE_BY_URL( EXPORTING URL    = SURL
                                   IMPORTING CLIENT = HTTP_CLIENT ).
        CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
          EXPORTING
            NAME  = 'Content-Type'
            VALUE = 'text/xml; charset=utf-8'.
        CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
          EXPORTING
            NAME  = '~request_method'
            VALUE = 'POST'.
        CALL METHOD HTTP_CLIENT->REQUEST->SET_CDATA
          EXPORTING
            DATA   = XMLSTRING
            OFFSET = 0
            LENGTH = RLENGTH.
        HTTP_CLIENT->SEND( ).
        HTTP_CLIENT->RECEIVE( ).
        HTTP_CLIENT->RESPONSE->GET_STATUS( IMPORTING CODE = RLENGTH ).
        XMLSTRING = HTTP_CLIENT->RESPONSE->GET_CDATA( ).
        HTTP_CLIENT->CLOSE( ).
        IF RLENGTH = '200'.
          STRERROR = C_SUCCESS.
    * Update the information into the Table
          TRANSLATE SOURCE_SYSTEM_ID TO UPPER CASE.
          CONDENSE SOURCE_SYSTEM_ID.
          USERID1 = USERID.
          TRANSLATE USERID1 TO UPPER CASE.
          CONDENSE USERID1.
          CALL FUNCTION 'ZFM_BSP_ICA_UPLOAD'
            EXPORTING
              IV_SOURCE      = SOURCE_SYSTEM_ID
              IV_USERID      = USERID1
              IV_TYPE        = TYPE
    *          IV_UPLOAD_DATE = SY-DATUM
    *          IV_UPLOAD_TIME = SY-UZEIT
            IMPORTING
              R_CODE         = R_CODE.
        ELSE.
          STRERROR = C_ERROR4.
        ENDIF.
      ENDIF.
    ENDIF.
    Message was edited by: Mandar Shete

  • HTTP POST from SAP to an external server

    Experts.
    I have a XML file encased in MIME and SOAP format. Essentially it's a .xml file.
    I need to post this to an external server (have the IP address and logon credentials) using http post functionality.
    Can this be accomplished in SAP using ABAP, Function module? I need to post the entire file.
    If anyone has done this, can you please post the steps needed?
    Thank you so much.
    Raj

    Hi Raj,
    a good starting point for you would be the SAP Help. [Here|http://help.sap.com/saphelp_nw04/helpdata/en/1f/93163f9959a808e10000000a114084/frameset.htm] is some sample code of how to make a HTTP call from ABAP.
    Cheers
    Graham Robbo
    Edited by: Graham Robinson on Oct 28, 2009 2:44 PM

  • HTTP POST FROM EXTERNAL SYSTEM TO SAP AII 4.0

    Hello.
        We are using SAP AII 4.0 and trying to post from the device controller to SAP AII. We are not clear about the format of the HTTP POST command. Could someone please provide an example of the HTTP POST command from the device controller to SAP AII. I am looking for the format of the HTTP POST command for all field such as port, IP address, etc.
        I am looking for a complete example.
      Thanks in advance for your help.
    Regards,
    Bob Berneck

    Hi Bob,
    Please check the following link for help
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/419e11e7-0801-0010-1e8f-9191ba03f1fc .
    Please check the help.sap.com link for help
    http://help.sap.com/saphelp_autoid40/helpdata/en/index.htm
    If you need some latest doc on AII and DC please mail me at [email protected] or let me know you mail ID
    Thanks N Regards
    Santosh
    Reward if helpful !!!

  • Invoking http post from BPEL is not passing parameters

    Hi,
    I have a simple BPEL process where I am trying to send an xml string in a request
    parameter to a servlet. Servlet is pretty simple. It just prints the request parameters and returns. But problem is that I am not getting any request
    parameters when I am using http post but everything works fine when using
    http get.
    Enclosed is the wsdl that I am using.
    Any information will be of great help
    Thanks
    Rajesh
    <?xml version="1.0" encoding="utf-8"?>
    <definitions
    targetNamespace="http://xmlns.oracle.com/OISService"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:client="http://xmlns.oracle.com/OISService"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    >
    <types>
    <xsd:schema elementFormDefault="qualified"
    targetNamespace="http://xmlns.oracle.com/OISService"
    xmlns="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="header">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="status" type="xsd:string"/>
    <xsd:element name="description" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="responsedata" type="xsd:string"/>
    </xsd:schema>
    </types>
    <message name="SendDataToOISRequestMessage">
    <part name="xmldata" element="client:responsedata"/>
    </message>
    <message name="SendDataToOISResponseMessage">
    <part name="payload" element="client:header"/>
    </message>
    <portType name="SendDataToOIS">
    <operation name="process">
    <input message="client:SendDataToOISRequestMessage"/>
    <output message="client:SendDataToOISResponseMessage"/>
    </operation>
    </portType>
    <binding name="SendDataToOIS" type="client:SendDataToOIS">
    <http:binding verb="POST"/>
    <operation name="process">
    <http:operation location="/Class1"/>
    <input>
    <mime:mimeXml part="xmldata"/>
    <mime:content type="text/xml"/>
    </input>
    <output>
    <mime:mimeXml part="payload"/>
    <mime:content type="text/xml"/>
    </output>
    </operation>
    </binding>
    <service name="SendDataTOOISService">
    <port name="SendDataToOIS" binding="client:SendDataToOIS">
    <http:address location="http://localhost:8888/j2ee/servlet"/>
    </port>
    </service>
    <plnk:partnerLinkType name="SendDataToOIS">
    <plnk:role name="SendDataToOISProvider">
    <plnk:portType name="client:SendDataToOIS"/>
    </plnk:role>
    </plnk:partnerLinkType>
    </definitions>

    In the bpel you can make a http-binding instead of the default soap-binding.
    Maybe this can help you making the call to the servlet/jsp.

  • HTTP post from ABAP using Object Oriented method

    Hi ,
    I want to call HTTP from ABAP. I came to know that using classes & objects is the best way to fulfill it.
    Interface:
    xml_document type ref to cl_xml_document
    method post_xml_document.
    data: client type ref to if_http_client,
    xml_response type ref to cl_xml_document.
    data: xml_string type string,
    xml_xstring type xstring.
    data: zsubrc type sy-subrc.
    cl_http_client=>create_by_url( exporting url = 'http://www.example.com/post-url.xml' importing client = client exceptions others = 1 ).
    client->request->set_header_field( exporting name = '~request_method' value = 'POST' ).
    client->request->set_header_field( exporting name = '~server_protocol' value = 'HTTP/1.1' ).
    client->request->set_header_field( exporting name = 'Content-Type' value = 'text/xml' ).
    xml_document->render_2_string( exporting pretty_print = 'X' importing stream = xml_string ).
    client->request->set_cdata( exporting data = xml_string offset = 0 ).
    client->authenticate( exporting proxy_authentication = space username = 'username' password = 'password' ).
    client->send( exceptions http_communication_failure = 1 http_invalid_state = 2 ).
    client->receive( exceptions http_communication_failure = 1 http_invalid_state = 2 http_processing_failed = 3 ).
    xml_xstring = client->response->get_data( ).
    zsubrc = xml_response->parse_xstring( stream = xml_xstring ).
    endmethod.
    Above code can be used to do my work.
    Apart from the code in ABAP, what are the configurational setting that we need to do ?
    Thanks,
    Shivaa..

    >
    mohammad afzal wrote:
    > apart from usin the code u should have configured the RFC destination
    Thats nonsense, create_by_url does not need an rfc connection. TA SICF is correct.

  • How to handle HTTP-POST encrypted data for ECC Using proxy or RFC

    I have a scenario HTTP-POST ->PI->ECC.sender is HTTP Post  send encrypted data i need to handle the data and stored in to SAP ECC  with out decrypt using PI .what should i take for receiver  can i use inbound proxy or RFC  and how can handle the encrypted data  for decrypt.
    Regards
    Ravi

    1. my sender is HTTP POST . what should i configure in sender communication channel in SAP PI .like SOAP or HTTP .What are the parameters i need to pass .
    >>>
    If you are on PI 7.3 and above, configure the HTTP AAE adapter - Configuring the Java HTTP Adapter on the Sender Channel - Advanced Adapter Engine - SAP Library
    2.while using inbound proxy for encrypted data  i need  store the data in to table , the same proxy can i call  another outbound  service for decrypt  same data.
    >>>>
    Yes you can always a proxy within a proxy.

  • HTTP post data from the Oracle database to another web server

    Hi ,
    I have searched the forum and the net on this. And yes I have followed the links
    http://awads.net/wp/2005/11/30/http-post-from-inside-oracle/
    http://manib.wordpress.com/2007/12/03/utl_http/
    and Eddie Awad's Blog on the same topic. I was successful in calling the servlet but I keep getting errors.
    I am using Oracle 10 g and My servlet is part of a ADF BC JSF application.
    My requirement is that I have blob table in another DB and our Oracle Forms application based on another DB has to view the documents . Viewing blobs over dblinks is not possible. So Option 1 is to call a procedure passing the doc_blob_id parameter and call the web server passing the parameters.
    The errors I am getting is:
    First the parameters passed returned null. and
    2. Since my servlet directly downloads the document on the response outputStream, gives this error.
    'com.evermind.server.http.HttpIOException: An established connection was aborted by the software in your host machine'
    Any help please. I am running out of time.
    Thanks

    user10264958 wrote:
    My requirement is that I have blob table in another DB and our Oracle Forms application based on another DB has to view the documents . Viewing blobs over dblinks is not possible. Incorrect. You can use remote LOBs via a database link. However, you cannot use a local LOB variable (called a LOB <i>locator</i>) to reference a remote LOB. A LOB variable/locator is a pointer - that pointer cannot reference a LOB that resides on a remote server. So simply do not use a LOB variable locally as it cannot reference a remote LOB.
    Instead provide a remote interface that can deal with that LOB remotely, dereference that pointer on the remote system, and pass the actual contents being pointed at, to the local database.
    The following demonstrates the basic approach. How one designs and implements the actual remote interface, need to be decided taking existing requirements into consideration. I simply used a very basic wrapper function.
    SQL> --// we create a database link to our own database as it is easier for demonstration purposes
    SQL> create database link remote_db connect to scott identified by tiger using
      2  '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=dev)(SERVER=dedicated)))';
    Database link created.
    SQL> --// we create a table with a CLOB that we will access via this db link
    SQL> create table xml_files( file_id number, xml_file clob );
    Table created.
    SQL> insert into xml_files values( 1, '<root><text>What do you want, universe?</text></root>' );
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> --// a local select against the table works fine
    SQL> select x.*, length(xml_file) as "SIZE" from xml_files x;
       FILE_ID XML_FILE                                                                                SIZE
             1 <root><text>What do you want, universe?</text></root>                                    53
    SQL> --// a remote select against the table fails as we cannot use remote pointers/locators
    SQL> select * from xml_files@remote_db x;
    ERROR:
    ORA-22992: cannot use LOB locators selected from remote tables
    no rows selected
    SQL> //-- we create an interface on the remote db to deal with the pointer for us
    SQL> create or replace function ReturnXMLFile( fileID number, offset integer, amount integer ) return varchar2 is
      2          buffer  varchar2(32767);
      3  begin
      4          select
      5                  DBMS_LOB.SubStr( x.xml_file, amount, offset )
      6                          into
      7                  buffer
      8          from    xml_files x
      9          where   x.file_id = fileID;
    10 
    11          return( buffer );
    12  end;
    13  /
    Function created.
    SQL> --// we now can access the contents of the remote LOB (only in 4000 char chunks using this example)
    SQL> select
      2          file_id,
      3          ReturnXMLFile@remote_db( x.file_id, 1, 4000 ) as "Chunk_1"
      4  from       xml_files@remote_db x;
       FILE_ID Chunk_1
             1 <root><text>What do you want, universe?</text></root>
    SQL> --// we can also copy the entire remote LOB across into a local LOB and use the local one
    SQL> declare
      2          c               clob;
      3          pos             integer;
      4          iterations      integer;
      5          buf             varchar2(20);   --// small buffer for demonstration purposes only
      6  begin
      7          DBMS_LOB.CreateTemporary( c, true );
      8 
      9          pos := 1;
    10          iterations := 1;
    11          loop
    12                  buf := ReturnXMLFile@remote_db( 1, pos, 20 );
    13                  exit when buf is null;
    14                  pos := pos + length(buf);
    15                  iterations := iterations + 1;
    16                  DBMS_LOB.WriteAppend( c, length(buf), buf );
    17          end loop;
    18 
    19          DBMS_OUTPUT.put_line( 'Copied '||length(c)||' byte(s) from remote LOB' );
    20          DBMS_OUTPUT.put_line( 'Read Iterations: '||iterations );
    21          DBMS_OUTPUT.put_line( 'LOB contents (1-4000):'|| DBMS_LOB.SubStr(c,4000,1) );
    22 
    23          DBMS_LOB.FreeTemporary( c );
    24  end;
    25  /
    Copied 53 byte(s) from remote LOB
    Read Iterations: 4
    LOB contents (1-4000):<root><text>What do you want, universe?</text></root>
    PL/SQL procedure successfully completed.
    SQL> The concern is the size of the LOB. It does not always make sense to access the entire LOB in the database. What if that LOB is a 100GB in size? Irrespective of how you do it, selecting that LOB column from that table will require a 100GB of data to be transferred from the database to your client.
    So you need to decide WHY you want the LOB on the client (which will be the local PL/SQL code in case of dealing with a LOB on a remote database)? Do you need the entire LOB? Do you need a specific piece from it? Do you need the database to first parse that LOB into a more structured data struct and then pass specific information from that struct to you? Etc.
    The bottom line however is that you can use remote LOBs. Simply that you cannot use a local pointer variable to point and dereference a remote LOB.

  • Using SSL Module to Encrypt HTTP post to external Server

    I would like to know if it's possible for a CSM with its SSL module to receive an HTTP POST from our internal web servers, encrypt that POST w/ SSL, and finally to forward the newly created SSL transmission to a remote external SSL server? If it is possible, is this good practice or is it better to let the web server do the encryption?

    this is possible.
    It is good practice if you do not want to overload your server with the heavy task of encryption/decryption.
    If your server is very powerfull and far from being used to its maximum capacity, you can do it on the server.
    Another advantage of using an SSL module is that the CSM will see your request in clear text and can therefore perform so *smart* loadbalancing before it gets encrypted by the SSL module.
    [ie: cookie stickyness, url hashing, ...]
    Regards,
    Gilles.

  • Query regarding encoding/decoding of XML over HTTP Post request

    Hello,
    I am working on a project where I need to put SMS inside XML and
    eventually transfer this XML via HTTP post from/to server/client.
    Assuming the SMS to be 7-bit text the XML may look something like
    <?xml+version="1.0"?>
    <SMS
    TESTMESSAGE
    </SMS>
    This XML when encoded in a HTML post may look something like
    http://<IP Address>:<port>/
    POST /MessageReceiver.jsp HTTP/1.0
    Host: www.SomeHost.net
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 90
    xmlMsg=%3C%3Fxml+version%3D%221.0%22%3F%3E%0D%0A%3CSMS%0D%0A%09TESTMESSAGE0D%0A%3C%2FSMS%3E
    This xml is UTF-8 (7-bit ASCII) by default since no encoding format has been specified.
    My question - how will the encoding of xml change to - when 8 bit binary data
    is transferred via xml.
    for e.g.
    <?xml+version="1.0"?>
    <SMS
    <!!!!!BINARY DATA!!!!!>
    </SMS>
    for such a file how/what shld the encoding be set to.
    Further my spec-states the following.
    "The content of the XML must respect the encoding. Thus a SMS
    containing typically french characters must use ISO-8859-1 encoding"
    "This code needs to work with both UTF-8 and UTF-16 standards (ASCII and Unicode). Because of this the parsing code should work internally with UTF-16 and translate up/down to/from UTF-8 (ASCII) only when dealing with the basic HTTP."
    could anyone clarify this for me.

    The first thing you need to do is clear up some fundamental misconceptions about character encodings. UTF-8 is not the same thing as "7-bit ASCII", and UTF-16 is not the same as "Unicode". Anyway, you're making this a lot more difficult than it needs to be. Just use UTF-8 to encode and decode all messages; it can handle all the characters from any language you're likely to run into.

  • How to call external http client from abap system

    Hi All,
    I have browsed through sdn and google but not found any helpful document ,
    Here my requirement is to call external http client from ecc ,
    Pl suggest..,
    Regards,
    Lokeswar .

    Hi Deepak,
    I have followed the below Reference links :
    Example Program: Executing an HTTP Request - Components of SAP Communication Technology - SAP Library
    http://scn.sap.com/thread/2035765
    but while executing  get http responce i'm facing 'HTTP_COMMUNICATION_FAILURE' error
        CALL METHOD L_HTTP_CLIENT->RECEIVE
          EXCEPTIONS
            HTTP_COMMUNICATION_FAILURE = 1
            HTTP_INVALID_STATE         = 2
            HTTP_PROCESSING_FAILED     = 3.
    Pl suggest ,

  • HTTP Post Error

              I am using WebLogic Server 7.0 SP1 with the iPlanet 4.1 WebLogic Plugin. When
              I do a HTTP Post from my java applet using URLConnection, I am getting the following
              error from the plugin:
              [20/May/2003:11:19:13] failure ( 860): for host 199.228.131.177 trying to POST
              /WebLogicServer/DSSServer/DSSServlet, wl-proxy reports: IO error reading client
              POST data at line
              [20/May/2003:11:19:13] failure ( 860): for host 199.228.131.177 trying to POST
              /WebLogicServer/DSSServer/DSSServlet, wl-proxy reports: exception occurred: 'READ_ERROR
              [os error=0, line 534 of proxy.cpp]: reading client POST data failed'
              The applet code is as follows:
              URLConnection con = toFetch.openConnection();
              con.setDoInput(true);
              con.setDoOutput(true);
              con.setDefaultUseCaches(false);
              con.setUseCaches(false);
              con.setRequestProperty("Accept","text/html");
              con.setRequestProperty("Content-Type","application/x-www-form-urlencoded");     
              prout = new DataOutputStream (con.getOutputStream ());
              prout.writeBytes(postdata);
              prout.flush();
              prout.close();
              The iPlanet access log shows a POST request was received but when the request
              is proxied to the WebLogic plugin, the error occurs. I can't tell if this is
              a HTTP header problem or a data problem.
              Any help would be greatly appreciated.
              Thanks,
              Ken
              

    I have exactly the same problem when using a URLConnection to post
              data. Here's the error I get.
              wl-proxy reports: exception occurred: 'READ_ERROR [os error=11, line
              534 of proxy.cpp]: reading client POST data failed'
              Any advices would be appreciated.
              Thanks
              CS
              "Ken Sands" <[email protected]> wrote in message news:<[email protected]>...
              > I am using WebLogic Server 7.0 SP1 with the iPlanet 4.1 WebLogic Plugin. When
              > I do a HTTP Post from my java applet using URLConnection, I am getting the following
              > error from the plugin:
              >
              > [20/May/2003:11:19:13] failure ( 860): for host 199.228.131.177 trying to POST
              > /WebLogicServer/DSSServer/DSSServlet, wl-proxy reports: IO error reading client
              > POST data at line
              > [20/May/2003:11:19:13] failure ( 860): for host 199.228.131.177 trying to POST
              > /WebLogicServer/DSSServer/DSSServlet, wl-proxy reports: exception occurred: 'READ_ERROR
              > [os error=0, line 534 of proxy.cpp]: reading client POST data failed'
              >
              > The applet code is as follows:
              >
              > URLConnection con = toFetch.openConnection();
              > con.setDoInput(true);
              > con.setDoOutput(true);
              > con.setDefaultUseCaches(false);
              > con.setUseCaches(false);
              > con.setRequestProperty("Accept","text/html");
              > con.setRequestProperty("Content-Type","application/x-www-form-urlencoded");     
              > prout = new DataOutputStream (con.getOutputStream ());
              > prout.writeBytes(postdata);
              > prout.flush();
              > prout.close();
              >
              > The iPlanet access log shows a POST request was received but when the request
              > is proxied to the WebLogic plugin, the error occurs. I can't tell if this is
              > a HTTP header problem or a data problem.
              >
              > Any help would be greatly appreciated.
              >
              > Thanks,
              >
              > Ken
              

  • HTTP POST using JSP

    Is it possible to submit a data using HTTP POST from a JSP. In a JSP I am generating a XML. For example JSP URL is http://www.test/xml.jsp
    In the xml.jsp:-
    <test>
    <test1>
    Testing 1
    </test1>
    <test2>
    Testing 2
    </test2>
    </test>
    When I call http://www.test/xml.jsp, I should receive the content in the xml.jsp as a HTTP POST. Is this possible using JSP or do I have to use only servlet?
    Thanks

    Hi,
    yes, it's possible to submit data from JSP using POST method.
    It is even possible to do it from HTML. Set <form method="post"...>, that's all. You can't submit data using POST by typing any specific address etc. in Your browser, only GET parameters can be sent in such a way.
    Regards, M

Maybe you are looking for

  • Treo Pro locking on incoming call

    My Treo has the habit on "locking buttons and screens" on incoming calls. If I don't answer quickly, nothing works anymore and the call is abandoned. Quickly means less then 10 seconds! Is there a way to stop this from happening? I've went through al

  • Mid 2009 MacBook Pro - Running really slow.

    Hi, I'm having problems with my mid 2009 MBP running really slowly. The problem seems to be the mds_stores Process using lots of CPU and memory. I have done the following to try and resolve it: Uninstalled AV software (Avast) Created new admin user a

  • Dynamic JNLP - displaying using java web start

    Hi, I am creating a dynamic JNLP in a servlet at the server side. Please see below. String someJnlpString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> \n" +                                             "<jnlp .....    >    </jnlp>";                St

  • Lost iPhoto and pictures

    Tonight opened iPhoto and was prompted to select a library. I chose the library I thought was the correct one (I only have two choices iPhoto or Pictures) and now when iPhoto opens I have all the thumbnails but when I click to open them all I get is

  • How do i turn off automatic download and make it stay off

    I use the preferences in ITUNES to turn off automatic down loads and every time i start iTunes it  tries to force me to sign to an ICLOUD account and automatic download. I have tried everything I can find on apple help sites. But you Apple carefully