Starting workflow with HTTP-Post

Hello,
like I wrote in Starting workflow with HTTP-Post I have a problem with starting a workflow with a http-post:
I have an installation of SAP ERP 2005 SR2 IDES on Win2003 SR2 SP2 and want to start a simple workflow with an external application. Therefor I created an elementary test-workflow and set the general task flag so everybody is allowed to start it. So far everything work fine as I start it manually.
Now I want to start the workflow by an external application over a HTTP-Post as described in
http://help.sap.com/saphelp_47x200/helpdata/EN/54/de9e3887d6174fe10000009b38f842/content.htm
I configured the webserver (Customizing Web-Server) as follows:
Service: WebFlow (Intranet)
Address: http://192.168.0.216:8000/
Path: SAP/BC/WORKFLOW_XML/?
and sent a post via perl to http://192.168.0.216:8000/SAP/BC/WORKFLOW_XML/?protocol=01&localkey=WS99900004
<?xml version="1.0" ?>
<WfMessage Version="1.0" xmlns="http://www.wfmc.org/standards/doc/WF-XML">
<WfMessageHeader>
<Request ResponseRequired="No">
<Key>http://192.168.0.216:8000/SAP/BC/WORKFLOW_XML/?protocol=01&localkey=WS99900004</Key>
</WfMessageHeader>
<WfMessageBody>
<CreateProcessInstance.Request StartImmediately="true">
<ObserverKey>http://192.168.0.224</ObserverKey>
</CreateProcessInstance.Request>
</WfMessageBody>
</WfMessage>
The Web-Server returns
C:\FH\SAP\perl-scripte>perl http-post.pl
HTTP/1.1 200 OK
Server: SAP Web Application Server (1.0;700)
Content-Length: 0
Content-Type: text/plain
Client-Date: Sun, 01 Jun 2008 11:00:24 GMT
Client-Peer: 192.168.0.216:8000
Client-Response-Num: 1
but it seems that nothing happens.
I also tried to post the XML via html-form-field with the same result.
Did I forgot something essential?

Hello Daniel
It's 6 years after you posted your question, but I found your post very useful and thought it would be worth updating for future reference.
I've just managed to trigger a workflow via http.
URL :
http://server.domain:8000/sap/bc/workflow_xml?sap-client=110
Java :
URL obj = new URL(url);
URLConnection con = (URLConnection) obj.openConnection();
String userpass = "username:password";
String basicAuth = "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(userpass.getBytes());
con.setRequestProperty ("Authorization", basicAuth);
con.setRequestProperty("Content-type", "text/xml");
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.write( xml.getBytes("UTF-8") );
wr.flush();
wr.close();
You can then read the response.
I found that until I added the sap_client parameter I couldn't debug in CL_HTTP_WORKFLOW_XML->IF_HTTP_EXTENSION~HANDLE_REQUEST. Then I found that the content type has to be "text/xml".
I set the xml variable (the data sent to ECC) to :
<?xml version="1.0" ?>
<WfMessage Version="SAP.1.0" xmlns="http://www.wfmc.org/standards/doc/WF-XML">
<WfMessageHeader>
<Request>
<ResponseRequired>Yes</ResponseRequired>
</Request>
<Key>HTTP://server.domain:8000/SAP/BC/WORKFLOW_XML/?~localkey=WS90000074</Key>
<Operation>CreateProcessInstance</Operation>
</WfMessageHeader>
<WfMessageBody>
<CreateProcessInstance>
<Key>HTTP://server.domain:8000/SAP/BC/WORKFLOW_XML/?~localkey=WS90000074</Key>
<ContextData>
<YOUR_CONTEXT_VARIABLE>x</YOUR_CONTEXT_VARIABLE>
</ContextData>
<StartImmediately>Yes</StartImmediately>
</CreateProcessInstance>
</WfMessageBody>
</WfMessage>
regards
Steve

Similar Messages

  • Working with HTTP-POST Submit Button

    I've created a form that uses a submit button with HTTP-POST.   I've tested this against a script that displays the fields, however, I'd like to table the posted data to SQL.   Can someone show me some code to parse this data with CGI, or PHP?

    Yes. At some point you will need to prarse the requests and treat them differently - because a POST is NOT the same as a GET.
    Anyway, just place the variables or script-links to the variables in an HTML Form.
    Very easy stuff.

  • Error Unexpected end of file from server with HTTP POST

    Hi everyone,
    I'm coding a simple client to download some information from a local machine in my LAN.
    I have to do this with an http post request.
    When i try to parse the http response the program catch an exception, this one:
    java.net.SocketException: Unexpected end of file from server
    at sun.net.www.http.HttpClient.parseHTTPHeader(...)
    the parameter is a JSON request, and of course the response is a JSON formatted.
    i put the http request code:
    import java.io.BufferedInputStream;
    import java.io.BufferedReader;
    import java.io.ByteArrayOutputStream;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.net.HttpURLConnection;
    import java.net.URL;
    public class HttpDownloaderThread  extends Thread{
         private String url;
            private String param;
         private HttpDownloadListener listener;
         private HttpURLConnection connection=null;
         private InputStream is;
            private OutputStreamWriter wr;
         public HttpDownloaderThread(String _url,String param, HttpDownloadListener _listener){
              url = _url;
              listener = _listener;
                    this.param=param;
         public void run(){
              try{
                   connection=(HttpURLConnection)new URL(url).openConnection();
                            connection.setRequestMethod("POST");
                            connection.setReadTimeout(5000);
                            connection.setRequestProperty("Content-Type", "application/jsonrequest");
                            connection.setDoOutput(true);
                            wr = new OutputStreamWriter(connection.getOutputStream());
                            wr.write(param, 0, param.length());
                            wr.flush();
                            int responseCode=0;
                   System.out.println();
                            try{
                             responseCode= connection.getResponseCode();
                            }catch(Exception e){
                                e.printStackTrace();
                   if (responseCode == HttpURLConnection.HTTP_OK){
                        is = connection.getInputStream();
                                     BufferedReader rd = new BufferedReader(new InputStreamReader(is));
                                    String line;
                                    while ((line = rd.readLine()) != null) {
                                        System.out.println(line);
                        closeHttpConnection();
                        listener.resourceDownloaded(url, null);
                                else{
                                closeHttpConnection();
                                listener.downloadFailed(url, new Exception("Http error: " + Integer.toString(responseCode)));
              }catch(Exception e){
                   e.printStackTrace();
                   listener.downloadFailed(url, e);
              }finally{
         public void closeHttpConnection(){
              if (is != null){
                   try{
                        is.close();
                                    wr.close();
                   }catch (Exception e){
                   }finally{
                        is = null;
                                    wr=null;
              if (connection != null){
                   try{
                        connection.disconnect();
                   }catch (Exception e){
                   }finally{
                        connection = null;
    }there's someone who know's why??
    Thanks to everyone :)
    Thomas.

    jole_star wrote:
    this problem also happen to me,.So since you provided actually no information about your problem you are going to get exactly the same response.
    Please don't hijack old threads. Start your own and provide much much much more information.
    I shall lock this thread.

  • Need help with http POST concept

    hi i just started learning about HTTP..im trying to pass a value from a thin java client from command prompt through POST method directly to a destination (another java bean) without any HTML/jsp (no pages) .
    i've created a caller.java which is used on command prompt :
    java caller param1 param2
    then, this caller will actually point to a struts path on my server, (which i think is a servlet) and do proper processing.
    caller.java :
    public static void main(String[] args) {...
    String url = str + "/do_something/prog0001_getAnswer?" +
         "param1=" + args[0] +
    "&param2=" + args[1];
    URL server = new URL(url);
    HttpURLConnection connection =
    (HttpURLConnection) server.openConnection();
    connection.setRequestMethod("POST");
    connection.connect();
    System.out.println("connecting to server..... " + connection.getResponseMessage());
    then on servlet :
    httprequest's .getParameter("param1");
    httprequest's .getParameter("param2");
    to obtain the values.
    even if set my URL's instance (server) 's RequestMethod to POST, i'm still able to obtain the parameter values in the servlet? I thought POST method requires different way to pass the values to a servlet? i've been searching..the most i could get are examples with HTML's FORM's name attribute

    What method have you written in Servlet?
    service, doGet or doPost.
    If you have written service, then it does not matter what mthod you specified.

  • Start workflow with f. module to trigger event and how to pass data to BOR?

    Hi,
    I have a custom BOR object, with Event "Created". I have also an attribute in this BOR, just simple field Plant.
    I have prepared a custom Workflow which is triggered when event Created of that custom BOR business object is raised.
    To raise an event and to start a workflow I run f. module SAP_WAPI_CREATE_EVENT.
    I have a problem to pass a Plant value to the Workflow container. In the PFTC_CHG for my Workflow I made the container
    of BOR object, and the data binding &_EVT_OBJECT& => &MATREQ&  (symbol of my BOR).
    Below both of EVTOBJECT and MATREQ I can see my field Plant.
    Then I run f. module SAP_WAPI_CREATE_EVENT with tables parameter input_container.
    I try to fill the data in many ways, but the started workflow does not have Plant filled.
    I try to use '_EVT_OBJECT.WERKS' in field name for input_container parameters.
    Business Object is passed to the Workflow container, but I do not get the fields
    as attributes. Do I have to use the parameters for the event Created ?
    Thank you in advance
    Wojtek

    Hello,
    I've never used GUID as a key but I suppose the principles are the same - the object instance is equivalent to "something", say a widget.
    This widget has attributes, e.g. the factory where it was created, the day it was created, its weight etc.
    If you make a widget BOR object and you specify attributes then you're telling SAP how, given the key, it can deduce the value of the attributes. Widget 1234's weight can be looked up in table XXX by doing this select.
    If you pass an object instance to a workflow then all you need to pass is the type of object and the key, the rest can be done by the workflow (or any other program). It can instantiate the object, and the attribute values are immediately available.
    If you can instantiate the object in SWO1 and the attributes get values, then it should work in the workflow as well.
    If not, please provide the code of the attribute or describe how it finds the attribute value.
    regards
    Rick Bakker
    hanabi technology

  • Kerberos Ticket via Java to BW to access BW Querys with HTTP POST

    Hi and thanks for reading,
    im Working with 2004 and the NWDS SP10. We have a project which must show some reports from the HR system via backend and some BW Reports done with Web Application Designer 3.5.
    The user of the project application is able to select personnel numbers or org units in a tree UI element. At design time we do not know hwo many of each he might select (could be a couple of hundreds or even more).
    A URL isn't long enough to support our needs (255 characters border)
    A consultant said that we should use HTTP Post with a Form. He gave me an example like this
    <HTML>
    <BODY>
    <form name="querySelektion" action="<system name>" method="POST">
              <input type="submit" value="Formular senden" />
              <!-- Template Parameter -->
              <input name="SAP-LANGUAGE" type="hidden" value="D" />
              <input name="PAGENO" type="hidden" value="1" />
              <input name="CMD" type="hidden" value="LDOC" />
              <input name="TEMPLATE_ID" type="hidden" value="Z_TEST_AX" />
              <!-- Selektionsparameter -->
              <input name="var_name_1" type="hidden" value="H1_ORGST" /></td>
              <input name="VAR_NODE_IOBJNM_1" type="hidden" value="0ORGUNIT" />
              <input name="var_value_ext_1" type="hidden" value="50058503" />
         </form>
    </BODY>
    </HTML
    This is working beside the fact that i have to fill in my BW username and password. I translated this to Java with  the Jakarta HTTP Librarys into the following code.
    try
                HttpClient httpClient = new HttpClient();
                PostMethod post = new PostMethod("http://<system name>");
                NameValuePair[] data =
                        new NameValuePair("SAP-LANGUAGE", "D"),
                        new NameValuePair("PAGENO", "1"),
                        new NameValuePair("CMD", "LDOC"),
                        new NameValuePair("TEMPLATE_ID", "Z_TEST_AX"),
                        new NameValuePair("var_name_1", "H1_ORGST"),
                        new NameValuePair("VAR_NODE_IOBJNM_1", "0ORGUNIT"),
                        new NameValuePair("var_value_ext_1", "50058503")};
                post.setRequestBody(data);
                int iReturnCode = httpClient.executeMethod(post);
                wdContext.currentContextElement().setTextView(Integer.toString(iReturnCode ));
                post.releaseConnection();
            } catch (IOException ioe)
                wdContext.currentContextElement().setTextView(ioe.getMessage());
    All i get is an Error 401 which means "Not Authorized". The Portal (where the application is running) and the BW do both support Single Sign On and the BW System is configured in the Portal.
    I think the HTTP Post is to generic. I also think that i need to make a authorization before and post the Kereberos Ticket to the BW before.
    But how can i accomplish that? Is there a SAP HelperClass to configure or establish system connections of SSO enabled systems?
    Or is the approach with the HTTP Post in java wrong, maybe there is an easier way to do transfer a lot of personnel or orgunit numbers to the BW Query?
    Thanks in advance,
    Kai Mattern

    Since you mentioned, I now tried to modify the writeToFile method in a few ways (closing the streams, directly setting them to null...), but the "java.lang.IllegalStateException: Already connected" exception remains there
    Actually I suppose this has no effect on the originally reported cookie problem, because if I just completely remove this logwriting (+ the following URL disconnect-reconnect) from the code, the situation is the very same
    I paste my modified writeToFile method anyway, maybe you can tell what I do wrong here, and I can learn from that
        public void writeToFile ( HttpURLConnection urlConnection, String filename ) {
          try {
            BufferedReader bufferedReader = null;
            InputStreamReader inputStreamReader = null;
            // Prepare a reader to read the response from the URLConnection
            inputStreamReader = new InputStreamReader(urlConnection.getInputStream());
            bufferedReader = new BufferedReader(inputStreamReader);
            String responseLine;
            PrintStream printStream = new PrintStream(new FileOutputStream (filename));
            // Read until there is nothing left in the stream
            while ((responseLine = bufferedReader.readLine()) != null)
                printStream.println(responseLine);
            inputStreamReader.close();
            bufferedReader.close();
            inputStreamReader = null;
            bufferedReader = null;
            printStream.close();
          catch (IOException ioException) { /* Exception handling */ }
        } //writeToFile()

  • Workflow with invoice posting

    Hello,
    I have to trigger a workflow at the time of invoice posting. I have tried business object BUS2081, BKPF & BSEG.  The workflow is triggered after MIRO but when I try to post using FB60 the workflow is not triggered.
    Can anyone help, please
    Thanks,
    Scott

    Hi Scott:
    Did your solution work for workflow with FB60 ?  I was initially tryng to find a user exit where I could use WF ABAP functions to raise an event to force the triggerrng of workflow to send notification e-mails for Invoice approvals.
    I am trying to do something similiar to what you did, but did not want to do the following set-up below if it did not work for you.
    <i><b>"Financial Accounting - AR and AP - Business transactions - Incoming Invoices/ Credit Memos - Carry Out and Check Settings for Document Parking
    The above node has to be configured for events to be triggered through FB60
    If you are using document parking Workflow then the business object to be used is FIPP & not BUS2081, BKPF or BSEG & if you maintain the WF settings as mentioned by Kiran, I think it should work"</b></i>
    Thanks,
    Ernesto

  • Need JDeveloper Web Service with HTTP POST method

    Hello all,
    I am creating a Web Service from a java class using JDeveloper. The wsdl created uses a SOAP binding. When I test the web service, either through JDeveloper or by deploying to OAS, the HTTP request created uses the HTTP GET protocol. I am assuming that this would be the same for anybody doing this.
    I need to know how to change it to be an HTTP POST protocol instead.
    The reason that I need to try and use the POST method is that the xml needed by the service holds a lot of data and the http server is giving me a "URI too long" error. I have read and been told that using POST instead of GET would help this, but I can't figure out what to change to make this happen. I am not sure if I have to make a change in the generated wsdl or somewhere else. Or if it just won't work that way.
    Any help you can provide would be appreciated.
    Thanks,
    rob

    Hi Ayush,
    Please refer -
    http://biemond.blogspot.com/2010/08/http-basic-authentication-with-soa.html
    Regards,
    Anuj

  • Fill a Google form with http POST VI

    Dear LabVIEW forum,
    I am trying to fill a very simple Google form consisting in 4 text fields named AI0, AI1, AI2 and AI3.
    I use the http POST VI provided by LabVIEW:
    When I execute this, a new line is added to the response spreadsheet, but the values don't appear, except for the timestamp.
    What am I doing wrong?
    Thanks!
    LabVIEW 2013 SP1
    Windows 7 64bit
    Windows Server 2012 64 bit
    Windows 8.1 32 bit
    Solved!
    Go to Solution.

    Hi
    I had a quick look at the form and the text next to the input boxes is AI0 ... but the names of the input text boxes are not AI0 etc. You may have to get the page first and then parse the page for the name of the entry.
    <input type="text" name="entry.2117155241" value="" class="ss-q-short" id="entry_2117155241" dir="auto" title="">
    Mike

  • Start workflow with BAPI / RFC

    HI!
    I want to start a workflow in Business workflow by RFC. Are there any BAPI for this that i can use. ?

    Hey Dominik,
    Use following FM to start Workflow
      <b>SPH_SWW_WI_START_SIMPLE - RFC
      SWW_WI_START_SIMPLE - Normal FM</b>
    You can pass data by using parameter WI_CONTAINER in TABLES tab.
    Reward points if the answer is helpful.
    Thankx,
    Mukul

  • BPEL process with http-POST service doesn't work

    Hi OraclePM community,
    i tried to test a http-POST service. The message i wanted to send is very simple:
    <?xml version="1.0" encoding="UTF-8"?>
    <GetFeature service="WFS">
    <Query typeName="states"/>
    </GetFeature>
    In the POST-service wsdl:types/xsd:schema i created this new element to ingest the request-xml:
    <xsd:element name="GetFeature">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Query"/>
    </xsd:sequence>
    <xsd:attribute name="service" use="required" type="xsd:string"/>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="Query">
    <xsd:complexType>
    <xsd:attribute name="typeName" use="required" type="xsd:string"/>
    </xsd:complexType>
    </xsd:element>
    I made the same in the bpel-service wsdl for input-variable definition. When i deployed the bpel process and went to the automatically generated client then i had only two input-boxes. One box to type in the 'service' (which is signed as string) and another box to type in the 'Query' (which is signed as anyType). But thats a wrong interpretation of my wsdl. I should type in the 'typeName' which is also a string. Therefore i get an exception at the invoke: "Argument 'GetFeatureIn' is not compatible".
    O.K. i tried something different: In the client i din't choose the option 'html-form' but the option 'xml-source' and copied the request-xml in there. The result was another exception earlier (the first assign after the receive). The exception is: "error in evaluate <from>-expression in line "33". The result for the XPath-expression "/client:GetFeature" is empty"
    Can anybody help me?
    Kind regards
    Albrecht

    sure you send the right xml?
    what I would try is to copy the xml from the receive, paste and extend it, and see if this works . . these errors are mostly because of no namespace defined or such ..
    sure your element has the right namespace?
    hth clemens
    2)
    here is the xml for the following schema ..
    XML
    <ns1:AttributetestProcessRequest xmlns:ns1="http://xmlns.oracle.com/Attributetest">
    <ns1:input/>
    </ns1:AttributetestProcessRequest>
    schema
    schema attributeFormDefault="unqualified"
         elementFormDefault="qualified"
         targetNamespace="http://xmlns.oracle.com/Attributetest"
         xmlns="http://www.w3.org/2001/XMLSchema">
         <element name="AttributetestProcessRequest">
              <complexType>
                   <sequence>
                        <element name="input" type="string"/>
                   </sequence>
    <attribute name="service" use="required" type="string"/>
              </complexType>
         </element>
         <element name="AttributetestProcessResponse">
              <complexType>
                   <sequence>
                        <element name="result" type="string"/>
                   </sequence>
              </complexType>
         </element>
    </schema>
    it works design and runtime in 10.1.3.1
    Message was edited by:
    clemens.utschig

  • NEed help with HTTP Post

    I am doing an application to login to www.ideas.singtel.com website. There is no error but how do i know that my userName & password is verified?
    [codeimport java.net.*;
    import java.io.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.net.ssl.*;
    class demo_process implements Runnable, ActionListener
         private Thread on;
         //Create Output & Input Stream
         //Connection
         private URL url;
         private URLConnection connection;
         //Create The GUI
         demo client1;
         public void actionPerformed(ActionEvent e)
              String command = e.getActionCommand();
              //TC_MainGUI1 Action Performed
              if(command == "Log In"
              && !(client1.userName.getText().equals(""))
              && !(client1.password.getText().equals("")))
                   on = new Thread(this);
                   on.start();
                   //sms client2 = new sms();
              else if(command == "Log In"
              && !(client1.userName.getText().equals("")))
                   JOptionPane.showMessageDialog(client1,
                   "Invalid Password");
                   client1.userName.setText("");
              else if(command == "Log In"
              && !(client1.password.getText().equals("")))
                   JOptionPane.showMessageDialog(client1,
                   "Invalid User Name");
                   client1.password.setText("");
              else
                   JOptionPane.showMessageDialog(client1,
                   "Invalid User Name & Password");
                   client1.userName.setText("");
                   client1.password.setText("");
         public demo_process(demo client1)
              this.client1=client1;
         public void run()
              Thread thisThread = Thread.currentThread();     
              //Establishing the connection
              try
                   url = new URL("https://www.ideas.singtel.com/myideas/AccessController.jsp?");
                   connection = url.openConnection();
                   login();
              catch(IOException e)
                   System.out.println("Cannot get connected!");
                   System.out.println(e);
         public void login()
              try
                   //Send the Mobile no. & Password
                   connection.setAllowUserInteraction(true);
                   connection.setDoInput(true);
                   connection.setDoOutput(true);
                   connection.setUseCaches(false);
                   connection.setDefaultUseCaches(false);
                   //Establish the Input & Output Streams
                   OutputStream ostream = connection.getOutputStream();
                   String send = "userName="+client1.userName.getText()+"&password="+client1.password.getText();     
                   byte[] send2= send.getBytes();
                   ostream.write(send2);
                   ostream.close();
                   System.out.println(send2);
                   System.out.println("Echo: " + client1.userName.getText());
                   System.out.println("Echo: " + client1.password.getText());
                   InputStream in = connection.getInputStream();
                   InputStreamReader r = new InputStreamReader(in);
                   int c;
                   while((c = r.read()) != -1)
                        System.out.println((char) c);
                   System.out.println(c);
                   in.close();
              catch(IOException e)
                   System.out.println(e);
    }]

    If "form2.php" processes the POST request then you shouldn't be sending it to "myform.php" in the first place.

  • Calling a Web Server with HTTP POST to retrieve XML in chunks

    Hi,
    I have to call a Web Server with the HTPP POST method by providing the user id and password. I am getting the xml as output from the web server in chunks. This is possible through net.HTTPUrlConnection Java Api. But does any body knows how to implement this through OSB.
    Regards,
    Anuj Maheshwari

    sample usage:
      CALL FUNCTION 'HTTP_POST'
        EXPORTING
          ABSOLUTE_URI                = IM_OFX_CONTROL_DATA-ADDRESS
          REQUEST_ENTITY_BODY_LENGTH  = RESPONSE_ENTITY_BODY_LENGTH
          RFC_DESTINATION             = IM_OFX_CONTROL_DATA-HTTP_RFCDEST
          USER                        = IM_OFX_CONTROL_DATA-HTTP_USER
          PASSWORD                    = IM_OFX_CONTROL_DATA-HTTP_PASSWORD
          BLANKSTOCRLF                = 'X'
        IMPORTING
          STATUS_CODE                 = STATUS
          STATUS_TEXT                 = STATUS_TEXT
          RESPONSE_ENTITY_BODY_LENGTH = RLENGTH
        TABLES
          REQUEST_ENTITY_BODY         = LT_REQUEST
          RESPONSE_ENTITY_BODY        = RESPONSE
          RESPONSE_HEADERS            = LT_RESPONSE_HEADERS
          REQUEST_HEADERS             = LT_HTTP_HEADERS
       EXCEPTIONS
            OTHERS                      = 1.
    Refer the programs:
    LFPIFF02            
    LOFXALSU04          
    LPRGN_URL_RESPONSEU01
    LSBCCU01            
    LSFTPU09            
    for some idea.
    regards,
    ravi

  • Submitting a PDF with HTTP Post

    I am new to servlet programming.
    However, I have managed to create a servlet to handle PDF submissions from an HTML form. The parameters used are
    <input type="file" name="datafile" size="40">
    <input type="submit" value="Send">
    I am using the datafile as the parameter in the servlet for the PDF. I would like to create the same functionality where I can submit the entire PDF form the PDF.
    What is the format to submit the file type parameter with datafile as the name ?
    Aditya

    Hi,
    As I know you can determine this parameter in PDF form? you can only submit whole PDF file to some link. This means you have o write one more servlet to handle submitting from pdf form.
    Check this http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/wwhelp/wwhimpl/common/ht ml/wwhelp.htm?context=sdkHelp&file=000309.html
    http://forums.adobe.com/message/1354202
    BR

  • Problems with HTTP POST - HttpConnection

    I am trying to send the data of a Textfield via a HttpConnection and POST Method.
    Therefore, the Content-length request header is set to to length of the byte-Array accordingly.
    Problem:
    If Content-length is not set, the data is written to the output stream but then - i guess - the servlet doesn't parse the body of the request and request.getParameter("username") does not work from the servlet.
    If it is set (Content-length), the data is not being transmitted!
    connection = (HttpConnection)Connector.open("http://localhost:8080/servlet/VpeNetworkServlet");
    connection.setRequestMethod(HttpConnection.POST);
    //Build the Postmessage
    String requestBody = "username=" + username;
    //Transform the String to a Byte-Array
    byte postMessage[] = requestBody.getBytes();
    //set the length of content
    //connection.setRequestProperty("Content-length", String.valueOf(postMessage.length));
    //POST the data
    os = connection.openOutputStream();
    //Write it to the OutputStream
    os.write(postMessage);
    for (int i = 0; i < postMessage.length; i++)
    os.
    os.write(postMessage);
    //flush the buffer!
    os.flush();
    Can anyone help?? Submitting via GET works perfectly, but I prefer POST over GET.
    Thanx,
    SVEN

    Hi Yaron,
    do you have any suggestion about encoding data? I really have no idea about this. How to encode data and which technique we should use?
    Thanks
    Udsy
    Hi,
    There are 2 things that may help you :
    1. use:
    connection.setRequestMethod(HttpConnection.POST,READ_WR
    TE);
    2. Use:
    connection.setRequestProperty("Content-Type","applicati
    n/x-www-form-urlencoded" );
    Notice:
    You need to encode the data before sending it ovet
    http.
    Hope it helps,
    Yaron G.

Maybe you are looking for