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..

Similar Messages

  • How to Create and Deploy Web Services Using Oracle 9i JDeveloper

    Hi,
    My Question is how to create and deploy Web Services using Oracle 9i JDeveloper.Anybody please give me a detailed Reply.Please Reply to [email protected]
    Hopr to Hear From you,
    Regards,
    G Sreekumar

    You could use datasources. You should do this in your BC4J Configuration. Then when deploying your applicaiton use the command -installDataSource (from admin.jar) to create the right datasource.
    You could probably use the name of your connection + "DS" so you can also use it locally in JDeveloper as JDev seesm to create this automaticly for your Connections.

  • How to create document/literal web services with WLS7

    How do you create document/literal web services with WLS7 ( not workshop)
    - Is it possible with servicegen and stateless EJBs as the backend component?
    The default is RPC/Soap-encoded is there anyway to craft the web-services.xml
    to make it document/literal
    - Is it possible with the JMS-implemented web services - have not tried this yet
    - Is there another mechanism?

    That would be the <web-service> element in the web-services.xml file, of course.
    "Michael Wooten" <[email protected]> wrote:
    >
    Hi Rich,
    Try adding a style="document" attribute to the starting <web-service>
    element.
    The might be a way to get <servicegen> to do this for you, but I haven't
    found
    it yet :-)
    Regards,
    Mike Wooten
    "Rich Muth" <[email protected]> wrote:
    How do you create document/literal web services with WLS7 ( not workshop)
    - Is it possible with servicegen and stateless EJBs as the backend component?
    The default is RPC/Soap-encoded is there anyway to craft the web-services.xml
    to make it document/literal
    - Is it possible with the JMS-implemented web services - have not tried
    this yet
    - Is there another mechanism?

  • How to create JAX-WS web services using providers?

    I am looking at WebLogic web services, because we are investigating the possibility of migrating our web services from Apache CXF to WegLogic web services. Our web services are implemented using JAX-WS providers. However, I browsed through the Oracle Fusion Middleware document library, but I couldn't find any documents for implementing JAX-WS web services using providers.
    Is there any document, tutorial, or examples of that?
    Thanks in advance!
    Tao

    Ok just as I expected. So I guess I am left with the following two options
    1) either I switched to using JAXB in my apps instaed of xmlbeans....
    2) or if I still wanna use the old JAX-RPC web services to deploy on the Weblogic 10gR3 server i will have to create my own ant task jwsc directly......as shown below in your docs
    Programming Web Services for WebLogic Server (ant tasks)
    http://download.oracle.com/docs/cd/E13222_01/wls/docs92/webserv/anttasks.html
    Getting Started With WebLogic Web Services Using JAX-RPC
    http://download.oracle.com/docs/cd/E12840_01/wls/docs103/webserv_rpc/index.html
    Will OEPE be supporting the old JAX-RPC anytime in the near future release? or have to create own build ant task to call jwsc ant task directly to compile JAX-RPC web services??

  • How to create a new web service project of Weblogic 9.2 on Eclise ?

    Dear experts,
    I have to use weblogic server 9.2.2 and eclipse as my developing environment.
    But when I execute eclipse->File->New->Project->WebLogic Web Services->Web Service Project.
    I can't see the choice for weblogic server 9.x in the Target runtime field.
    Even I download the additional server adapters, the oldest version is Oracle WebLogic Server 10gR3 (newer than 9.x).
    So, how can I create a weblogic server9.x web server project on eclipse ?
    Thanks,
    James Tung

    James,
    Which version of Eclipse are you using? Do you have Oracle Enterprise Pack for Eclipse installed? Which version?
    According to the docs, OEPE 11.1.1.6 (the latest of this post) supports WLS back to version 9.2.
    http://download.oracle.com/docs/cd/E15315_05/help/oracle.eclipse.tools.common.doc/html/index.html
    Make sure that you have a WLS 9.2 Server Runtime defined.
    Window->Prefereces->Server->Runtime Environments
    Add a BEA System, Inc WLS 9.2 server runtime and make sure it is pointing to the right place on your file system and try creating your Web Service project again.
    If you still have issues, try the OEPE forum.
    Enterprise Pack for Eclipse

  • How to expose a SOAP web service from HCP

    Hello All,
    Currently I am trying to create a SOAP web service within a HCP Java application to allow backend systems to consume data stored in HCP.
    This is the planned scenario:
    1. Create data in HCP - therefor I am using JPA and a oData Model.
    2. Backend uses web service to consume data from HCP - with this point I do have some problems.. I do want to create a SOAP web service in order to achieve this.
    Is there an easy way to create a SOAP web service in HCP? There are many tutorials in the internet of how to create a SOAP web service in 20 sec´s, but non of these helped me. I do was able to consume a SOAP web service in HCP coming from the ByD, but the other way around seems pretty complicated...
    Can I make use of the Eclipse functions to create a web service? (New --> Other... --> Web Services --> Web Service and than choose the Button up Java bean Web Service type)
    Have any of you some coding snippets that would probably help me out?
    I have unsuccessfully tried to use the @WebService, @SOAPBinding, @WebMethod notation in my java classes...
    Thank you,
    Swen

    Hello Nedelcho,
    Yes. All the required jar files are in the lib directory.
    Currently I am able to create a web service locally.
    But when I deploy that to the cloud server my JPA service is not working any more.
    Receiving the following error message:
    <?xml version='1.0' encoding='UTF-8'?><error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><code/><message xml:lang="en">javax.naming.NamingException: Error while attempting to resolve reference [Root exception is javax.naming.NamingException: Cannot create resource  object instance due to exception in the object factory [Root exception is javax.naming.NamingException: Data source 'jdbc/DefaultDB' not available.]]</message></error>
    The web.xml contains the following:
    Any advice?
    Best regards,
    Swen

  • 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

  • Issues in creating Java based web services with JAXB 1.0 in Jdeveloper 10 g

    Hi All,
    I am trying out a simple java based web service creation exercise using Jdeveloper 10.1.3.3.0.3 and JAXB 1.0. Here is what I am trying to do.
    1. I have a XSD file called Status.xsd, which has three complex types in it.
    2. Using Jdeveloper Tools --> JAXB Compilation, I have created Jaxb classes for the above XSD files. For each of the complex type the jaxb class generator generated on IMPL clas and one abstract class.
    3. Now I have created one simple java class called Class1.java and created one method that takes the StatusImpl as input and as output for that method. Here is the code for Class1.java
    public class Class1 {
    public Class1() {
    public StatusImpl getstatus (StatusImpl in) {
    StatusImpl out;
    out = in;
    return out;
    4. Now, I trying to create a web service for this java class from jedeveloper. I have right clicked this class and went thru the wizard Create J2EE web services.
    5. At the end, the web service project got created successfully and I am trying to run this project from jdeveloper. When I run this project, I am getting the following kind of error message in the browser
    It looks like when the runtime deployment classes are trying to instantiate the abstract classes instead of the impl class. and for all the complex types they trow that error and the web service could not be even invoked.
    What could be the issue? Is the jaxb based web services supported with jdeveloper 10g?
    Thanks,
    Renga

    Hi All,
    I am trying out a simple java based web service creation exercise using Jdeveloper 10.1.3.3.0.3 and JAXB 1.0. Here is what I am trying to do.
    1. I have a XSD file called Status.xsd, which has three complex types in it.
    2. Using Jdeveloper Tools --> JAXB Compilation, I have created Jaxb classes for the above XSD files. For each of the complex type the jaxb class generator generated on IMPL clas and one abstract class.
    3. Now I have created one simple java class called Class1.java and created one method that takes the StatusImpl as input and as output for that method. Here is the code for Class1.java
    public class Class1 {
    public Class1() {
    public StatusImpl getstatus (StatusImpl in) {
    StatusImpl out;
    out = in;
    return out;
    4. Now, I trying to create a web service for this java class from jedeveloper. I have right clicked this class and went thru the wizard Create J2EE web services.
    5. At the end, the web service project got created successfully and I am trying to run this project from jdeveloper. When I run this project, I am getting the following kind of error message in the browser
    It looks like when the runtime deployment classes are trying to instantiate the abstract classes instead of the impl class. and for all the complex types they trow that error and the web service could not be even invoked.
    What could be the issue? Is the jaxb based web services supported with jdeveloper 10g?
    Thanks,
    Renga

  • 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

  • Using WS-Security with Web Service Controls in WLI 8.1 SP3

    We have a process that calls a web service hosted on a .NET environment. The technique we have used is to generate a service control from the web service WSDL and call that control from a process. The web service is protected using a WS-Security usernameToken policy. The problem is that the .NET environment requires the wsse:Nonce and wsu:Created elements to be provided along with the token and I cannot see how I can specify this using a wsse policy file in WebLogic workshop. Does anyone have any advice for the best way to add this information to the security element in the SOAP header from within a WLI process? I've seen some example code for a java web service client, but that would not really fit with the control-based approach normally adopted in a WLI environment.

    You won't be able to do this using the WSSE file.
    An easy way to get around this is to use an XML Bean built from the WS-Security XML Schema. You'll have to read the WS-Security spec to determine how to create the nonce, but you'll be able to convert this XML Bean into the Element[] that the setOutputHeaders() method, which is on the service control you call the .NET Web Service with.
    Regards,
    Mike Wooten

  • 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'.

  • Security in Web services

    I am new to web services so please pardon me if what I am asking is really dumb.....
    I have created a simple PL/SQL web service using JDeveloper that I have published to an installation of 9iAS. My client is calling this URL directly passing the parameters in the URL and getting the SOAP message back. Everything works great.
    Now I need to secure this somehow. This is an internal application, so I am not terribly concerned with security, but we do need something that will prevent somebody who stumbles across this URL to start using it.
    I have read a lot of documentation on securing web services, but it all seems to be around creating clients, but I don't want a client, I just want to be able to call the URL directly from external systems programmatically.
    One option is obviously to pass username / pw in as parameters and then validate this in PL/SQL, but this is obviously not very secure.
    Another things I was thinking was to use the owa_util.get_cgi_env('REMOTE_ADDR') inside by PL?SQL function to get the IP Address of the client calling and then validate this to make sure this client is allowed to access the web service. This function returns ORA-06502. Does anybody know anything about how to get the IP address of the client calling? I know there are ways to limit access to certain IP addresses on the web server level, but this server is used for other things so I don’t want to do that.
    Is there anything else I can do to secure a web service like this?
    Any help is appreciated.

    More reading and code sample (see end of this post) of what is coming and what is possible today:
    http://www.oracle.com/oramag/oracle/02-jul/index.html?o42special_web.html
    http://otn.oracle.com/oramag/webcolumns/2003/techarticles/smith_wss.html
    This article from Vipin Samar gives the state of WS-Security pretty accurately:
    http://otn.oracle.com/tech/webservices/standards/Samar_Security.htm
    Accompanying paper:
    http://otn.oracle.com/tech/webservices/pdf/33206.pdf
    And, this code sample/tutorial illustrates SSL with Web services:
    http://otn.oracle.com/sample_code/tutorials/wspki/toc.htm
    Mike.

  • 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

  • Security of Web Services, Agents and Sequantial Calling of Web Services

    I want to ask about the secure invocation of web services and the role of agents.
    Suppose that I have greet() web service:
    public String greet() {
    String S1=sayHello(); // A web service, actually its proxy
    String S2=sayGoodMorning(); // A web service, actually its proxy
    return S1+" "+S2;
    It calls two other webservices and they return "HELLO" and "Good Morning". Also assume that I need to secure all my web services but I need these calls to work!
    I put an agent in front of those two web services and require them to check a SAML token. I also attach an agent to greet() to authenticate the inbound and sign and add SAML token for outbound.
    But I think these two calls fail because the SAML is not created on each call. (Is it?)
    How can I make those two calls, secure each web service and at the same time keep the security code out of business code, in other words keep my web service security agnostic?
    Thank you in advance.
    Best Regards
    Farbod

    Any Comments on this?

Maybe you are looking for

  • Error while resetting the PO release using the FM BAPI_PO_RESET_RELEASE

    Hi Friends, My requirement is to Reset the Purchase Order release. I am using FM  BAPI_PO_RESET_RELEASE, and i am getting the Exception PREREQUISITE_FAIL(Release Prerequisite Not Satisfied) after executing this Function module. I found that For PO wh

  • Could not able to send email notification through approval workflow

    Hi, I am trying to send an email notification to the requester and approver on request creation and when the approver approves the request then an email should get triggered to the request with approve/reject outcome. All the SOA configuration has be

  • How to release the cancelled transport request ...

    Hi Experts, i have released a TR and it was cancelled bcos my system is very slow. Once the system is up,i was tried to release the TR.But  i am not able to release it. Please help me on this. Thanks, Babu

  • OBIEE Role-based visibility

    HI Experts, I have come across few questions about the Role-based visibility for OBIEE reports and Dashboards. Can anyone please let me what exactly is this and if possible provide some pointers. Thanks in Advance. VR

  • Re-installing SAP Business One

    After removing and re-installing SQL Server 2005 and SAP Business One 2005 SP01 with no problems or error-messages I try to install SAP Business One 2005 SP01 again and get to the Installation screen with text: "One of the following must be successfu