HTTP Transformation using POST Method

Hi, I will have to use POST method with header as application/json to get the results in http transformation. I downloaded the RESTFUL client utility from Chrome, to see how JSON would look like by passing parameters and the result is displayed as expected.  But I'm not sure how the URL to be constructed in HTTP transformation and appreciate if you have any suggestions. My URLL http://dev1.com/contract-api/contract/public/contractValidationMy input parameters:  {"hierarchies":[10],"properties":[18],"licId":123} If I use the above URL and parameters in RESTFUL client, I'm getting the output, but having difficulty in setting up the URL using HTTP transformation.  RegardsSelva

Thanks Marc.
Let me rephrase the scenario.
I have an external application which is capable of sending information only in XML through HTTP requests. It does not send SOAP messages. I guess in this case, we would need to use the HTTP binding using POST method. Much like the sample at http://blogs.oracle.com/reynolds/2005/09/invoking_bpel_from_an_html_for.html which uses the GET method.
In this sample reynolds is using the GET method. I have been trying to get the POST method to work.
Regards
John

Similar Messages

  • HTTP Binding using POST Method

    Hi all,
    I need to pass XML to a BPEL using HTTP POST. I have got a sample running for passing information to BPEL through GET method of HTTP. But do not have any idea about how to pass XML using HTTP POST. Please put forward your suggestions.
    Thanks.
    John

    Thanks Marc.
    Let me rephrase the scenario.
    I have an external application which is capable of sending information only in XML through HTTP requests. It does not send SOAP messages. I guess in this case, we would need to use the HTTP binding using POST method. Much like the sample at http://blogs.oracle.com/reynolds/2005/09/invoking_bpel_from_an_html_for.html which uses the GET method.
    In this sample reynolds is using the GET method. I have been trying to get the POST method to work.
    Regards
    John

  • Want to send information in Header dynamically using HTTP adapter using post method

    Hi ,
    I have a requirement to send below information in http Adapter header dynamically using post method. which will be authenticated by third party system.
    Authorization : WSSE realm="SDP", profile="UsernameToken", type="AppKey" X-WSSE : UsernameToken Username="XXXX", PasswordDigest="Qd0QnQn0eaAHpOiuk/0QhV+Bzdc=", Nonce="eUZZZXpSczFycXJCNVhCWU1mS3ZScldOYg==", Created="2013-09-05T02:12:21Z"
    I have followed below link to create UDF
    http://scn.sap.com/thread/3241568
    As if now my third party system is not available while sending request I am getting 504 gateway error. is there any approach I can validate my request is working fine?
    Regards,

    Hi Abhay,
    Correct me if I'm wrong but I think WSSE requires a SOAP Envelope. If that is the case, there are two approaches: the first one is to use SOAP Axis and the second one is just to build SOAP Envelope via Java mapping.
    You also need to test it successfully externally, capture the request and replicate it in XI.
    Hope this helps,
    Mark

  • Open URL, use POST method in new window

    From a Java program, how do we open a https connection, basically a secured site, in a new window and pass some parameters to the link, using POST method?

    Hi
    Is JavaProgram a Applet or Servlet?
    Opening a new window directly from server,probably not possible? From your question
    what I understand is, A html page is displayed
    and when u click on a link opens a new window.
    The parameters to the link should be posted using POST method, again
    it is not possible this can be done only by appending
    "?name1=value1&name2=value2..."to the link
    Vinay
    [email protected]

  • Call Bpel process through HTTP get or post method

    I need to call BPEL process from Mobile.
    In mobile we are using HTTP get or post methods. so can anybody tell me how to invoke BPEL(how to pass input to BPEL) by using HTTP get or post method.
    Vivek garg
    Edited by: 809104 on Dec 24, 2010 2:36 AM

    I got the soluntion
    we just need to change the binding in WSDL file from Soap to HTTP.
    First of all add three namespaces in wsdl file
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    Then change the Request msg from element type to string type like below
    <message name="UserLoggOffRequestMessage">
    <part name="UserId" type="xsd:string"/> (add this one))
    <!--<part name="payload" element="client:UserLoggOffProcessRequest"/>-->(remove this one)
    </message>
    Then change the binding
    <binding name="UserLoggOffBinding" type="client:UserLoggOff">
    <http:binding verb="GET"/>
    <operation name="process">
    <http:operation location="/process"/>
    <http:urlEncoded/>
    <output>
    <mime:mimeString part="Body"/>
    </output>
    </operation>
    </binding>
    Then do some changes in service tag . we need to do the changes in location only.
    we need to remove orabpel from location and add httpbinding
    http://infva04718.vshodc.lntinfotech.com:8888/*orabpel*/MobileApplication/UserLoggOff/1.0
    http://infva04718.vshodc.lntinfotech.com:8888/*httpbinding*/MobileApplication/UserLoggOff/1.0
    do like following
    <service name="UserLoggOff">
    <port name="UserLoggOffPort" binding="client:UserLoggOffBinding">
    <http:address location="http://infva04718.vshodc.lntinfotech.com:8888/httpbinding/MobileApplication/UserLoggOff/1.0"/>
    </port>
    </service>
    Then deploy the process then u can invoke this
    http://infva04718.vshodc.lntinfotech.com:8888/httpbinding/MobileApplication/UserLoggOff/process?UserId=a1
    here process is name of process u want to invoke

  • Sending XML messages from server to client using POST method

    Dear everyone,
    I have a simple client server system - using Socket
    class on the server side and URLConnection class on
    the client side. The client sends requests to the
    server in the form of an XML message using POST method.
    The server processes the request and responds with
    another XML message through the same connection.
    That's the basic idea.
    I have a few questions about headers and formats
    especially with respect to POST.
    1. In what format should the response messages from the
    server be, for the client? Does the server need to
    send the HTTP headers - for the POST type requests?
    Is this correct?:
       out.println("HTTP/1.1 200 My Server\r");
       out.println("Content-type: text/xml\r");
       out.println("Content-length: 1024\r");
       out.println("\r");
       out.println("My XML response goes here...");2. How do I read these headers and the actual message
    in the client side? I figured my actual message was
    immediately after the blank line. So I wrote
    something like this:
       String inMsg;
       // loop until the blank line is through.
       while (!"".equals(inMsg = reader.readLine()))
          System.out.println(inMsg);
       // get the actual message and process it.
       inMsg = reader.readLine();
       processMessage(inMsg);But the above did not work for me. Because I seem to
    be receiving a blank line after each header! (I suppose
    that was because of the "\r".) So what should I do?
    3. What are the different headers I must pass from
    server to the client to safeguard against every
    possible problem?
    4. What are the different exceptions I must be prepared
    for this situation? How could I cope with them? For
    example, time outs, IOExceptions, etc.
    Thanks a lot! I appreciate all your help!
    George

    hello,
    1) if you want to develop a distributed application with XML messages, you can look in SOAP.
    it's a solution to communicate objects distributed java (or COM or other) and it constructs XML flux to communicate between them.
    2) if it can help you, I have developed a chat in TCP/IP and, to my mind, when you send datas it's only text, so the format isn't important, the important is your traitement behind.
    examples :
    a client method to send a message to the server :
    public void send(String message)
    fluxOut.println(message);
    fluxOut.flush();
    whith
    connexionCourante = new Socket(lAdresServeur, noPort);
    fluxOut= new PrintWriter( new OutputStreamWriter(connexionCourante.getOutputStream()) );
    a server method in a thread to receive and print the message :
    while(true)
    if (laThread == null)
    break;
    texte = fluxIn.readLine();
    System.out.println(texte);
    that's all ! :)
    If you want to use it for your XML communication, it could be a good idea to use a special message, for example "@end", to finish the server
    ex :
    while(true)
    if (laThread == null)
    break;
    texte = fluxIn.readLine();
    // to stop
    if (texte.equals("@end"))
    {break;}
    processMessage(texte );
    hope it will help you
    David

  • How to use POST method to send & recieve XML data in WebDynpro application

    Hi There,
    How can we use POST method in a Url (callign weebdynpro application) and pass XML String content. How can we read this this inside WD Application.
    Any pointers will be great help.
    Rgds

    Closed

  • How to use post method in j2me

    I used post method and when im about to receive the response from the servelt i get the output like
    str=<html><head><title>Apache Tomcat/4.1.24 - Error report</title><STYLE><!--H1{font-family : sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;} H3{font-family : sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;} BODY{font-family : sans-serif,Arial,Tahoma;color : black;background-color : white;} B{ ................                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Thanks supareno I have tried the weblink u hav given. It helped me a lot

  • [REPOST]How to force ADF Dialog / POPUP to use POST method ?

    Hi all,
    Is there any way to make ADF Dialog / POPUP to use POST method ?
    I need that approach to implement this post : [SOLVED] Faces - Preventing user from entering URL manually
    But it breaks in my application because ADF Dialog / POPUP is using GET method.
    Thank you very much,
    xtanto

    repost.
    Thank you

  • How to use POST method in PI 7.11 when using HTTP adapter

    Hi
    I need to use the POST method when using the http receiver adapter in PI 7.11. Now the GET method is used. I am using the Addressing Type = "HTTP Destination" where you create an RFC of type 3 in SM59 and reference this in your HTTP receiver adapter.
    What do I do?
    BR
    MIkael

    Hi Patrick
    I need to use the POST method, not the GET method. The external partner, which is receiving our message, says, that we are using GET.
    This is from their log where we are DongEnergy:
    From DongEnergy:
    2010-01-14 09:46:11 W3SVC1 10.1.2.37 GET /DongEnergy/xxxxxxxxx.dll - 443 - 193.162.91.1 SAPNetWeaverApplicationServer(1.0;711) 500 0 0 214 172
    From Danisco:
    2010-01-14 07:54:13 W3SVC1 10.1.2.37 POST /Danisco/xxxxxxxxxx.dll - 443 - 193.XXX.191.1 SAPWebApplicationServer(1.0;640) 202 0 0 380 5984
    Could it be our firewall which vonverts the method from POST to GET?
    MIkael

  • Passing values from applet using POST method to PHP page

    Hello there ;)
    I realy need a help here.. I`ve been working all day on sending mail from applet. I didn`t succeed bcs of the security restrictions.
    So I decided just to pass arguments into PHP page, which process them and send e-mail to me.
    So here is the problem.. I need to send String variables througth POST into my php page. Now I`m using GET method, but I need more than 4000 characters.
    My actual solution is:
      URL url = new URL("http://127.0.0.1/index.php?name=" + name + "&message=" + message);
    this.getAppletContext().showDocument(url,"_self");I really need to rewrite it into POST. Would you be so kind and write few lines example [applet + php code]? I`ve already searched, googled, etc.. Pls don`t copy links to other forums here, probably I`ve read it.
    Thanx in advance to all :)

    hi!
    i`ve got some news about my applet.. so take this applet code:
    public class Apletik extends JApplet {
        public void init() { }
        public void start()
        try
          String aLine; // only if reading response
          String  parametersAsString = "msg=ahoj&to=world";
          byte[] parameterAsBytes = parametersAsString.getBytes();
          // send parameters to server
          URL url = this.getCodeBase();
          url = new URL(url + "spracuj.php");
          URLConnection con = url.openConnection();
          con.setDoOutput(true);
          con.setDoInput(true); // only if reading response
          con.setUseCaches(false);
          con.setRequestProperty("Content=length", String.valueOf(parameterAsBytes.length));
          OutputStream oStream = con.getOutputStream();
          oStream.write(parameterAsBytes);
          oStream.flush();
          String line="";
          BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
          while ((aLine = in.readLine()) != null)
           JOptionPane.showMessageDialog(null, aLine);      
           if(aLine.equals("")) break;
          in.close();      
          oStream.close();
        catch (Exception ex)
          JOptionPane.showMessageDialog(null, ex.toString());
    }here is code of spracuj.php which is on server:
    <?php
      if(isset($_POST['msg']))
        echo('hurray!');
    ?>it has only 1 problem.. when i test it on my localhost, everything seems to be all right. but when i post it to my server, i got IOException HTTP 400 error code :( where is the problem? please help me, i`m so close :D thanx

  • Calling https web service POST method from ABAP

    Hi all,
    I'm having some problems trying to call a credit card https web service from ABAP on 2004s SP11. I'm not using a proxy server and a call from a test https page on my local machine works fine. The page does not require a certificate.
    Do I need to do anything in particular to make https work ? I've done calls to http services without any problems. The only difference from a programming perspective as far as I know is the scheme 2 instead of 1, and the server protocol changed to HTTPS.
    All is fine until  I call method http_client->receive, at that point I get a return code of 1, http_communication_failure. 
    Your suggestions & contributions will be greatly appreciated.
    Cheers,
    Wouter.
    report zcreditcardtest .
    data: wf_user type string .
    data: wf_password type string .
    data: rlength type i,
          txlen type string  .
    data: http_client type ref to if_http_client .
    data: wf_string type string .
    data: wf_string1 type string .
    data: wf_proxy type string ,
          wf_port type string .
    selection-screen: begin of block a with frame .
    parameters: crcard(16) type c lower case default '4242424242424242',
                cvn(4)     type c lower case default '564',
                year(2)    type c lower case default '07',
                month(2)   type c lower case default '11',
                amount(10) type c lower case default '100.00',
                cukey(4)   type c lower case default 'AUD',
                order(10)  type c lower case default 'AB1322-refund'.
    selection-screen skip 1.
    parameters: user(50) lower case,
                password(50) lower case ,
                p_proxy(100) lower case default '' ,
                p_port(4) default ''.
    selection-screen: end of block a .
    at selection-screen output.
      loop at screen.
        if screen-name = 'PASSWORD'.
          screen-invisible = '1'.
          modify screen.
        endif.
      endloop.
    start-of-selection .
      clear wf_string .
      concatenate
      'order.type=capture&customer.username=SOMEUSER'
      '&customer.password=SOMEPASSWORD'
      '&customer.merchant=SOMEMERCHANT'
      '&card.PAN=' crcard
      '&card.CVN=' cvn
      '&card.expiryYear=' year
      '&card.expiryMonth=' month
      '&order.amount=' amount
      '&customer.orderNumber=' order
      '&card.currency=' cukey
      '&order.ECI=IVR'
      '&customer.captureOrderNumber=' order
      '&order.priority=1'
      '&message.end=null'
      into wf_string .
      break-point.
      clear :rlength , txlen .
      rlength = strlen( wf_string ) .
      move: rlength to txlen .
      clear: wf_proxy, wf_port .
      move: p_proxy to wf_proxy ,
            p_port to wf_port .
      call method cl_http_client=>create
        exporting
          host          = 'api.somewhere.com'
          service       = '80'
          scheme        = '2'                        "https
          proxy_host    = wf_proxy
          proxy_service = wf_port
        importing
          client        = http_client.
      http_client->propertytype_logon_popup = http_client->co_disabled.
      wf_user = user .
      wf_password = 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  = '~server_protocol'
          value = 'HTTPS/1.0'.
      call method http_client->request->set_header_field
        exporting
          name  = '~request_uri'
          value = '/post/CreditCardAPIReceiver'.
      call method http_client->request->set_header_field
        exporting
          name  = 'Content-Type'
          value = 'application/x-www-form-urlencoded; charset=UTF-8'.
      call method http_client->request->set_header_field
        exporting
          name  = 'Content-Length'
          value = txlen.
      call method http_client->request->set_header_field
        exporting
          name  = 'HOST'
          value = 'api.somewhere.com:80'.
      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.
      if sy-subrc <> 0.
        message e000(oo) with 'Processing failed !'.
      endif.
      clear wf_string1 .
      wf_string1 = http_client->response->get_cdata( ).
    * Further Processing of returned values would go here.

    Well, finally got this running !
    First of all I needed to download SAP Cryptographic Software and install it on the Web Application Server. Added some parameters to the profile, then set up some nodes in strust. Note 510007 describes the full process.
    I then installed the certifcate I needed by opening the website in internet explorer and exporting it to a CER file and then importing it into the SSL client (Anonymous). The blog from Thomas Yung, "BSP a Developer's Journal Part XIV - Consuming WebServices with ABAP" describes the process of exporting and importing certificates.
    I then had to start the HTTPS service on my NW 2004s ABAP preview edition SP11. I set this up for port 443.
    /osmicm --> GOTO --> SERVICES --> SERVICE --> CREATE
    Then finally, the program needed a few changes :
      call method cl_http_client=>create
        exporting
          host          = 'api.somewhere.com'
          service       = '443'                       " <<-----  443 NOT 80
          scheme        = '2'                        "https
          ssl_id        = 'ANONYM'              " <<----- SSL_ID Added
          proxy_host    = wf_proxy
          proxy_service = wf_port
        importing
          client        = http_client.
    and further in the program (thanks Andrew !) :
      call method http_client->request->set_header_field
        exporting
    *   name  = '~server_protocol'             " <<<--- DELETE
          name  = '~request_protocol'         " <<<-- INSERT must be request
          value = 'HTTPS/1.0'.
    and presto, we can now consume a https webservice via a POST method from within an ABAP program ! Nice.... Can I give myself 10 points ?

  • IN ODATA, How to pass Timestamp data using POST method

    Dear all
    I am trying to insert a record into a HANA column store table using ODATA service.
    POST URL
    http://hanadrp.sial.com:8000/sial/sapnext/generic/odata/uidatetime.xsodata/UIDateTime
    Message one
      "IDTXT" : "1",
      "IDDATETIME" : "2014-09-19 10:20:10"
    Message Two
      "IDTXT" : "1",
      "IDDATETIME" : "/TO_TIMESTAMP(CURRENT_TIMESTAMP)/"
    Both give me this message
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <error
        xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
        <code/>
        <message xml:lang="en-US">Syntax error at position 0.</message>
    </error>
    The table here has only two columns and the IDDATETIME is a column of time TIMESTAMP
    Please advice

    Thanks Shreyansh to take time to reply
    Here below is the preview of the message from the POSTMAN preview button
    I really am not sure what is the X-CSRF token?
    POST /sial/sapnext/generic/odata/uidatetime.xsodata/UIDateTime HTTP/1.1
    Host: hanadrp.sial.com:8000
    Authorization: Basic YXJhbWFjaGE6U3JpcmFtNjY=
    Content-Type: application/json;charset=utf-8
    Cache-Control: no-cache
    { "IDTXT" : "1", "IDDATETIME" : "2014-09-01T00:00:00" }

  • Accessing Java webservice (XML over http) via WCF or HTTP adapter with content-type and authorization HTTP headers with POST method

    Hi Team,
    I need to access Java web service which is simple service and accepts and returns XML over HTTP. No credentials are needed to access the service. We need to pass following two HTTP headers (Content-Type and Authorization) along with XML request message:
    <GetStatus> message is being constructed in the orchestration and URI is constant to access.
    Which adapter shall I use to get the response back? I tried using WCF-WSHttp with Security Mode = Transport, and different options of client credential types but every time, error returned stating:
    System.Net.WebException:
    The HTTP request is unauthorized with client authentication scheme 'Basic'. The
    authentication header received from the server was 'Basic realm='.
    Authentication failed for principal Basic. Message payload is of type:
    String 
    In Fiddler, request looks line following
    POST <https://URL/GetServiceReopnse HTTP/1.1
    Content-Type: application/xml
    Authorization: Basic cmVmU3RhdHN2Y19kgeRfsdfs=
    Host: <Server name>
    <GetStatus XMLNS="http://server.com/.....">
    <OrgId>232323</OrgId>
    <HubId>3232342323</HubId>
    </GetStatus>
    MMK-007

    First, you should not use the HTTP Adapter because it's been deprecated and replaced by WCF.
    Start with the WCF-Custom Adapter and select the customBinding.
    You should start with the textMessageEncoder and httpTransport and go from there.

  • How to send Array data using Post Method?

    Var array = $_POST['myData'];
    array[0] => 'ABC'
    array[1] => 'DEF'
    how to improve this code to support send array data...?
    String url ="http://xxxxx/test.php";
    String[] arraystr={"ABC", "DEF", "EDFF"}
    String parameter = "myData=" +arraystr;    // no support this
    Strint str = postMrthod(url, parameter );
    public static String postMethod(String url, String parameter) {
            StringBuffer b = new StringBuffer("");
            HttpConnection hc = null;
            InputStream in = null;
            OutputStream out = null;
            try {
                hc = (HttpConnection) Connector.open(url);
                hc.setRequestMethod(HttpConnection.POST);
                hc.setRequestProperty("CONTENT-TYPE", "application/x-www-form-urlencoded");
                hc.setRequestProperty("User-Agent", "Profile/MIDP-2.0 Configuration/CLDC-1.0");
                out = hc.openOutputStream();
                byte postmsg[] = parameter.getBytes();
                for (int i = 0; i < postmsg.length; i++) {
                    out.write(postmsg);
    out.flush();
    in = hc.openInputStream();
    int ch;
    while ((ch = in.read()) != -1) {
    b.append((char) ch);
    } catch (IOException e) {
    e.printStackTrace();
    try {
    if (in != null) {
    in.close();
    if (hc != null) {
    hc.close();
    } catch (IOException e) {
    e.printStackTrace();
    return b.toString().trim();

    yes, you can send integer value like this. But I think you have to put quotes around <%= TAMID%> i.e.
    <input type="hidden" id="HTTP_CVHTAMID"
    name="HTTP_CVHTAMID" value= "<%= TAMID%>" >

Maybe you are looking for

  • KO88 - Error when settling for Cost Center AND Auc for the same Internal Or

    Hi Experts, We need to configure Investment Internal Orders that could settle to both Cost Center and Auc, but each assignments with different Source Cost Elements We did the following: 1. Created Auc Class 2. Created Investment Profile "IMOBIL" and

  • Unable to Retrieve Attributes from LDAP Server

    I have a problem. I was wondering if anyone can assist me. I am new to LDAP servers and JNDI. I cannot retrieve any attributes from the users listed in my data entry. Any assistance would be greatly appreciated! Thanks. I created an entry in the LDAP

  • What's everyone gonna do for 5.1 as well as video monitoring in Studio 2?

    Anyone using a Decklink or a KONA card and then monitoring audio through a seperate device? Are you having sync issues? What's the best way to do this? Thanks for any input! Bob

  • $10 reward certificat​e for buying COD question

    I've pre-ordered Call of Duty: Advanced Warfare for the XBox One at a Best Buy but I am considering getting the Atlas Pro Digital Card Edition instead rather than the disc version. Does the $10 bonus certificate only apply to disc copies or it can al

  • What can I do after IMPORT_PROPER error

    I want update sp 09-15, now error occurs, I can't reset the  queue status either: You cannot reset the queue from import phase 'IMPORT_PROPER' What can I do to rescue the system? SE16,SE38 can't work.