Maintaing state with ejb web services

Hello,
I understand there are no straight way to maintain state with ejb web services. Basically I have a stateful session bean and I would like to maintain state across requests. What is the best/cleanest architecture I can use in order to maintain state with web services?
Any reply appreciated,
Julien.

Here's how BEA suggests you do it:
http://e-docs.bea.com/wls/docs81/webserv/design.html#1058330

Similar Messages

  • Combine Annotation Driven EJB Web Services with BPEL

    Hi friends,
    We developed two Annotation Driven EJB Web Service and deployed successfully .
    webservice 1 accepts username and password as input and returns true if ldap authentication is successful.
    webservice 2 accepts username and password,and groupname as input and returns true if user is part of ldap group.
    How can we combine these two services in SOA with input (username,password,group) and output (isAuthenticated ,isGroupMember) using BPEL process...
    Regards,
    jdev

    I will create a schema with input as (username,password,group) and Output as (isAuthenticated ,isGroupMember).
    Then based on your requirement you have to create either Sync or Async service.
    From the BPEL process i will call the 2 webservices using webservice call.
    On receiving the result, populate the output variable(isAuthenticated ,isGroupMember) and send as response.
    Thanks,
    Vijay

  • How to Use SOAPArray to Exchanged Data with a Web Service

    The method of a prototype Web service I created is defined to take many parameters
    and return an object of a user defined class. Furthermore, the user defined class
    includes data elements of another user defined class and the Java ArrayList class.
    This works with a Java client referencing the WebLogic created client.jar file
    but I don't know how well it will work with a non-Java client. In particular,
    with Perl which is the language that will be used by the developer who first will
    test with the prototype.
    In posts to this newsgroup use of "language-specific, generic containers" has
    been discouraged and the "language-agnostic" SOAPArray recommended. I have searched
    this newgsroup and the Web for examples of how to use a SOAPArray in a Web service
    EJB to receive parameters and return results but found none.
    Will someone refer me to an example or give an overview of how a Java Web service
    EJB running in WebLogic 6.1 would use SOAPArray to get parameter values and return
    results?
    Also, I would like confirmation that it is best to use SOAPArray to exchange data
    with a Web service to achieve the goal of a service accessible by any language.
    Thank you.

    Replies in-line:
    How are the structures, e.g. gltrans-workType, defined in the Web service?The structure is made up of nested Java Beans, but this does not mean that the
    client for your web service has to be written in Java. The WSDL that I sent contains
    everything that a .NET-based (or Perl-based, or Python-based, or VB-based, or
    C++ based) Web Service Stack needs to correctly create all the data types in the
    web services' signature! That's the beauty of XML Schema! It's programming language
    independent :-)
    In
    other words, what definition in Java resulted in the WSDL statements?The WSDL wasn't produced by WLS 6.1, but it (WLS 6.1) can consume it.
    What is the signature of method submitGLTransWorkAsJavaBean() in the
    Web service?public void submitGLTransWorkAsJavaBean(GlTransactionsCpyType glTransactionsCpyType)
    GlTransactionsCpyType is the outer-most Java Bean. WLS 6.1 does not generate
    Java Beans for you, but it will use ones that you defined. See the Java Bean tutorial
    on the Javasoft sitem for details on how to create a Java Bean.
    Was the WSDL generated using the WL tools for creating a Web service?No.
    Conclusion:
    You asked for someone to provide you with an example of how to use SOAP array
    in a WSDL, which is what the attached file contained :-) What you want to do now
    is find a tool that can generate Java Bean code from this WSDL (Apache Axis has
    a wsdl2java tool that should work), or create the Java Beans yourself. Afterwards,
    create a WLS 6.1 Web Service a expose it for a Perl or .NET client.
    Regards,
    Mike Wooten
    "Jeff Carey" <[email protected]> wrote:
    >
    Please elaborate.
    How are the structures, e.g. gltrans-workType, defined in the Web service?
    In
    other words, what definition in Java resulted in the WSDL statements?
    What is the signature of method submitGLTransWorkAsJavaBean() in the
    Web service?
    Was the WSDL generated using the WL tools for creating a Web service?
    Thank you.
    "Michael Wooten" <[email protected]> wrote:
    Hi Jeff,
    Sounds like a pretty cool prototype :-)
    I have attached a WSDL (at the bottom of this post) that contains a<schema>
    that
    uses a SOAPArray to create an array of a <complexType>.
    HTH,
    Mike Wooten
    "Jeff Carey" <[email protected]> wrote:
    The method of a prototype Web service I created is defined to take
    many
    parameters
    and return an object of a user defined class. Furthermore, the user
    defined class
    includes data elements of another user defined class and the Java ArrayList
    class.
    This works with a Java client referencing the WebLogic created client.jar
    file
    but I don't know how well it will work with a non-Java client. Inparticular,
    with Perl which is the language that will be used by the developerwho
    first will
    test with the prototype.
    In posts to this newsgroup use of "language-specific, generic containers"
    has
    been discouraged and the "language-agnostic" SOAPArray recommended.
    I have searched
    this newgsroup and the Web for examples of how to use a SOAPArray in
    a Web service
    EJB to receive parameters and return results but found none.
    Will someone refer me to an example or give an overview of how a Java
    Web service
    EJB running in WebLogic 6.1 would use SOAPArray to get parameter values
    and return
    results?
    Also, I would like confirmation that it is best to use SOAPArray toexchange
    data
    with a Web service to achieve the goal of a service accessible by any
    language.
    Thank you.

  • Consuming EJB Web Service in WD ABAP component

    Hi,
    I have a scenario where I have Portal KM access methods exposed as EJB Web Service. This web service is deployed on J2EE engine.
    And I have to consume this web service from my WD ABAP component controller.
    Any idea how this can be achieved?
    Thanks and regards,
    Amey

    This doesn't really have anything to do with Web Dynpro.  Normal ABAP functionality is used for the consumption of a web service.  In ABAP we create a proxy class based off the WSDL of the web service.  This proxy class can then be called from within Web Dynpro like any other ABAP class.  You can read about consuming a web service in the online help:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/9e/c7a3591dc74a679bbc9716354e42af/frameset.htm

  • EJB Web Service Interface parameters name changed

    Hi, all,
    I create a simple Session EJB 3.0 with Web Service interface in Jdeveloper 10.1.3.4. and I deployed it into the embedded OC4J server.
    The question is I found that the web service operator parameters is changed to "String_1" (actually the parameter in EJB method is String ss). And I found the WSDL file is also String_1.
    How to create the real parameter name in WSDL from EJB Web Service interface? Any help on that?
    Best Regards,
    Bill

    if you do a lookup for the name "java:comp/env/ejb/queryProc" in the servlet, the deployment descriptor of your web-archive must contain an ejb-reference with the ref-name 'ejb/queryProc'.

  • Prob with Adaptive Web Service Model and Response with reference of itself

    Hi guys,
    I am facing a problem with the Adaptive WebService Model. I have a WebService which is working properly in a Servlet and also in the web service navigator,
    The webService has a method let´s say create(objectDTO). The structure of objectDTO is like this:
    propertieA
    propertieB
    propertieC
    propertieChildObjectDTO
    So I can pass a list of objectDTOs to the webService. If i import the webService the structure in the model looks fine, but if i want to map it to any context, only the properties A-C are mapped. propertieChildObjectDTO is not mapped.
    Has anyone a clue on how to solve this problem ? I just tried to add and initialize the propertieChildObjectDTO manually but I got a NullPointerException.
    I would appreciate  your help.
    Happy new year guys
    Regards
    Flo

    Guys......
    seems like i can´t reach my requirement with Adaptive Web Service Model:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/wdjava/faq%252b-%252bmodels%252b-%252badaptive%252bweb%252bservice
    Now I want to make it by hand. How can I import the regarding EJB ?
    Thanks !
    Flo

  • "no serializer is registered..." error with a web service not working

    I'm using JDeveloper 10.1.3
    EJB 3.0
    I'm having issues with the web service not working after I create a client for it. The web service works fine up until I generate the proxy on the other side.
    ERROR An error occurred for port: {http://buslogic/}MyWebService1SoapHttpPort: no serializer is registered for (class buslogic.runtime.....
    I saved the file before I added the proxy and the wsdl looks the same between the working one and the non working one. I can not pin point the when the change to the web service is occuring. It seemed to work once all the way up until I had a ADF page trying to retrieve data, another time it failed when the proxy was created.
    I can get the version that I saved to work immediately after the version that does not fails.
    Any help would be greatly appreciated,
    Dan

    I'm using JDeveloper 10.1.3
    EJB 3.0
    I'm having issues with the web service not working after I create a client for it. The web service works fine up until I generate the proxy on the other side.
    ERROR An error occurred for port: {http://buslogic/}MyWebService1SoapHttpPort: no serializer is registered for (class buslogic.runtime.....
    I saved the file before I added the proxy and the wsdl looks the same between the working one and the non working one. I can not pin point the when the change to the web service is occuring. It seemed to work once all the way up until I had a ADF page trying to retrieve data, another time it failed when the proxy was created.
    I can get the version that I saved to work immediately after the version that does not fails.
    Any help would be greatly appreciated,
    Dan

  • Error deploy EJB web services

    please help!!!
    Hi! I've problems to deploy an ejb web services.
    I've the following error:
    Error instantiating compiler:
    06/07/19 10:48:51 WARNING: EJBContainer.postInit
    Error generating wrappers for file:/C:/Oracle/oc4j/j2ee/home/applications/EJB-WS-EAR/EJB-WS.jar
    com.evermind.compiler.CompilationException: Error instantiating compiler: webservice artifact generation failed :java.lang.NullPointerException : null
    used by: java.lang.NullPointerException
         at oracle.j2ee.ws.common.mapping.JavaWsdlMappingMetadata.findPortMapping(JavaWsdlMappingMetadata.java:296)
         at oracle.j2ee.ws.common.processor.config.ModelInfo.javaNameOfPort(ModelInfo.java:453)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLModeler.processPort(WSDLModeler.java:693)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLModeler.processService(WSDLModeler.java:651)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:393)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:207)
         at oracle.j2ee.ws.common.processor.config.ModelInfo.buildModel(ModelInfo.java:167)
         at oracle.j2ee.ws.common.processor.Processor.runModeler(Processor.java:72)
         at oracle.j2ee.ws.server.codegen.WsCompile.run(WsCompile.java:448)
         at oracle.j2ee.ws.server.codegen.ServerArtifactGenerator.generateCompilables(ServerArtifactGenerator.java:408)
         ... 15 more
    I'm working with jwsdp 1.5 and Oracle OC4J Standalone v10.1.3
    Do you have any idea?
    Thanks in advance!

    Hello,
    Could you send me you source and ear at: tugdual[dot]grall[at]oracle[dot]com
    Regards
    Tugdual Grall

  • How to access application state from stateless web service?

    I have a beginner J2EE question. After reading through J2EE tutorial, I still don't know how to create an application that would run on J2EE server, and which would have a web service interface to other world, and which would have several threads running, which would connect to other enterprise applications via TCP? Because if I understand it correctly, web service requires a stateless session bean, which means that it can't access any stateleful session bean (except always create one and remove it instantly). So there seems to be no way to store application state and have running threads.
    I'm asking this because .NET seems to have a very simple Application dictionary, which can save all application objects, including threads, and it is very easy to access this Application state from a stateless web service. Isn't there any similar functionality in J2EE? And if not, how it should be done in Java world then?
    I guess that the Connector architecture could be the solution, but it is not documented in the tutorial.

    There's nothing in the J2EE spec that says that you have to use Web Services. Web Services by definition are stateless.
    If your requirements are that you have to use a session bean along with a Web Service, then the architecture needs to be rethought, because it doesn't seem to me that Web Services are what you want.
    That said, you can use a hybrid. You can expose some of the functionality of your application as Web Services while the remaining is implemented in a classic J2EE type framework that is stateful.
    I would also think that you could store your application state via entity beans. You could save and load them when the web service is accessed. An entity bean doesn't require a database... just some form of persistence (could be an XML file for instance).
    You need to decide which components of J2EE make sense when and where.

  • EJB Web Services Exception: missing field/property

    Hello
    I am having trouble creating EJB Web Services.
    When i send the following XML-content:
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <SOAP-ENV:Body>
        <yq1:create xmlns:yq1="http://company.com/project/beans/local/">
          <firstName>q</firstName>
          <lastName>s</lastName>
          <email>d</email>
          <userName>f</userName>
          <password>g</password>
        </yq1:create>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    I receive this response:
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <SOAP-ENV:Body>
        <SOAP-ENV:Fault>
          <faultcode>SOAP-ENV:Client</faultcode>
          <faultstring>com.sap.engine.services.webservices.espbase.server.additions.exceptions.ProcessException: Deserializing fails. Nested message: JAXB request bean 'com.company.project.beans.local.jaxws.Create@18eadca' is missing field/property with name 'firstName'.</faultstring>
          <detail>
            <yq1:com.sap.engine.services.webservices.espbase.server.additions.exceptions.ProcessException xmlns:yq1="http://sap-j2ee-engine/client-runtime-error">
              <!-- com.sap.engine.services.webservices.espbase.server.additions.exceptions.ProcessException: Deserializing fails. Nested message: JAXB request bean 'com.company.project.beans.local.jaxws.Create@18eadca' is missing field/property with name 'firstName'. -->
            </yq1:com.sap.engine.services.webservices.espbase.server.additions.exceptions.ProcessException>
          </detail>
        </SOAP-ENV:Fault>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    This is the code to my EJB and the interface:
    @WebService(endpointInterface="com.company.project.beans.local.PersonLocal", portName="PersonBeanPort", targetNamespace="http://company.com/project/beans/local/", serviceName="PersonService")
    @Stateless
    public class PersonBean implements PersonLocal {
         @PersistenceContext
         private EntityManager em;
         public void createAsObject(Person person) {
              em.persist(person);
         public void create(String firstName, String lastName, String email, String userName, String password) {
              Person person = new Person(firstName, lastName, email, userName, password);
              createAsObject(person);
    @WebService(targetNamespace="http://company.com/project/beans/local/", name="PersonLocal")
    @Local
    public interface PersonLocal {
         @WebMethod(operationName="createAsObject")
         public void createAsObject(@WebParam(name="person")
         Person person);
         @WebMethod(operationName="create")
         public void create(@WebParam(name="firstName")
         String firstName, @WebParam(name="lastName")
         String lastName, @WebParam(name="email")
         String email, @WebParam(name="userName")
         String userName, @WebParam(name="password")
         String password);
    Do you have any advice on how to resolve this problem?
    Thanks in advance
    Vincent

    Hi,
    in case you want some specific text,you can raise the exception  like this in your function module.
    MESSAGE I001(ZPLATINO)  RAISING EXCEPT1.
    message class: ZPLATINO
    exception        : EXCEPT1
    message no 001,
    message text : CHECK ERROR PUSHKAR1
    and your response will be like.:
    <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
         <soap-env:Body>
              <soap-env:Fault>
                   <faultcode>soap-env:Client</faultcode>
                   <faultstring xml:lang="en">EXCEPT1</faultstring>
                   <detail>
                        <n0:Zpl.Exception xmlns:n0="urn:sap-com:document:sap:soap:functions:mc-style">
                             <Name>EXCEPT1</Name>
                             <Text>CHECK ERROR PUSHKAR1</Text>
                             <Message>
                                  <ID>ZPLATINO</ID>
                                  <Number>001</Number>
                             </Message>
                        </n0:Zpl.Exception>
                   </detail>
              </soap-env:Fault>
         </soap-env:Body>
    </soap-env:Envelope>
    I think this solves your problem.
    points..points..:)
    Message was edited by:
            pushkar anand

  • Need help in EJB Web Services

    I have been programming an EJB Web Service. I programmed the EJB and I have programmed the Client. It works properly when I execute it in the command line.
    However, I would like to access it using a web page. I have tried with a JSP (I posted some messages in the forum before) but I had lots of problems because of the versions. I have tried with a servlet but it doesn't work (I don't know really how to execute it, where to deploy it, what is the address to write in the iExplorer, and so on).
    Please, if somebody can help me I will be very thankful.
    I am new in developing with J2EE and OC4J and I am desperate!
    I need documentation or a complete example for OC4J 9.0.3.
    Thank you very much!
    Paloma

    I have been programming an EJB Web Service. I programmed the EJB and I have programmed the Client. It works properly when I execute it in the command line.
    However, I would like to access it using a web page. I have tried with a JSP (I posted some messages in the forum before) but I had lots of problems because of the versions. I have tried with a servlet but it doesn't work (I don't know really how to execute it, where to deploy it, what is the address to write in the iExplorer, and so on).
    Please, if somebody can help me I will be very thankful.
    I am new in developing with J2EE and OC4J and I am desperate!
    I need documentation or a complete example for OC4J 9.0.3.
    Thank you very much!
    Paloma

  • How to create secure EJB web service in Oc4J using JDeveloper?

    We are going to develop a EJB web service running in OC4J using JDeveloper 10.1.3.3.
    By using the JDeveloper feature, we can simply create the web service by using the "Web Service Endpoint Interface" in the session bean.
    However, unlike the web service created from Java class, I can't find any option to change the security setting of this web service. We tried adding annotation like @DenyAll for testing, but there has no effect and related method can still be called without WS-Security header.
    Now, we can only change the security setting via the web console after deployment (select the web service, then enable security in administration page, and then edit security configuration to change the inbound policies for authentication). It works in our local machine, but it may not work in the production environment as we cannot touch the em console.
    May I know if there has any way to include the security setting inside the project?
    Thanks in advance.

    If I am not wrong, you might be probably talking about this :
    http://docs.oracle.com/cd/B40099_02/books/EAI2/EAI2_WebServices33.html#wp179056
    In order to implement the SOAP header, you would have to :
    (1) Define SOAP header in the wsdl of the service.
    (2) Add a new soap binding in the wsdl, which contains soap header and soap body.
    I think, this should get you going..

  • Problem generating stubs for Java EJB web service deployed in OAS

    I created an EJB web service and I've successfully deployed it in my Oracle App Server. Some of the methods work fine but others produce the ff error:
    org.apache.soap.SOAPException - java.lang.IllegalArgumentException: No Serializer found to serialize [classname] using encoding style [encoding]It seems that the objects specified as parameters in the web service methods exposed are the only ones that had stubs generated for them. Other objects I use, which are usually wrapped inside a Vector, did not have generated stubs.
    Example:
         public String loginUser(UserDTO userDTO) throws RemoteException, NamingException, SQLException;
    public String addItems (Vector vecItems) throws RemoteException, NamingException, SQLException; // where vecItems is a collection of ItemDTO objects     In this scenario, stubs were generated for the UserDTO class, but not for the ItemDTO class. In effect, calling the addItems method resulted to the exception I mentioned above.
    I did a workaround wherein I declared a dummy method which accepted all the types of objects I needed as parameters so all the necessary stubs can be generated, but this fix doesn't feel like it's the proper solution to my problem.
    If anyone can help me, it would be greatly appreciated. Thanks!

    Crossposted:
    Problem generating stubs for Java EJB web service deployed in OAS

  • Best practice for integrating oracle atg with external web service

    Hi All
    What is the best practice for integrating oracle atg with external web service? Is it using integration repository or calling the web service directly from the java class using a WS client?
    With Thanks & Regards
    Abhishek

    Using Integration Repository might cause performance overhead based on the operation you are doing, I have never used Integration Repository for 3rd Party integration therefore I am not able to make any comment on this.
    Calling directly as a Java Client is an easy approach and you can use ATG component framework to support that by making the endpoint, security credentials etc as configurable properties.
    Cheers
    R
    Edited by: Rajeev_R on Apr 29, 2013 3:49 AM

  • How to add image in ejb web service

    Hello Community,
    I am writing web service to create a PDF file using itext API. In PDF file i want to add an image.
    Can someone please tell that , how can i add image(jpeg, png , etc.) to an ejb web service?
    Thanks in advance
    Regards,
    Dishant Chawla

    Hi,
    Please check the below code which i used to add image to the header using iText . Similarly you can add image directly to the document also as a element.
    Adding image as Header:
    httpServletRequest = request.getServletRequest();
    domainURL=httpServletRequest.getScheme()+"://"+httpServletRequest.getServerName();
    imgLogo=domainURL+request.getWebResourcePath()+"/images/XXXX.jpg";
    image =Image.getInstance(imgLogo);
    image.scalePercent(22);// As per you need
    chunk = new Chunk(image, 0, -20);
    HeaderFooter header_pdf = new HeaderFooter(new Phrase(chunk), false); // here i have added image as header
    header_pdf.disableBorderSide(0);
    header_pdf.setAlignment(Element.ALIGN_CENTER);
    header_pdf.setBorder(0);
    document.setHeader(header_pdf);
    (or)
    Adding Image a Element:
    httpServletRequest = request.getServletRequest();
    domainURL=httpServletRequest.getScheme()+"://"+httpServletRequest.getServerName();
    imgLogo=domainURL+request.getWebResourcePath()+"/images/XXXX.jpg";
    image =Image.getInstance(imgLogo);
    image.scalePercent(22);
    document.add(image);
    Java IText: Image | tutorials.jenkov.com
    Regards,
    Srinivasan V

Maybe you are looking for

  • Outlook - The path specified for the file SharePoint Lists PST is not valid

    Some users are connecting via Citrix XenApp to Microsoft Server 2008 R2 and using Microsoft Office 2010 (14.0.7109.5000) SP2 MSO (14.0.7116.5000) - Microsoft Office Profressional Plus 2010 x86 version for their email.  Microsoft Exchange Server 2010

  • Can any body help me on this issue

    I am creating an Shipment Document through VI01..the shipment gets generated but the system does not create a purchase order, Regards     Partha

  • Forecasting sales

    Hello, I am involved in a project that aims to obtain consumption estimations. Despite having knowledge of forecasting models and know how to work in SAP, I find myself with a problem in the database. In MM01, we can create a forecast for a product,

  • IPhoto can't find iPhone5

    iPhoto will not recognise my iPhone 5c. Have tried with Image Capture. Want to move approx 1500 photos to give my phone more space. What to do?

  • [Win XP Development] Configure Classic Instance hanging on "Create Domain"

    I've installed wls 10.3.5 on a Windows XP SP 3 platform. It's up and running. I used the install-- do not configure option for Forms/Reports 11.1.2. Now, I'm trying to configure this Windows machine for development. I've shortened all the paths.... e