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

Similar Messages

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

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

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

  • Executing HTTP Request from ABAP

    Hi Experts,
    I am trying to fill & submit an http form through abap using CL_HTTP_CLIENT class methods "request". here is my code:-
    DATA: client TYPE REF TO if_http_client.
    Create Client-Object
    CALL METHOD CL_HTTP_CLIENT=>CREATE_BY_URL
      EXPORTING
        url                = url_string
      IMPORTING
        CLIENT             = client
      EXCEPTIONS
        ARGUMENT_NOT_FOUND = 1
        PLUGIN_NOT_ACTIVE  = 2
        INTERNAL_ERROR     = 3
        others             = 4.
    IF sy-subrc <> 0.
      WRITE: / 'Client Object could not be created. SUBRC=', sy-subrc.
      EXIT.
    ENDIF.
    Set Header Field of request
    CALL METHOD client->request->if_http_entity~set_header_field
      EXPORTING
        name  = '~request_enctype'
        value = 'multipart/form-data'.
    CALL METHOD client->request->if_http_entity~set_header_field
      EXPORTING
        name  = '~request_method'
        value = 'POST'.
    try posting form fields
    CALL METHOD client->request->if_http_entity~set_form_field
      EXPORTING
        name  = 'datasource'
        value = 'GSAPO'.
    CALL METHOD client->request->if_http_entity~set_form_field
      EXPORTING
        name  = 'feedtype'
        value = 'full'.
    CALL METHOD client->request->if_http_entity~set_form_field
      EXPORTING
        name  = 'data'
        value = xml_string.
    CALL METHOD client->send
    EXPORTING
       TIMEOUT                    = CLIENT->CO_TIMEOUT_INFINITE
      EXCEPTIONS
        http_communication_failure = 1
        http_invalid_state         = 2
        http_processing_failed     = 3
        http_invalid_timeout       = 4
        OTHERS                     = 5
    IF sy-subrc <> 0.
      WRITE: / 'Request could not be sent - communication error. SUBRC=',
                                                                 sy-subrc.
      EXIT.
    ENDIF.
    Receive Response
    CALL METHOD client->receive
      EXCEPTIONS
        http_communication_failure = 1
        http_invalid_state         = 2
        http_processing_failed     = 3
        OTHERS                     = 4.
    IF sy-subrc <> 0.
      WRITE: 'Response not obtained - communication error SUBRC = ' ,
    sy-subrc.
      EXIT.
    ENDIF.
    Close HTTP connection
    CALL METHOD client->close
      EXCEPTIONS
        http_invalid_state = 1
        OTHERS             = 2.
    IF sy-subrc <> 0.
      WRITE 'HTTP connection in undefined state'.
      EXIT.
    ENDIF.
    *End of code.
    The problem here is I am getting exception "http_connection_failed" in recieve method.
    Can any body help me out.
    Thanks in advance.
    Madhu.

    is the http destination within intranet or internet? do you connect to internet via proxy server?
    Raja

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

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

  • How to send a http-request from abap?

    I want to send a xml file through a http-request ,what should i do?

    Welcome to SDN
    you can use cl_http_client class to do that. search the abap general forum with key word cl_http_client and you will find lot of examples.
    Regards
    Raja

  • Remove charset=utf-8 from HTTP POST

    I'm trying to do a HTTP POST via ABAP.  The application that I'm posting to does not like the "charset=utf-8" that is in the request.  I've been told that I need to remove it.  Does anyone know how to do this?  I'm not setting this field.  SAP is adding this charset automatically.
    Here is the request:
    POST /hapld/tos/kdwhapltos HTTP/1.1
    content-type: multipart/mixed; boundary=BOUNDARY; charset=utf-8
    content-length: 2018
    host: www.pld-certify.ups.com
    user-agent: SAP Web Application Server (1.0;700)
    accept-encoding: gzip
    sap-trace: 3
    --BOUNDARY
    Content-type: application/x-www-form-urlencoded
    Content-length: 128
    AppVersion=1.0&AcceptUPSLicenseAgreement=Yes&ResponseType=application/x-ups-pld&VersionNumber=V4R1&UserId=xxxxxx&Password=xxxxxx
    --BOUNDARY
    Content-type: application/x-ups-binary
    Content-length: 1396
    020093  2010071800000006852703500   000000002*AA296007......etc
    BOUNDARY
    Here is my code:
    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 = '' .
      data: lv_value type string.
      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 = 'HTTP/1.1'.
    CALL METHOD http_client->request->set_header_field( name = '~server_protocol' value = 'HTTP/1.1' ).
      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 = POST_URI.
    CALL METHOD http_client->request->set_content_type
        EXPORTING
          content_type = 'multipart/mixed; boundary=BOUNDARY'.
    CALL METHOD http_client->REQUEST->SET_HEADER_FIELD
        EXPORTING
          NAME = 'Accept-Charset'
          VALUE = 'ISO-8859-1,utf-8;q=0.7,*;q=0.7'.
    CALL METHOD http_client->request->SET_FORMFIELD_ENCODING
        EXPORTING
          FORMFIELD_ENCODING = http_client->request->CO_ENCODING_URL.
      CALL METHOD http_client->request->set_cdata
        EXPORTING
          data   = wf_string
          offset = 0
          length = rlength.
      CALL METHOD http_client->send
        EXCEPTIONS
          http_communication_failure = 1
          http_invalid_state         = 2.
      CALL METHOD http_client->receive
        EXCEPTIONS
          http_communication_failure = 1
          http_invalid_state         = 2
          http_processing_failed     = 3.
      CLEAR wf_string1 .
      wf_string1 = http_client->response->get_cdata( ).

    Hi,
    I had a similar problem and could resolve it by using APPEND_DATA instead of APPEND_CDATA. Likewise, SET_DATA instead of SET_CDATA might solve the issue for you. The data has to be provided as binary data then.
    Regards,
    Stefan

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

  • Calling HTTP from ABAP

    Hi ,
    I want to call HTTP link from ABAP. On initial research , I found that I can do the task in 2 ways:---
    1. by using class cl_http_client,
    2. by using program RSHTTP20 .
    Is it the correct information I got.
    Out of the 2 methods, which method can I prefer and what are d pros and cons of the above methods?
    Please help.
    Thanks,
    Shivaa...

    Hi All,
    I have a problem to pass a file.txt in a parameter of a web service.
    Iam using CL_HTTP_CLIENT and I am passing the parameters (user, password and file):
    clear wa_form.
    wa_form-name = 'user'.
    wa_form-value = '33333333333'.
    append wa_form to it_form.
    clear wa_form.
    wa_form-name = 'password'.
    wa_form-value = '11111111'.
    append wa_form to it_form.
    clear wa_form.
    wa_form-name = 'file'.
    wa_form-value = data. ---> "data" is a type string with the data of the file.txt.
    append wa_form to it_form.
      r_client->request->set_form_fields( fields = it_form ).
    I have not problem with the user and password parameters.
    Thank.

  • Call http url in Abap - Should not open Browser

    Hi Friends,
       I have a requirement where i need to check whether a perticular http service is running or not. For that i need a some code to call http url from abap and it should not open the browser. If that perticular url is not found or time out then i should know that in program...
    Is there any way to do that..

    just run the following url (after changing the values for host,etc) from browser
    http://<abaphost>.<domain>.com:<port>/sap/public/ping
    to get the values for http://<abaphost>.<domain>.com:<port> just go to transaction se80 and choose bsp application option and choose any existing bsp application and then doubl click on a page. on the right side click on the attributes tab and at the end you can find the url
    Regards
    Raja

Maybe you are looking for

  • Firefox stalls for a few minutes before allowing touch pad commands, new tabs, firefox 8.0.1 w/ os 10.6.8.

    Upon waking from sleep or restarting Firefox the program won't allow track pad scrolls or show opening of a new tab whether by link or command. Once the program has been open a few minutes all the tabs that were attempted show up at once and track pa

  • How do I create a multi-coloured super-sized chessboard?

    Basically, I want to create a 72 by 72 chessboard. Instead of 2 colours, it will be 6 colours. And instead of it being in a repeating pattern, the colours need to be arranged in a specific order - I have the code for this in Excel, but can easily con

  • Licensing...

    Hi, Your link to licensing details : ( http://www.sap.com/solutions/sapbusinessobjects/sme/reporting-dashboarding/reporting/eclipse/technicaldetails/index.epx) on download page (http://www.businessobjects.com/campaigns/forms/downloads/crystal/eclipse

  • How to debug outbound Idoc function module for invoice

    I have to debug the outbound IDOC function module and UserExit for invoice message type INVOIC, process code SD09, function module is IDOC_OUTPUT_INVOIC and user exit for the function module LVEDF001. I tried putting the break point in function modul

  • Aperture upgrade

    I am thinking about getting Aperture 3 but wondering if Aperture 4 comes out does that mean Aperture 3 is useless or does it just get upgraded. I dont want to spend $100 or so if I have to buy a whole new one and have to get rid of the old regards Ra