HTTP Servlet call

Hi all,
I have a BPM scenario where i have several conditional branches, and in one of the branch i have to make a HTTP Servlet call via HTTP adapter and pass some values from the incoming message in the HTTP post.
Is this just like a normal HTTP adapter call or HTTP servlet is something diffrent from a normal adapter call?
anybody has done similar HTTP servlet calls ? aplease share your thoughts.
Thanks

Hi,
Its same to the normal HTTP Call but at the BPM you meight need to give conditions as you indicated...you give conditions in the Control step of BPM
Amaresh

Similar Messages

  • Servlets calls another servlet

    servlets calls another servlet ...how to do it ? whats the efficient way ?
    class myservlet extends HttpServlet
    // i want to call a servlet situated at another machine in the LAN whose, IP // 123.123.45.66 (say)
    the servlet which is situated in another machine
    remoteservlet extends HttpServlet
    doPost(...)
    how do i call ?
    few of the way i found by searching the forum.
    but i would like to know the good way in my situation.

    res.sendRedirect("LoginServlet?="+req.getRequestURI())
    i tested this. it does not work.
    my servlet wants to call another servlet which is
    active on IP xxx.ddd.ffff.zzz in the LAN .
    whats the way ?
    res.sendRedirect("http://xxx.ddd.ffff.zzz:<portnumber>/<context_name>/<servlet_regd_name">);The request and response objects are generated anew for that Servlet. There's no two ways about it, IMO.
    cheers,
    ram.

  • Non-HTTP servlet

              I need to support concurrent access from multiple clients using a non-HTTP protocol
              over socket connection. One way is to write my socket server and create a new
              thread for each request. But WLS forbids user-created threads from calling into
              WLS components such as EJB. So I would like to write a non-HTTP servlet so that
              the WLS servlet container will create a new thread calling into the servlet and
              have the servlet calling EJBs on this WLS created thread. But is there a way to
              plug a subclass of GenericServelt into WLS?
              Thanks,
              T Tse
              

    I don't think there is a way to use non-HTTP servlet's, but still you can use WLS
              execute queue and execute threads, for example:
              ServerSocket serverSocket = new ServerSocket(...);
              for(;;) {
              new MyThread(new RequestHandler(serverSocket.accept())).start();
              class RequestHandler implements Runnable {
              Socket socket;
              public RequestHandler(Socket socket) {
              this.socket = socket;
              public void run() {
              // to see if this is executing on a WebLogic execute thread
              new Exception().printStackTrace();
              try {
              socket.close();
              } catch(Throwable whatever) {}
              class MyThread implements Schedulable, Triggerable {
              boolean done = false;
              Runnable runnable = null;
              Object sync = new Object();
              ScheduledTriggerDef std;
              public void join() throws InterruptedException {
              synchronized(sync) {
              if(!done) {
              sync.wait();
              public void run() {
                   if(runnable != null) {
                   runnable.run();
              public MyThread() {
              public MyThread(Runnable runnable) {
                   this.runnable = runnable;
              public boolean start() {
                   boolean ok = false;
                   try {
                   T3ServicesDef t3 = (T3ServicesDef)(new InitialContext()).lookup("weblogic.common.T3Services");
                   std = t3.time().getScheduledTrigger(this, this);
                   std.schedule();
                   ok = true;
                   } catch(NamingException ne) {
                   System.out.println(ne.getMessage());
                   } catch(TimeTriggerException tte) {
                   System.out.println(tte.getMessage());
                   return ok;
              public void trigger(Schedulable sched) {
                   try {
                   run();
                   } catch(Throwable t) {
                   System.out.println(t);
              synchronized(sync) {
              done = true;
              sync.notify();
              public long schedule(long time) {
                   return done ? 0 : 1;
              ttse <[email protected]> wrote:
              > I need to support concurrent access from multiple clients using a non-HTTP protocol
              > over socket connection. One way is to write my socket server and create a new
              > thread for each request. But WLS forbids user-created threads from calling into
              > WLS components such as EJB. So I would like to write a non-HTTP servlet so that
              > the WLS servlet container will create a new thread calling into the servlet and
              > have the servlet calling EJBs on this WLS created thread. But is there a way to
              > plug a subclass of GenericServelt into WLS?
              > Thanks,
              > T Tse
              Dimitri
              

  • How to send te XML data using HTTPS post call & receiving response in ML

    ur present design does the HTTP post for XML data using PL/SQL stored procedure call to a Java program embedded in Oracle database as Oracle Java Stored procedure. The limitation with this is that we are able to do HTTP post; but with HTTPS post; we are not able to achieve because of certificates are not installed on Oracle database.
    we fiond that the certificates need to be installed on Oracle apps server; not on database server. As we have to go ultimately with HTTPS post in Production environment; we are planning to shift this part of program(sending XML through HTTPS post call & receiving response in middle layer-Apps server in this case).
    how i can do this plz give some solution

    If you can make the source app to an HTTP Post to the Oracle XML DB repository, and POST contains a schema based XML document you can use a trigger on the default table to validate the XML that is posted. The return message would need to be managed using a database trigger. You could raise an HTTP error which the source App would trap....

  • How can i send xml file with a http servlet request

    Hi
    Please tell me how can I send a xml file into http servlet request.
    I have a servlet(action) java file.From this servlet I have generate a xml file. Now I need to send that xml file to another servlet with http servlet request object.
    Dave.

    When you say you have generated an XML file what do you mean?
    Is it a file stored on disk? Then pass the file path as a string to the servlet.
    Is it stored in memory as an object? The pass a reference to the object to the servlet.
    Or are you asking how to communicate between servlets?
    Look in the JavaDocs for the RequestDispatcher class. You can use this class to forward the request to another servlet. Data can be passes using the RequestDispatcher by storing it as attributes using the request getAttribute and setAttribute methods. Also described in the JavaDOcs.
    http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/RequestDispatcher.html

  • HTTP trigger - Calling failed - 9.0.2.10000-71

    Hi,
    I have created a HTTP trigger in Premium licensed UCCX server (9.0.2.10000-71). When I try to call the URL from java application I am getting HTTP error code as “404”. However HTTP trigger calling is working fine in the servers with the version of 8.5.1.11004-25 and 9.0.2.11001-24.
    Do I need to run any patch for the fix?  Please provide suggestion to fix it.
    Thanks
    Rammipriya

    Hi,
    there are multiple issues with this whole setup:
    1. You are getting a 404 status because this script does not return anything. Not a single byte of information. You should probably use a Send HTTP Response step with at least a plain text message.
    2. You cannot use anything from the sun.* packages. There is no exception from this rule. If you were in my team, for writing such code you would be thrown out without any questions asked.
    3. Although I see the point of this application (collect all files from the local file directory referenced by sysprop "uccx.customer.dir" I would not choose a slow and cumbersome protocol like FTP. I mean, if it's already a HTTP application, it would be a lot easier to get the files from the directory, zip them up (remember, both java.util.zip.GZIPOutputStream and java.util.zip.ZipOutputStream are available in JRE at least since 5.0) and send the zipped files over the already established HTTP connection. Fast and easy. 
    G.

  • HTTPS Servlet requests

              After installing service pack 9 from WL5.1, HTTPS servlet requests result in the
              browser returning a server error. Issue 41888 of sp9 seems to address this. We
              were previously running service pack 6 and didn't experience this problem. Any
              ideas?
              

    Have you installed SP9 properly?
              I just tried accessing example servlets on Https protocol and i don't see any
              errors.
              Could you tell us what problems you are facing? Any test case?
              Kumar
              Darren Collins wrote:
              > After installing service pack 9 from WL5.1, HTTPS servlet requests result in the
              > browser returning a server error. Issue 41888 of sp9 seems to address this. We
              > were previously running service pack 6 and didn't experience this problem. Any
              > ideas?
              

  • Non-http servlet engine?

    Hi, I'm new to servlet development and I'm not sure this question has been answered here before. So I apologize if it has.
    Basically I want to have an integrated server that can accept both http and non-http requests. So my initial thought was to write an HttpServlet and a GenericServlet. Then I googled for clues on how to implement that and found from the JavaRanch website http://faq.javaranch.com/java/ServletsFaq#otherProtocols that this task could be a daunting one because that'd imply that I have to write a new servlet engine.
    So my question is, is this true in your expert opinion? And, if the custom non-http protocol has a similar syntax as http (e.g. RTSP), is it possible to just extend the http servlet engine to support it? And would that be doable without much effort?
    Thanks,
    Liang.

    Would you actually need the entire servlet system for the new protocol? For your typical simple request/reply protocol you'd normally:
    Create a server socket.
    When a connection arrives, start a thread to service it.
    In the service thread, read and parse request.
    Send reply.
    Close socket, exit thread.
    A servlet system adds a bunch of stuff to that: a layer that allows you to configure pluggable request handlers; methdod-specific functions (POST -> doPost()); a ServletRequest object; etc. Are those things relevant to the new protocol? Do you have requests with URL-like things in the header, allowing routing requests to different servlets? Do you plan to have lots of servlets for the protocol (one servlet -> no much point in XML-configurable request routing)?
    I'd hope that I wouldn't need to implement a configurable request routing infrastructure. It's a lot of work if it's not really needed. Just write a socket server. If you have an associated web server (e.g. HTML pages from which the user starts RTSP requests) you can even run the socket server inside the servlet container if that helps.

  • QaaWS HTTP Servlet

    Hi All,
    Iam created a universe and qaaws query on the universe . Every thing is fine but while retrieving the QAAWS url into Xcelsius it showing unable to load URL . When iam paste URL on my Browser it is showing QaaWS HTTP Servlet(Input/Output exception occurred : 'C:\Program Files\Business Objects\Tomcat55\webapps\dswsbobje\WEB-INF\classes\qaawsWsdl.zip (The system cannot find the file specified)' )
    Thanks
    Praveen Yagnamurthy.

    Hi Chand,
    Check once WEbi server as well tomcat server in CMC ? Every thing is fine ask the basis guy weather he applied any patches in BO . If he applied the patches   just re produce the QAAws URl s i mean just choose your Created qaaws query Next >next>finish .DO the same for your QAAWS queries  it means that it will upgrade URLS to your Lower version to higher Version .

  • Doubt in Generic Servlet and Http Servlet

    Hi,
    I studied Genaric Servlet does not support state and session mengement and where as Http Servlet supports state and session mengement.
    Why Genaric Servlet does not support state and session mengement ?
    Can any one plz tell me reasons.

    GenericServlet is pretty much the most basic Java application that you can run server-side. It doesn't support much of anything except for the basic life cycle management and a couple other things. Go to Dictionary.com and lookup the word Generic. It's used a lot in software development. Go to http://java.sun.com/j2ee/1.4/docs/api/index.html to read more on the GenericServlet class.
    BalusC, because a thread hasn't been active in awhile doesn't mean it's dead. If it were dead it would not be editable. Moreover, the question was never answered (adequately).
    Edited by: wpafbuser1 on Jan 3, 2008 3:33 PM

  • Java Stored Procedure calling HTTP Servlet in Weblogic

    I am currently working on an e-commerce application for a brick-n-mortar electronics store. The store currently has an Oracle database that contains all of the products the store sells. The e-commerce site will have a separate Oracle database. Both database are Oracle 9i release 2 databases. The e-commerce site will be using BEA's Weblogic as its application server. I need to move data from the store db into the e-commerce db. The actual moving of the data is not the issue. The issue comes from needing to call several methods on a Stateless Session EJB, loaded on the Weblogic server, to perform backend processing. I wanted to make a JNDI call from a Java Stored Procedure but with Release 2, this option is no longer supported. The release notes (http://otn.oracle.com/tech/java/htdocs/9idb2_java.html) indicated that the JVM now supports calling out to Servlets using HTTP Client from a Java Stored Procedure.
    Has anyone done this? Is there any sample code available?
    Thanks for any help.

    I am currently working on an e-commerce application for a brick-n-mortar electronics store. The store currently has an Oracle database that contains all of the products the store sells. The e-commerce site will have a separate Oracle database. Both database are Oracle 9i release 2 databases. The e-commerce site will be using BEA's Weblogic as its application server. I need to move data from the store db into the e-commerce db. The actual moving of the data is not the issue. The issue comes from needing to call several methods on a Stateless Session EJB, loaded on the Weblogic server, to perform backend processing. I wanted to make a JNDI call from a Java Stored Procedure but with Release 2, this option is no longer supported. The release notes (http://otn.oracle.com/tech/java/htdocs/9idb2_java.html) indicated that the JVM now supports calling out to Servlets using HTTP Client from a Java Stored Procedure.
    Has anyone done this? Is there any sample code available?
    Thanks for any help. Hi,
    sorry we have not yet formally documented this but here is a code snippet
    Kuassi
    /* HttpCallout - simple test to callout to static pages from Java Stored
    Procedures */
    import java.io.IOException;
    import java.io.InputStream;
    import HTTPClient.HTTPConnection;
    import HTTPClient.HTTPResponse;
    import HTTPClient.AuthorizationInfo;
    public class HttpCallout {
    public static void main(String[] argv) throws InterruptedException {
    HttpCallout t = new HttpCallout(argv);
    t.run();
    private String[] argv ;
    HttpCallout(String[] argv) {
    this.argv = argv;
    void initSSL() {
    public void run() {
    try {
    if ( argv.length == 0 ) {
    System.out.println("HttpCallout " +
    "protocol " +
    "host " +
    "port " +
    "page ");
    return;
    // process arguments
    int argc = 0;
    String protocol = argv[argc++];
    String host = argv[argc++];
    int port = Integer.parseInt(argv[argc++]);
    String page = argv[argc++];
    // Debugging - don't set for now
    // System.setProperty("HTTPClient.log.mask", "3");
    // noop
    initSSL();
    // Grab HTTPConnection
    HTTPConnection con = new HTTPConnection(protocol, host, port);
    con.setTimeout(20000);
    con.setAllowUserInteraction(false);
    // Grab Response
    HTTPResponse rsp = con.Get(page);
    byte[] data = rsp.getData();
    if ( data == null ) {
    System.out.println("no data");
    } else {
    System.out.println("data length " + data.length);
    System.out.println(new String(data));
    catch ( Throwable ex ) {
    ex.printStackTrace();

  • Servlet calling a BAPI Web Service...

    Hi everyone,
    I downloaded the wsdl file for the BAPI_USER_GETLIST.
    I created a Deployable Proxy that points to this wsdl file.
    I created a Web modul project with a servlet.
    I also created an Enterprise application project that contains my Web modul project.
    In the Web modul project, I created  a servlet :
    Here is the code of the servlet :
    <b>try {               
         InitialContext ic = new InitialContext();                    
         BAPI_USER_GETLISTService sampleWS = (BAPI_USER_GETLISTService)ic.lookup("java:comp/env/SampleWSProxy");
         BAPI_USER_GETLISTPortType vi = sampleWS.getLogicalPort();
         BAPI_USER_GETLIST importParams  = new BAPI_USER_GETLIST();
         ArrayList list = new ArrayList();
         BAPIUSNAME structure = new BAPIUSNAME();
         structure.setUSERNAME(new String());
         structure.setFIRSTNAME(new String());
         structure.setLASTNAME(new String());
         structure.setFULLNAME(new String());
         list.add(structure);
         BAPIUSNAME[] rows = new BAPIUSNAME[list.size()];
         list.toArray(rows);
         importParams.setUSERLIST(rows);
         importParams.setWITH_USERNAME("X");
         BAPI_USER_GETLISTResponse exportParams = null;
              BAPIUSNAME[] res = vi.BAPI_USER_GETLIST(rows,"");
              for(int i=0;i<res.length;i++)
                   response.getWriter().write(res<i>.getFIRSTNAME());
    } catch(Exception e)
              response.getWriter().write("ERROR!!!" + e.getMessage());
    </b>
    The exception is :
    <b>ERROR!!!Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (401) Unauthorized.</b>
    Can someone help with this security problem ?
    Is the code OK except the security problem ?
    Thanks a lot.

    Hi David,
    Before calling a BAPI, we have to make a connection to
    R/3. Try following code...
    import com.sap.mw.jco.*;
    public class TutorialConnect1 extends Object {
       JCO.Client mConnection;
       public Connect1() {
         try {
           // Change the logon information to your own system/user
           mConnection =
              JCO.createClient("001", // SAP client
                "<userid>", // userid
                "****", // password
                null, // language
                "<hostname>", // application server host name
                "00"); // system number
           mConnection.connect();
           System.out.println(mConnection.getAttributes());
           mConnection.disconnect();
        catch (Exception ex) {
          ex.printStackTrace();
          System.exit(1);
      public static void main (String args[]) {
        Connect1 app = new Connect1();
    This code from sap help, for details visit this link..
    http://help.sap.com/saphelp_erp2004/helpdata/en/bc/42e13d82fcfb34e10000000a114084/frameset.htm
    Hope this helps.
    Regards,
    Narinder Hartala

  • Problem with servlet call within servlet

    I have already a servlet that generates a jpeg images that works fine.
    a second servlet generates an pdf document via the iText library and works also fine.
    the problem or question is how to call the first servlet to insert an
    image into the generated pdf??
    tia
    marky

    Have a look to HttpURLConnection object (in java.net package). A example of the code :
    URL url = "http://myServer/myJpegServlet";
    HttpURLConnection uc = (HttpURLConnection) url.openConnection();
    uc.setDoInput(true);
    uc.setUseCaches(false);
    uc.setAllowUserInteraction(false);
    InputStream dataIn = uc.getInputStream();
    byte[] buf = new byte[512];
    while( (dataIn.read(buf)) != -1 ) {
    //Do what you want with the data
    datain.close();
    uc.close;
    Hope this helps!
    Simon Pierre NOLIN

  • Streaming XML file content to a HTTPS servlet..

    Hi,
    I want to stream the contents of a XML file , which I have generated through XDK for PL/SQL, to a HTTPS address for a servlet.
    This HTTPS connections uses certifcates for user authentication. I have the certifcate on my local machine. Is there anyway of doing this through PL/SQL? Are there any packages available in Oracle 8.1.6 for this purpose? Can somebody tell me if there is a better way of doing this?
    Any help will be greatly appreciated.
    Thanks.

    After some additional trials I found a solution by calling the stored procedure in this way
    DBSetAttributeDefault (hdbc, ATTR_DB_COMMAND_TYPE, DB_COMMAND_STORED_PROC);
    DBPrepareSQL (hdbc, "usp_InsertReport");
    DBCreateParamInt (hstmt, "", DB_PARAM_RETURN_VALUE, -1);
    DBCreateParamChar (hstmt, "XMLCONTENT", DB_PARAM_INPUT, sz_Buffer, (int) strlen(sz_Buffer) + 1 );
    DBExecutePreparedSQL (hstmt);
    DBClosePreparedSQL (hstmt);
    DBGetParamInt (hstmt, 1, &s32_TestId);
    where sz_Buffer is my xml file content and s32_TestID the return value of the stored procdure (usp_InsertReport(@XMLCONTENT XML))
    Now I face the problem, that DBCreateParamChar limits the buffer size to 8000 Bytes.
    Any idea to by-pass this shortage??

  • NullPointerException by Servlets Calls

    if I call a Servlet "http://www.myhost.ch:8080/testing/Hello", I receive the follwoing Errormessage:
    Error: 500
    Location: /testing/Hello
    Internal Servlet Error:java.lang.NullPointerException at java.lang.ClassLoader.resolveClass(ClassLoader.java)
    Hello is a Servlet in Subfolder /testing/WEB-INF/classes
    Web.xml:
    <servlet-name>Hello</servlet-name>
    <servlet-class>com.msi.servlet.HelloWorld</servlet-class>
    <servlet-mapping>
    <servlet-name>Hello</servlet-name>
    <url-pattern>/Hello</url-pattern>
    </servlet-mapping>
    The JSP-Site "http://www.myhost.ch/testing/test.jsp", works fine.
    Can anyone help?

    From my experince the resource does not receive the right parameter from the client (HTML) so if u tried to set a parameter inside your receiving server side resource ,it will throw a NullPointerException
    for example:
    String param=request.getParameter("parameter_in_HTML_form");
    param will throw a NullPointerException if it does not get a clean value.
    Could you check.
    Also your web.xml file seems to be in good shape i wouldnt go there lokking for an error.
    good luck

Maybe you are looking for

  • Statistic Report - Key Figures Definition - Infoprovider 0TCT_MC01

    Hi Colleagues, What is the meaning of the KF 0TCTQUCOUNT ? Count for BI ApplObj ? It count the number of acces to a query by a user ? the number of navigational step in the query ? Thanks

  • Which collection should I use

    As I'm scanning an XML file gathering anchors, I'd like to associate the data with the file the anchor came out of. So there could be multiple anchors associated with a file, and that same file name could be an anchor itself in another file. I'd like

  • Premiere Pro makes it hard to use keyboard shortcuts

    I'm using CC 2014, but this has been a problem for many versions: as soon as I do almost anything, the timeline loses focus, so the editing shortcuts don't work, and the machine only beeps when I press a key combination. I have to remember to keep pr

  • Downloaded application from internet are not resuming aft OS restart.

    I am downloaded one antivirus from internet. It started downloading the latest defination and while downloading I restared the OS.... So I believe it should also resume as it is an OS feature ?right My 2nd que is if it is not resuming then this shoul

  • Log in problem with bridge

    I am having a problem exporting from bridge to facebook ( photos). When I try to log onto facebook from bridge a warning comes up and says " treat the above url as a password do not share with anyone."    It then prevents me from logging onto faceboo