How to develop Asynchronous Document Based WebServices?

Hi gurus,
The scenario is, We are developing an architecture where Asynchronous Document Based WebServices are desired.
As per my knowledge, This architecture includes some
work at JMS side.
Meaning,
Client -
> Calling [WebService] -
> Deletgate --
>JMQ (Java Message Queue)
Would appreciate ur thoughts here...
Regards,
Arvind Kugasia [[email protected]]

Hi Arvind,
this "pattern" - sending JMS message and performing some long asynchronous tasks in MDB is a standard J2EE way.
That should be supported by any j2ee server that at least covers J2EE 1.3 (where MDB-s are introduced). That includes the SAP Web AS as well and its JSM and EJB implementation as well.
The message can be sent from a servlet, web service, etc.
In fact the classic petstore application released from sun as a model for developing J2EE applications uses MDB-s for that purposes :
http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/sample-app/sample-app1.3.1.html
Once you buy the parrot from the petstore, you will see the response page while the MDB will perform asynchonously the sending of the mail, charging of the account, etc.
It doesn't matter if the front end is a web service or a HTTP UI.
In addition you can google for any J2EE tutorial and MDB explanation.
However please note that I am speaking how your application will gather the parameters from the web service call, put them in a JMS message and send the message via several lines of java code.
Perhaps some other frameworks (Apache-Axis, etc.) are doing this automatically for you or are generating the code that sends the message via some wizard.
That up to my knowledge is not supported for SAP WebAS, but that is only a 10 lines of code inside the web service body, that can be easily created.
HTH
Peter

Similar Messages

  • Document based webservice failed

    Hello:
    I am trying to invoke a document style webservice
    I am getting this error any idea why I am getting this.
    I am returning a Document object which I created using DOM
    Failed to invoke service:
    java.util.EmptyStackException at java.util.Stack.peek(Stack.java:79) at
    java.util.Stack.pop(Stack.java:61) at
    weblogic.xml.babel.stream.DOMNodeWriter.write(DOMNodeWriter.java:125) at
    weblogic.xml.babel.stream.DOMNodeWriter.write
    regards
    Boney Jose

    Hello,
    This error is unfamiliar and there is not enough information in your
    post to ascertain the cause. Have you tried the examples of document
    based webservices that Manoj has [1]? I think they would be helpful in
    your efforts.
    Regards,
    Bruce
    [1]
    http://manojc.com/?sample13
    http://manojc.com/?sample14
    http://manojc.com/?sample31
    http://manojc.com/?sample43
    Boney Jose wrote:
    >
    Hello:
    I am trying to invoke a document style webservice
    I am getting this error any idea why I am getting this.
    I am returning a Document object which I created using DOM
    Failed to invoke service:
    java.util.EmptyStackException at java.util.Stack.peek(Stack.java:79) at
    java.util.Stack.pop(Stack.java:61) at
    weblogic.xml.babel.stream.DOMNodeWriter.write(DOMNodeWriter.java:125) at
    weblogic.xml.babel.stream.DOMNodeWriter.write
    regards
    Boney Jose

  • How to develop a report based on multiple data bases in BIP

    Hi,
    I have to develop a report based on multiple database(Sources). My queries is having multiple data base tables. How to achieve this in BIP
    Regards,
    Malli

    Hi ,
    After creating the dataset under datamodel save your data sets.
    Click on Datamodel , on the right side window you will have the Main data set option , click on the drop down option and select Concatenated sql option.
    Check the below links you will get a good idea.
    http://www.rittmanmead.com/2008/04/bi-publisher-reports-with-multiple-data-sources/
    http://docs.oracle.com/cd/E12096_01/books/PubUser/T421739T423025.htm
    If the Post is useful to you award the points :)
    Thanks,
    Ananth v

  • How to trigger change documents based on inbound-idoc?

    Hi experts,
    Currently I'm working in on a project where I have to create an interface based on IDOCS. This is an interface for two SAP-HR systems.
    If there are made changes in the dialog (gui) by a user, there will be created a change document, which can be displayed by report RPUAUD00. For the inbound-interface based on idocs it's important that there will also be created a change document in the system based on this idoc. We have tested this, but no change document is created.
    Can anybody help me to solve this problem: "How to create a change document based on the inbound-idoc?"
    Thanks in advance.
    With kind regards,
    Roy

    Thanks for responding. First, I like the idea of defining an event, but I'm still stuck with how to trigger it. I looked at dynamically registering events, and maybe doing something where a click on the graph control registers an event for key presses on the vi. I'd still have to figure out out to terminate the key press event. Unfortunately, (actually it's a feature I like..) there are a number of different ways to complete typing in a scale change. I routinely use ctr-enter (habit from working on a laptop), though enter works fine, and clicking somewhere else is probably the most common method. I am not that familar with User Defined Events, so I may be overlooking something obvious here.
    The graphs are a Bode Plot, with a seperate graph for RPM vs Phase Lag, and RPM vs Magnitude. I want them to always be plotted on the same x-axis. The plot is generated when the user doubleclicks on a dataset. After that, it's just the user looking at it. They can change the axis without any new data being generated.
    Thanks,
    Chris

  • How to develop simple time based ramp driver for lab view VI

    how do I develop simple time based ramp driver for lab view VI

    Here it is converted to LabVIEW 2010.  However it is missing the AO and AI read and write vis since I don't have that package.
    Attachments:
    SRI_TimeProportion.vi ‏70 KB

  • How can I print document, based on user define template (Report Layout)?

    I want to be able to choose report layout, and print a document based on it. Can I implement it in my SDK code?

    Hi Shrem,
    I don't think this is possible with SDK code and PLD. You can do this if you're using a standard Crystal Report layout and you just send code to it using your code. Otherwise you can try and do this with user reports and queries in SBO itself without the SDK. But you're going to have to make all your layouts with more or less the same query and have where statements that limits the rows that shows on the report.
    Hope it helps,
    Adele

  • How to develop a web based editable pdf?

    I looking for ways to create a web based editable pdf, where user can edit and save it to that document itself and the ability to add event handlers upon completion of the task.

    You may also be interested in this:
    <http://www.hartnell.edu/faculty/frc/guides/Create%20a%20fillable%20PDF%20Form.pdf>
    Good luck.

  • How to get Accounting documents based on Billing documents

    Experts,
    I have a particular requirement in SD. I need to fetch the details of Accounting documents(BKPF-BELNR) and Fiscal year(BKPF-GJAHR) based on the Billing documents(VBRK-VBELN). Is there any function module to do so or any other way. Currently I am fetching this data but there is a performance issue.
    Edited by: Ashish Kansara on Oct 16, 2008 1:54 PM

    A quick link is to take VBRK-VBELN and use it to lookup BKPF-AWKEY. Also select BKPF-AWTYP = "VBRK" to make use of a secondary index on BKPF.
    Thomas

  • How to classify a document based on Microsoft's Naive Bayes algorithm?

    I am quite unfamiliar with using SSAS as of the moment. I am aware of the classical implementation of Naive Bayes. I have learned about it from the
    here. However what I am looking for is a complete walkthrough of how to use this particular algorithm with SSAS. 
    For simplicity let me assume we are supposed to classify a news write-up as having positive criticism or negative criticism. So for the positive articles we can observe words like
    good, awesome, super, recommended, love, like, etc occuring frequently. For negative articles we can observe words like
    bad, poor, unsatisfactory, unsatisfied, pathetic, etc mostly. There are only two possible outcomes (positive
    or negative), hence, generalizing on patterns is fairly simple.
    To start with we have a few write-ups with their corresponding outcomes, which are
    mostly in accordance with patterns we've generalized above. If we were to do this without the help of a data mining tool, we would do the following:
    Take the first write-up (assume this one is a positive article)
    We'd first split the whole write-ups into words.
    Remove the stopwords in them, like the, this, that, etc. (Words meant to provide a grammatical structure to the write-up but they occur frequently hence get rid of them). We get a corpus of words now.
    This corpus is assigned to the outcome positive. We simply note the frequency of how many time positive appears, and also the frequency of the individual words tending to give outcome
    positive.
    The next write-up is taken. (Assume this one to be negative).
    Steps 2-5 is repeated and the particular frequencies are updated each time.
    So once we have looked into all documents, we can actually prepare test cases.
    In accordance with the formula above, nc is the no.of times
    good actually give the outcome positive. p is a prior estimate (=0.5 since only 2 outcomes), and
    n is no.of time positive outcome appears in our corpus.
    How can I use SSAS to and go about verifying these kind of test cases manually?
    I am a bundle of mistakes intertwined together with good intentions

    You posted such a nice question -- and no one answered it.
    I would not use Naïve Bayes for this task.  There are three other approaches:
    1) Use either Association Rules or Decision Trees to determine associated words inside individual documents (treating each document as a transaction). 
    http://msdn.microsoft.com/en-us/library/ms175595(v=sql.120).aspx
    2) Use Integration Services Term Extraction Transformation and Term Lookup Transformation to create this application in Integration Services (Data Flow).
    http://technet.microsoft.com/en-us/library/ms141713.aspx
    3) Use Semantic Search.
    http://technet.microsoft.com/en-us/library/gg492075.aspx
    Mark Tabladillo PhD (MVP, SAS Expert; MCT, MCITP, MCAD .NET) http://www.marktab.net

  • Developing SOAP based Webservice using Axis 2 Eclipse plugin

    Hi,
    I want to develop a SOAP based Webservice which connects to the PostgreSQL DB , by fetching the data for the employeeId entered and display the results in the browser. I'm using using JDK 1.6, Tomcat 6.0, Axis 2.0 , with Axis 2 Eclipse Plugin. Please send me a sample code of how to build it, i am able find some examples on the internet, but none of them are related to connecting to the DB and fetching the data. It will be great if you guys can provide the sample application which does have the same functionality as mine. Please do respond as this is urgent. Thanks in advance..
    Thanks,
    Rithu

    Thanks Adhir Mehtaji, This is what i have come up with, developing a webservices based on SAAJ and deploying that in Tomcat server, here is the Webservice and the other related files:-
    public class EmployeeService {
         * This method returns the Employee Name
         * @param empId String
         public void getEmployeeName(SOAPEnvelope req, SOAPEnvelope resp) throws javax.xml.soap.SOAPException {
              System.out.println("Inside the getEmployeeName in Employee Service");
              IEmployeeDAO employeeDAO= null;
              employeeDAO = new EmployeeDAOImpl();
              SOAPBody body = resp.getBody();
              String empId = null;
              NodeList empIdNodeList = req.getBody().getElementsByTagName("empId");
              for( int i=0; i < empIdNodeList.getLength(); i++ ) {
                   Element empIdElementElement = (Element) empIdNodeList.item(i);
                   Node empIdNode = empIdElementElement.getChildNodes().item(0);
                   empId = empIdNode.getNodeValue();
                   System.out.println("the empId in the employee service is:::"+empId);
              addNode(body,"empName",employeeDAO.getEmployeeName(empId));
              //addNode(body,"segmentName1",custSegmentDAO.getSegmentName(ZipCode));
         private static void addNode(SOAPBody body,String nodeName,String nodeValue) throws SOAPException{
              body.addChildElement(nodeName).addTextNode(nodeValue);
         This Service is exposed as a Webservice which connects to the DAO and get the response for the EmpId.
         This is the client file:-
         public class GetEmployeeNameClient {
              public static void main(String[] args) throws Exception {
                   // Invoking the Webservice endpoint which is hosted (deployed) in Tomcat by passing the SOAP Message request
                   // Get the SOAP Message response , which contains the employee name for the empId 100
                   // Parse the SOAP Message response to get the employee name (response from the WS)
                   String[] nodeNames = { "empId" };
                   String[] nodeValues = { "100" };
                   SOAPMessage message = GetEmployeeNameClient.getMessageFactory(
                             "getEmployeeName", nodeNames, nodeValues);
                   SOAPConnection conn = SOAPConnectionFactory.newInstance()
                             .createConnection();
                   SOAPMessage response = conn.call(message,
                             "http://localhost:8080/axis/services/EmployeeService");
                   // If the response is not null then everything is fine with the WS.
                   System.out.println("the response is what???"+response);
                   System.out.println("\n Soap response:\n");
                   System.out.println("\nXML response\n");
                   // Create transformer
                   TransformerFactory tff = TransformerFactory.newInstance();
                   Transformer tf = tff.newTransformer();
                   // Get reply content
                   Source sc = response.getSOAPPart().getContent();
                   // Set output transformation
                   StreamResult result = new StreamResult(System.out);
                   tf.transform(sc, result);
                   System.out.println();
                   // For these to work we need to connect to the DB - jdbc:oracle:thin:@ora-b2cd:6473:b2cd to get the segment name
                   SOAPBody soapBody = response.getSOAPBody();
                   System.out.println("the soapBody is what???"+soapBody);
                   NodeList empNameNodeList = soapBody.getElementsByTagName("empName");
                   System.out.println("the empNameNodeList.getLength is::"+empNameNodeList.getLength());
                   for (int i = 0; i < empNameNodeList.getLength(); i++) {
                        System.out.println("inside the loop");
                        Element empNameElement = (Element) empNameNodeList.item(i);
                        System.out.println("the empNameElement is what???"+empNameElement);
                        Node empNameNode = empNameElement.getChildNodes().item(0);
                        System.out.println("the empNameNode is what???"+empNameNode);
                        System.out.println("Employee Name For empId is ...... "
                                  + empNameNode.getNodeValue());
              // Construct the SOAP Message request by passing the empId 100(should come from UI)
              private static SOAPMessage getMessageFactory(String methodName,
                        String[] nodeNames, String[] nodeValues) throws SOAPException {
                   SOAPMessage message = null;
                   try {
                        System.out.println("Inside the getMessageFactory");
                        MessageFactory messageFactory = MessageFactory.newInstance();
                        message = messageFactory.createMessage();
                        SOAPPart soapPart = message.getSOAPPart();
                        SOAPEnvelope envelope = soapPart.getEnvelope();
                        SOAPBody body = envelope.getBody();
                        SOAPElement bodyElement = body.addChildElement(envelope
                                  .createName(methodName));
                        for (int index = 0; index < nodeNames.length; index++) {
                             bodyElement.addChildElement(nodeNames[index]).addTextNode(
                                       nodeValues[index]);
                        message.saveChanges();
                        // View input
                        System.out.println("\n Soap request:\n");
                        message.writeTo(System.out);
                        System.out.println();
                   } catch (Exception e) {
                        e.printStackTrace();
                   return message;
         This client will send a SOAPMessage with EmpId (100) as a request and get the response from the Webservice as SOAPMessage , which
         contains the empname for the respective empid which is passed.
    I tested this service in the browser, it is up and running through the URL : http://localhost:8080/axis/services
    But when i try to access the webservice to get the response from my client program, i am getting the following SOAP Fault string:-
    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body><soapenv:Fault>
    <faultcode>
    soapenv:Server.userException
    </faultcode>
    <faultstring>
    org.xml.sax.SAXNotRecognizedException: Feature: http://xml.org/sax/properties/lexical-handler
    </faultstring>
    <detail>
    <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">
    user-15bbc0db6e
    </ns1:hostname>
    </detail>
    </soapenv:Fault>
    </soapenv:Body>
    </soapenv:Envelope>
    My client path contains :-
    axis.jar;
    jaxrpc.jar;
    saaj.jar;
    commons-logging.jar;
    commons-discovery.jar;
    wsdlj4.jar;
    axis-ant.jar;
    log4j-1.2.4.jar
    xerces.jar
    activation.jar
    mail.jar
    Similary the in the d:/tomcat/webapps/axis/WEB-INF/lib,contains the same as that in client path.
    I am using Tomcat 6.0 , JDK 1.6, I have googled and found that the expection is due to "Xerces.jar" not in Tomcat/webapps/axis/WEB-INF/lib.
    I have copied xerces.jar in the said path, still the error persists. Please do provide a solution to this. Where i have gone wrong.
    I have one more query, If i have to rest a "list" as a response from the server (webservice), how i can add the list into the SOAPMessage? Whether i need to parse it and add the values one by one in the SOAPMessage? like
    <empname> xxxx</empname> <empage>25</empage>
    <empname> yyyy</empname> <empage>26</empage>
    Please answer these queries.
    Thanks,
    Rithu

  • REST BASED  WEBSERVICES

    Hi,
    We Have a Legacy System based  on  REST BASED  WEBSERVICES, that  legacy  system  can  understand  only  HTTP  format(it does n't  support  SOAP ) our scenario  is  HTTP TO  RFC  SYNCHRONOUS.
    And   we  have  to  connect PI   with  REST BASED  WEBSERVICES     ?
    1---->How  can  we connect  PI  with  REST BASED  WEBSERVICES ?
    2---->and  how  to test  those    REST BASED  WEBSERVICES ?any  tool  for  that?
    Thanks,
    Nagaraju.

    Hi Nagaraju,
    you can sent message from PI via [http receiver adapter|http://help.sap.com/saphelp_nw2004s/helpdata/en/43/64dbb0af9f30b4e10000000a11466f/content.htm].
    For message from legacy to PI use a simple address, what is explained in [SAP help http sender adapter|http://help.sap.com/saphelp_nw2004s/helpdata/en/43/64db4daf9f30b4e10000000a11466f/content.htm]
    You can test http messages with Microsoft's tool [Wfetch|http://www.microsoft.com/download/en/details.aspx?id=21625] (in the net are hundreds of free ware http test tool available).
    Regards,
    Udo

  • CI based webservices

    Hi ,
    I have some doubts regarding the CI based webservices.Can I use the URL
    http://your.peoplesoft.server/PSIGW/HttpListeningConnector?Operation=YOUR_OPERATION_NAME.v1&OperationType=Sync
    for the CI Based webservice to post the data from the html page.
    I am trying to append the emplid and descr field to the above URL as http://your.peoplesoft.server/PSIGW/HttpListeningConnector?Operation=YOUR_OPERATION_NAME.v1&OperationType=Sync&EMPLID=10&DESCR=TEST.
    I am getting an error message like
    The request string ( data ) is not properly formed. (158,16005)
    Please suggest me how to call a CI based webservice from HTML or javascript.
    Thanks in advance

    I mean we did a workaround in current dev environment -
    to rename the node to HRPRD and renaming it back to HRDEV , bouncing the web server did the trick for us.
    thanks

  • How to split the IDOCS based on document number change whit out BPM

    Hi all,
    Thanks,for giving the responce..
    Scenario:File to IDoc.
    Problum1 : How to Split the IDocs based on document number change in the source file with out BPM.My file contains document numbers like
    20000092
    20000092
    20000092
    50000050
    50000050
    50000065
    I want 3 IDocs in target system.i.e 1 for 20000092,20000092,20000092
                                                       2 for 50000050,50000050
                                                       3 for 5000006
    By using external definations i am getting 6 IDOCs insted of 3.
    Problum 2:Is there any chnges/modifications in Directory when we are using external definations.
    Could u plz provide me the step by step process(Repository/Directory) with using of external definations.
    Thanks in advance.
    Regards,
    KP

    HI,
    for this no need of BPM.
    You can think of Idoc bundling concept to acheive this-just you need to do the external definition to change the idoc occurence
    /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
    to achieve for each document no, one idoc, you can write small user defined function in the mapping with context handling you an achieve this.
    For this e.g
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6bd6f69a-0701-0010-a88b-adbb6ee89b34
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/877c0d53-0801-0010-3bb0-e38d5ecd352c
    Regards,
    Moorthy

  • How to inject EntityManager in non-EJB based WebService?

    Hi,
    I want to know how we can inject EntityManager in non-EJB based WebService?
    Regards,
    imran

    I think the way to go would be to actually do use an EJB for the persistence stuff and use that EJB in your webservice. Use the right tool for the job and all that.

  • How to develop and call Asynchronous web service

    Hi All,
    I need to have a java web service that will be called asynchronously.
    That should execute, once triggered and caller shouldnt need to wait till its completion.
    How to develop and call asynchronoue web service ?
    Thanks
    Saikrishna

    Let your web service start its own background thread (*) somehow and move your business logic from web service to this thread. Then you can return from your web service. The client won't be blocked and your application will run on your server after service callout will be finished.
    I hope that's what you need. Anyway, there is only "asynchronous communication" and nothing like "asynchronous web service". At least from HTTP point of view, every call is synchronous - you have request and response.
    (*) You shouldn't start your own thread since you are in JEE world. Look at documentation for your container. E.g. for weblogic there are workers you can use this way. Or you can choose the other way. I hope that for any container you can just enqueue your web service request to any JMS queue and move your business logic to an appropriate MDB. Then, your web service will be just a simple JMS producer and your web service client won't be forced to wait for business logic to finish.
    Last but not least, next time choose a better forum. :-)

Maybe you are looking for

  • ADF Faces : partial page rendering in f:subview

    hi Please consider this blog post, "ADF Faces: How-to issue a PPR event from a f:subview and how-to PPR of subviews" : http://thepeninsulasedge.com/frank_nimphius/2008/02/14/adf-faces-how-to-issue-a-ppr-event-from-a-fsubview-and-how-to-ppr-of-subview

  • Hr report categories.

    hi again All, I am facing a problem again. I tried generating a new category for my report. Now again after creating the category i do not see how to add fields and remove selection fields. I need only company code in my selection criteria and nothin

  • How do I tell which generation of shuffle I have?

    How do I tell which generation of shuffle I have?

  • Batch Input file is not created for the program RFUMSV00 (VAT)

    Dear All, Yesterday we run the program RFUMSV00 for posting VAT entries. But program dosnt created any batch input file. We tried to create the file once again by running the program, but there were no data;s on it. I can able to view the spool which

  • Can't connect to PSN. Error code: ce-33987-0

    Almost every night I can't connect to PSN. Error code: ce-33987-0 After multiple PS4 restarts and my router restarts - it connects. Sometimes it connects after few hours without doing anything at all. So I couldn't find any pattern. My router and int