Injecting message security int Glassfish EJB3.0 Web Service Endpoint

I need to specify message security in sun-ejb-jar.xml descriptor. According to documentation: https://glassfish.dev.java.net/javaee5/webservices/dispatch_process.html#EJB
when EJB is deployed, ejb-jar.xml, webservices.xml, and sun-ejb-jar.xml get created. This works. The documentation goes on to say that if an ejb-jar.xml or sun-ejb-jar.xml file is provided in the EJB-JAR, they will be used as starting points when descriptors are generated. This does not seem to work.
I have tried to create descriptors by hand but was unsuccessful at this as well.
Is there a way to modify descriptors generated by the application server following a deploy with no descriptors), so that I can package them with my EJB-JAR? I tried and couln't get that to work.
Basically, I need to be able to add message-security-binding and auth realm configs to the sun-ejb-jar.xml, if that is at all possible. Thanks for any help anyone can give.
Frank

Well, I managed to get this to sort of work. I am able to deploy my EJB with only a sun-ejb-jar.xml descriptor. The glassfish container generates the webservices.xml and ejb-jar.xml, and updates the sun-ejb-jar.xml file passed in. I now am seeing a new problem.
Here are the scenarios:
1) Default security provider:
Request policy: auth-source="content" auth-recipient="after-content"
Client signs and then encrypts message, all works fine.
2) Specify provider and request protection in sun-ejb-jar.xml to be signature
Request policy: auth-source="content"
Client signs message
All works fine.
3) Specify provider and request protection in sun-ejb-jar.xml to be signature and encrypted. (Should be same as Scenario one).
Request policy: auth-source="content" auth-recipient="after-content"
Client signs and then encrypts message.
The server throws the following exception:
[#|2007-03-07T17:30:37.895-0700|SEVERE|sun-appserver-pe9.0|javax.enterprise.resource.webservices.jaxws.server.soapmd|_ThreadID=12;_ThreadName=httpWorkerThread-8080-1;_RequestID=eb686a92-f5a7-4a24-a83f-fbffeed3dd4d;|Error in decoding SOAP Message
Error in decoding SOAP Message
at com.sun.xml.ws.encoding.soap.server.SOAPXMLDecoder.toInternalMessage(SOAPXMLDecoder.java:89)
at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.toMessageInfo(SOAPMessageDispatcher.java:187)
at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher$SoapInvoker.invoke(SOAPMessageDispatcher.java:571)
at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:145)
at com.sun.xml.ws.server.Tie.handle(Tie.java:88)
at com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:160)
at com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:89)
at com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:178)
at com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:109)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:100)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:71)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
Caused by: javax.xml.ws.soap.SOAPFaultException: Cannot find the dispatch method
at com.sun.xml.ws.encoding.soap.SOAPDecoder.raiseFault(SOAPDecoder.java:674)
at com.sun.xml.ws.encoding.soap.server.SOAPXMLDecoder.decodeDispatchMethod(SOAPXMLDecoder.java:152)
at com.sun.xml.ws.encoding.soap.SOAPDecoder.decodeBodyContent(SOAPDecoder.java:337)
at com.sun.xml.ws.encoding.soap.SOAPDecoder.decodeBody(SOAPDecoder.java:327)
at com.sun.xml.ws.encoding.soap.SOAPDecoder.decodeEnvelope(SOAPDecoder.java:250)
at com.sun.xml.ws.encoding.soap.server.SOAPXMLDecoder.toInternalMessage(SOAPXMLDecoder.java:81)
... 29 more
Please note that the client is the same for Scenario 1 and 3, yet the outcome is greatly different.
Also, I did try manually change the generated descriptor, rather than passing in sun-ejb-jar.xml. This did not work either. same error.
Thanks for any help.
Message was edited by:
FrankF@Sun
Message was edited by:
FrankF@Sun

Similar Messages

  • Adding security to my PL/SQL Web Service

    Hi, I created a web service based on PL/SQL procedure using Jdeveloper, OC4J and now I would like to know all the options that exists for security (SSL, user/password, etc).... Is there any .pdf /whitepaper / Guide of security in Oracle Web services ?
    Thanks...

    Hi John,
    For basic security (SSL and basic auth), you should look at the security guide for the container itself - see Security Guide.
    For WSS [Web services Security], there is the Security Guide from the Oracle Application Server Documnetation Library.
    Hope this helps,
    -eric

  • Web Service Endpoint URI expected. Not found endpoint with URI /wssproc

    Hi All,
    We are following the steps mentioned here http://help.sap.com/saphelp_nwpi71/helpdata/en/ea/c91141e109ef6fe10000000a1550b0/frameset.htm to configure the message level security in our new PI 7.1 system.
    We have created the RFC destination with prefix /wssproc/plain?style=document. But when we test the RFC connectioon, we get the following error message:
    Status HTTP Response     404
    Status Text     Not Found
    And response body is: Web Service Endpoint URI expected. Not found endpoint with URI /wssproc.
    Are we missing a configuration point? Do we need to create the endpoint manually? And if yes, how?
    Regards,
    Masoud
    Edited by: Masoud Ahanchian on Jul 23, 2009 4:58 PM

    Well, in addition to the 404 message I get the following error as well (i.e. if I go to the link http://<server>:<port>/wssproc/plain?style=document)
    Web Service Endpoint URI expected. Not found endpoint with URI /wssproc.
    Regards,
    Masoud

  • Operations not sorted in the drop list of the web service endpoint

    Hello,
    Since the beginning of oc4j standalone till the last release 10.1.3.5.0, the operations in the drop list of the web service endpoint are not alphabetically sorted,
    they are in a random order.
    If a web service contains a lot of operations, it's always difficult to find one operation in the list.
    How can this list be sorted ?
    I don't see any sort option in the web service properties (in Jdevelopper) or in the deployment descriptor (in Jdevlopper).
    Best regards
    Laurent

    You are correct...the above code is useful only when debugging in Visual Studio.  You should have better luck with either of the following two options:
    Option 1: Retrieve the id from the response of SaveChanges()
    sc.AddToSampleList(new ServiceReference.SampleListItem { Title= "Hello World" });
    System.Data.Services.Client.ChangeOperationResponse response = sc.SaveChanges().FirstOrDefault() as System.Data.Services.Client.ChangeOperationResponse;
    int id = ((ServiceReference.SampleListItem)((System.Data.Services.Client.EntityDescriptor)response.Descriptor).Entity).Id;
    Option 2: Create the list item and access its properties after calling SaveChanges()
    ServiceReference.SampleListItem li = new ServiceReference.SampleListItem { Title= "Hello World" };
    sc.AddToSampleList(li);
    sc.SaveChanges();
    int id = li.Id;

  • No business interface, component interface or web service endpoint interface found for Session Bean SessionEJB

    hi ,
    i am just using EJb in my Application
    just created an SessionBean and with Local interface in it i am getting this wierd exception with weblogic NetBeans and eclipse also
    weblogic.ejb.container.compliance.ComplianceException: No business interface, component interface or web service endpoint interface found for Session Bean SessionEJB
    weblogic.ejb.container.compliance.ComplianceException: No business interface, component interface or web service endpoint interface found for Session Bean SessionEJB
        at weblogic.ejb.container.compliance.SessionBeanClassChecker.checkInterfacesExist(SessionBeanClassChecker.java:177)
        at weblogic.ejb.container.compliance.Ejb30SessionBeanClassChecker.checkInterfacesExist(Ejb30SessionBeanClassChecker.java:27)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at weblogic.ejb.container.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:331)
        at weblogic.ejb.container.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:280)
        at weblogic.ejb.container.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:789)
        at weblogic.ejb.container.ejbc.EJBCompiler.doCompile(EJBCompiler.java:222)
        at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:461)
        at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:428)
        at weblogic.ejb.container.deployer.EJBDeployer.runEJBC(EJBDeployer.java:437)
        at weblogic.ejb.container.deployer.EJBDeployer.compileJar(EJBDeployer.java:795)
        at weblogic.ejb.container.deployer.EJBDeployer.compileIfNecessary(EJBDeployer.java:683)
        at weblogic.ejb.container.deployer.EJBDeployer.prepare(EJBDeployer.java:1254)
        at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:442)
        at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
        at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
        at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
        at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
        at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:613)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
        at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:184)
        at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:58)
        at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
        at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:207)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
        at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
        at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
        at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
        at weblogic.ejb.container.compliance.EJBComplianceChecker.check(EJBComplianceChecker.java:321)
        at weblogic.ejb.container.compliance.EJBComplianceChecker.checkDeploymentInfo(EJBComplianceChecker.java:280)
        at weblogic.ejb.container.ejbc.EJBCompiler.checkCompliance(EJBCompiler.java:789)
        at weblogic.ejb.container.ejbc.EJBCompiler.doCompile(EJBCompiler.java:222)
        at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:461)
        Truncated. see log file for complete stacktrace
    >

    Hi Rajendar,
    I think the problem with having empty interfaces, or interfaces without methods for EJBs, is that they don't really make  "sense". After deploying your EJB, a client application will use JNDI or dependency injection to access your EJB.  So in your case it will look something like this
    @EJB
        mytestSSBLocal myejb; //(In this case we are using the local interface)
    In the second step, you will want to do something will your EJB, but since mytestSSBLocal doesn't define any methods, there is nothing you can do with your ejb.
    The Exception is telling you that weblogic couldn't find a complaint interface for your EJB.
    best regards, Nicolas

  • Loading JDO in a web service endpoint

    I have a web service endpoint (Java class exposed as a web service) I'm developing in NW04-sp9, and I'm having trouble getting access to JDO in my web service.  I have an object class I'd like to persist using JDO, and I've developed them and run the build helper utility to make them persistable.  I believe that this works, because I can look at the .class file in a text editor and see references to javax/jdo/spi/PersistenceCapable.
    In my WSE, I try to get the default PersistenceManagerFactory doing a JNDI lookup with:
    _pmf=(PersistenceManagerFactory)ctx.lookup("java:comp/env/jdo/defaultPMF");
    which fails with a NamingException.  Based on another forum posting, I tried:
    _pmf=(PersistenceManagerFactory)ctx.lookup("deployedAdapters/jdo/defaultPMF/shareable/jdo/defaultPMF");
    Which actually seems to work, but when I do this, I get a NoClassDefFoundError on javax/jdo/PersistenceManagerFactory from the web service endpoint.
    I have added the com.sap.jdo application to my WSE's application-j2ee-engine.xml file, as described in the JDO chapter of the NW04 documentation.
    Any clues what I'm missing?
    Thanks,
    - Bill

    >
    > I will check if it is possible to declare resource
    > references for web services and tell you.
    >
    Thanks very much
    >
    > By the way, I have just found out that one can lookup
    > JCA connection factories in the global JNDI context
    > without having to declare resource references. I
    > don't like this. In my opinion, applications should
    > never access the global JNDI context directly, but
    > only the local java:comp/env context.
    >
    > You can find the JDO PMF at the following location in
    > the global JNDI context:
    >
    > deployedAdapters/jdo/defaultPMF/shareable/jdo/default
    > PMF
    >
    I did this (see my initial post), and I agree that it's a bad idea.  I didn't have much choice, though   When I did this, and I tried to cast the returned object to a PersistenceManagerFactory, I received a NoClassDefFoundError, which led me to believe that the JDO classes were not loaded into the web service container.  This is what led me down the resource reference path.
    >
    > I don't know when this deployedAdapters directory was
    > introduced, but I can imagine why. Most likely, there
    > are runtime environments like Web Dynpro or Web
    > Services where one needs to access JCA adapters, but
    > where resource references are not available.
    >
    Thanks again,
    - Bill

  • Use dynamic web services endpoints with eInsight

    Hi,
    I'm dealing with a small problem when integrating two multiple systems based on web services.
    The problem is that I�ve a WSDL that represents different web services endpoints and my Business Process have to look out the input information and access a different web service endpoint corresponding to the input code. I only want to be able to change the endpoint of the web service or change the server that is called. However I don't know how can do it or if I can.
    To explain more clearly I�ll give an example. Imagine a company with some stores. All the stores have a web service with the same WSDL (changing the endpoint). I want to be able to call the web service in different endpoints automatically, without having to import another WSDL and make changes on my Business Process.
    I hope someone can help me. Thank you in advance.

    I would prefer using a Sun's JAX-RPC implementation if you are using JBoss. USe JBossWS. There are many things you have to consider when developing a Web Services. You should probably research that first. If it is your first web service, probably you are better off using RPC style web services. The documents and samples are all available on SUN web site. Try those out. For deploying on JBoss you would require to configure some jboss specific deployment descriptors.

  • Question About Web Service Endpoint

    Is there a way to specify the endpoint of a Web Service that exposes a Data Source?
    For example, if I have a Liquid Data Control jcx with a Java package of foo.bar and the corresponding jws file is also in this package, then the web service endpoint will be http://myserver/myproject/foo/bar/mywebservice.jws.
    Is there a way to change this to say something like http://myserver/myproject/services/mywebservice.jws.
    Thanks.

    JWS files are created by Workshop. Try posting on the Workshop newsgroup or check edocs.

  • Jena Adapter and SPARQL web service endpoint

    As I understand, with Jena adapter java interface, the client can connect to Oracle RDF database directly. Why does it still need SPARQL web service endpoint? Does the query request from Jena adapter at client side have to go through SPARQL webservice first then route to Oracle server? Or the query with SPARQL need to go through webservice and non SPARQL query directly go to Oracle server?
    Thanks.

    Hi,
    You are right that a client can connect to Oracle RDF directly through the Jena Adapter. The reason for providing a SPARQL web service endpoint is to give additional interoperability and flexibility. With the SPARQL web service endpoint, one does not even need to write any Java code to interact with the underlying database. It also makes SPARQL federation a lot easier.
    Hope it helps,
    Zhe Wu

  • Sending WSSE security headers to non-weblogic web service

    I have been trying to send wsse headers to a non-weblogic web service. I am looking for a way to do this using the control file I generated from the wsdl or the page flow where I implement the control, or the message handler file. I have username and password parameters but I cannot get this to function.
    Here is the signature I need:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <env:Header>
    - <wsse:Security env:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    - <wsse:UsernameToken wsu:Id="Id-dFQDZm_34ewPYtaARIJ_4BfI" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsse:Username>weblogic</wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">weblogic</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </env:Header>
    - <env:Body>
    <n1:hello xmlns:n1="http://workshop.bea.com/WebServiceB" />
    </env:Body>
    </env:Envelope>
    Of course the Body is different, but this is the security signature that I need to get into the header. After looking at all the examples, I only see the option of using a java proxy class to call the web service, which would be a little difficult to use as my whole page flow application so far is calling the web service from a generated control. There are also lots of coplex datatypes that are being sent to the web service so a jave proxy would be a little difficult. I have tried to take the code from the java proxy class example and put it in my handler class, but the handler seems to only use MessageContext, not WebServiceContext and will not let me add the username password tokens. When I have tried to case a WebServiceContext out of a MessageContext, it gives me a runtime error "Class Cast Exception" even though workshop lets me do it.
    This is extremely urgent. Please help me! I am using the sample handler class called MessageHandler.java and the sample WSSE java proxy class called WebServiceBClient.java that generated the above signature.

    More information:
    Here is the first part of my Java Control where I am calling the web service and the message handler:
    package controls;
    * @jc:location http-url="http://localhost:7001/Checking.jws"
    * @jc:wsdl file="#CheckingWsdl"
    * @jc:handler callback="MessageHandler" operation="MessageHandler"
    public interface CheckingService extends com.bea.control.ControlExtension, com.bea.control.ServiceControl
    public static class CustomerInfo
    implements java.io.Serializable
    public java.lang.String FirstName;
    public java.lang.String LastName;
    public java.lang.String MiddleName;
    public int SSN;
    public int CustomerNumber;
    public java.util.Calendar CreationDate;
    public java.util.Calendar LastModifiedDate;
    public static class FundingInfo
    implements java.io.Serializable
    public float Amount;
    public java.util.Calendar CurrentDate;
    public int AccountNumber;
    public static class anyType
    implements java.io.Serializable
    public com.bea.xml.XmlObject[] t;
    public static class AccountInfo
    implements java.io.Serializable
    public int AccountNumber;
    public float Balance;
    public int CustomerNumber;
    public java.util.Calendar LastModifiedDate;
    * @jc:protocol form-post="false" form-get="false"
    public AccountInfo CreateAccountChecking (CustomerInfo CustomerInfo, FundingInfo FundingInfo, anyType CommonHeader);
    static final long serialVersionUID = 1L;
    Here is the section of the MessageHandler class where I am attempting to add security token to the header:
    protected void addSecurityHeader (MessageContext mc)
    * Registers a handler for the SOAP message traffic.
    HandlerRegistry registry = mc.getHandlerRegistry();
    List list = new ArrayList();
    list.add(new HandlerInfo(WSSEClientHandler.class, null, null));
    registry.setHandlerChain(new QName("hello"), list);
    try
    WebServiceContext context = (WebServiceContext)WebServiceContext.currentContext().getLastMessageContext();
    //(WebServiceContext)mc;
    WebServiceSession session = context.getSession();
    * Set the username and password token for SOAP message sent from the client, through
    * the proxy, to the web service.
    UserInfo ui = new UserInfo("weblogic", "weblogic");
    session.setAttribute(WSSEClientHandler.REQUEST_USERINFO, ui);
    //mc.setProperty(WSSEClientHandler.REQUEST_USERINFO, ui);
    * Adds the username / password token to the SOAP header.
    SecurityElementFactory factory = SecurityElementFactory.getDefaultFactory();
    Security security = factory.createSecurity(null);
    security.addToken(ui);
    session.setAttribute(WSSEClientHandler.REQUEST_SECURITY, security);
    //mc.setProperty(WSSEClientHandler.REQUEST_SECURITY, security);
    } catch (Exception ex) {System.out.println("EXCEPTION CAUGHT DOING SECURITY STUFF " + ex.getMessage());}
    I tried to use the MessageContext to do this but it came out null. I tried to cast the MessageContext to WebServiceContext and it gave me a Class Cast Exception. I tried to add the HandlerRegistry section to this but of course the assignment mc.getHandlerRegistry is improper and is not compiling so don't let that confuse you.

  • EJB3 Entities + Web Services: A cycle is detected in the object graph

    I have a Java EE 5 application, using Glassfish v2. My ejb project consists of a handful of entity beans, session beans, and this problem arose when I added a new web service.
    Here is a simple scenario borrowed from another forum post with a similar problem:
    Let's say I have a web service called getVehicle(int vehicleId) that returns a Vehicle object.
    Vehicle has a java.util.Set of Wheel objects.
    The Wheel object has a reference to its owner (Vehicle).
    The issue is this bi-directional relationship causes a cycle that the JAX system doesn�t like.
    Caused by: javax.xml.bind.MarshalException
    - with linked exception:
    [com.sun.istack.SAXException2: A cycle is detected in the object graph. This will cause infinitely deep XML: org.test.Vehicle at 13c6308 -> org.test.Wheel at 15880be -> org.test.Vehicle at 13c6308
                  at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:282)
                  at com.sun.xml.bind.v2.runtime.BridgeImpl.marshal(BridgeImpl.java:110)
                  at com.sun.xml.bind.api.Bridge.marshal(Bridge.java:178)
                  at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:299)
                  ... 54 more
    The one bit of information that I found that might fix this doesn't do much for me:
    https://jaxb.dev.java.net/guide/Mapping_cyclic_references_to_XML.html
    What options do I have to make my soap method work?
    Thanks,
    Hugh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    i have got the same issue�C
    how did you implement onCycleDetected method�H
    can you send your full code to my mail [email protected]
    thanks !

  • Security Error when creating a web service with Flex

    Hello comminuty.
    I'm using Flex to create a standalone application and I have to use web services to retrieve data from SAP.
    I used the bapi bapi_flight_getlist to create an associated WS that works fine (tested with the Eclipse's WS Explorer).
    In Flex Builder, I use the following code to create my web service:
         <mx:WebService
              showBusyCursor="true"
              id="service"           
              wsdl="{wsdl}"
              result="resultCreateWSHandler(event);"
              fault="faultCreateWSHandler(event);">
                <mx:operation name="FlightGetList"
                     result="resultWSHandler(event)"
                     fault="faultWSHandler(event)"></mx:operation>                    
            </mx:WebService>
    And this is the error I'm getting:
    (mx.messaging.messages::ErrorMessage)#0
      body = (null)
      clientId = "DirectHTTPChannel0"
      correlationId = "E578ED8C-EF29-44E7-8D57-57B4DB6EB613"
      destination = ""
      extendedData = (null)
      faultCode = "Channel.Security.Error"
      faultDetail = "Destination: DefaultHTTP"
      faultString = "Security error accessing url"
      headers = (Object)#1
        DSStatusCode = 0
      messageId = "6E7AC45E-418D-90CD-96AD-57B52DB1DAF4"
      rootCause = (flash.events::SecurityErrorEvent)#2
        bubbles = false
        cancelable = false
        currentTarget = (flash.net::URLLoader)#3
          bytesLoaded = 0
          bytesTotal = 0
          data = (null)
          dataFormat = "text"
        eventPhase = 2
        target = (flash.net::URLLoader)#3
        text = "Error #2048: Violation de la sécurité Sandbox : http://localhost:8300/ztest2/bin-debug/ztest2.swf ne peut pas charger de données à partir de http://XXXX:8006/sap/bc/srt/wsdl/bndg_DEB8A28C2E19EEF19C080050568D135B/wsdl11/allinone/ws_policy/document?sap-client=800."
        type = "securityError"
      timestamp = 0
      timeToLive = 0
    Translation: "Error #2048: Sandbox security violation: http:....swf cannot load data from http:...client=800"
    Would any of you have an idea about what is causing this error??
    Thanks for any help you can provide.
    Regards,
    C.

    Hi Cristina
    Did your flex application worked. i am also having same problm. cant access the BAPI from standalone flex application.
    Jay

  • ColdFusion failed security in invoking a WebSphere web service

    Hello,
    I tried to call a web service hosted in a IBM WebSphere
    server, but could not pass WebSphere's security framework. After
    some talking with the guys in the WebSphere side, I'm not sure
    whether this is possible in ColdFusion because they ask for a
    <wsse:UsernameToken> in the SOAP envelope header. We did some
    testing, and they confirmed that ColdFusion could talk to the web
    service, by could not pass security validation. Would someone help
    me here? Must it be done in Java?
    Here is my calling syntax in ColdFusion:
    <cfinvoke webservice="https://WebServiceURL?wsdl"
    method="myMethod" username="myUserName" password="myPassword"
    returnVariable="ReturnCode">
    <cfinvokeargument name="ParaName"
    value="ParameterValue">
    </cfinvoke>
    The web service is locked down, so the calling client must
    issue a SOAP message containing VALID security extensions:
    <soapenv:Envelope
    xmlns:soapenv="
    http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ws="
    http://somedomain"
    xmlns:wsse="
    http://schemas.xmlsoap.org/ws/2002/07/secext">
    <soapenv:Header>
    <wsse:Security>
    <wsse:UsernameToken>
    <wsse:Username>myUserName</wsse:Username>
    <wsse:Password>myPassword</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </soapenv:Header>
    <soapenv:Body>
    ... REMOVED as this depends on your individual SOAP service
    </soapenv:Body>
    </soapenv:Envelope>
    The guys at WebSphere said that my ColdFusion SOAP call
    probably did not have the envelope security header. IIs there a way
    to capture the underlying actual SOAP call format? Here is the
    error msg:
    AxisFault
    faultCode: {
    http://schemas.xmlsoap.org/ws/2003/06/secext}FailedAuthentication
    faultSubcode:
    faultString: WSEC5075E: No security token found which
    satisfies any one of AuthMethods.
    faultActor:
    faultNode:
    faultDetail:
    http://xml.apache.org/axis/}stackTrace:WSEC5075E:
    No security token found which satisfies any one of AuthMethods.
    at
    org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
    at org.apache.axis
    Larry

    Sadly, byrning's reply ended with just "how to use CF with stupid WSSE security", which leads readers to wonder if he meant to share more. For instance, was that supposed to be a link to a blog entry?
    I did some digging, and I found an old google cache of another version of this forum, and it showed that he had included the following code, which somehow never made it into the message here:
    <cfset myUsername = "yourUsername" />
    <cfset myPassword = "yourPassword" />
    <cfset myDate = DateFormat(DateConvert("local2Utc", now()),
    "yyyy-mm-ddThh:mm:ssZ")>
    <cfset myNonce = createPIN(33)> <!--- this is just a random alpha numeric
    string 33 chars long - got the function at cflib.org --->
    <cfset myPasswordDigest = ToBase64(Hash(myNonce & myDate & myPassword ))>
    <cfscript>
            myObj = createObject("webservice", "http://urltoYourService?wsdl");
            headerElement = createObject("java",
    "org.apache.axis.message.SOAPHeaderElement");
            headerElement.init("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wss
    ecurity-secext-1.0.xsd", "wsse:Security");
            headerElement.addChildElement("wsse:UsernameToken");
            headerElement.getFirstChild().addChildElement("wsse:Username").setValue(myUsern
    ame);
            mypass = headerElement.getFirstChild().addChildElement("wsse:Password");
            mypass.setValue(myPasswordDigest);
            mypass.setAttribute("Type", "wsse:PasswordDigest");
            headerElement.getFirstChild().addChildElement("wsse:Nonce").setValue(
    ToBase64(Hash(myNonce, "SHA")) );
            myCreated = headerElement.getFirstChild().addChildElement("wsu:Created");
            myCreated.setValue(myDate);
            myCreated.setAttribute("xmlns:wsu",
    "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-ut....
    xsd");
            headerElement.setMustUnderstand(1);
            headerElement.setActor("");
            myObj.setHeader(headerElement);
            result = myObj.methodtoCall(param1="yadda", param2="yadda")
    </cfscript>    

  • Support message from satellite to SolMan throughout web service

    Hi all,
    Currently we have activated support messages between satellite systems and SM. This functionallity is working fine; users create messages with "help->create customer message". But now we want users to create messages trhoughout web service (bsp). We know that this funcionallity exists, but we don't know neither the way it can be activated nor the way we can access to this service.
    Any idea?
    Thanks in advance.
    Bst Regds,
    Jose Sorli

    Hi Jose,
    For the creation of messages via WEB you can use BSP dswp_create_msg:
    In SICF activate this service
    After call the following url:
    http://server:XXXX/sap/bc/bsp/sap/dswp_create_msg?sap-client=YYY
    server: full hostname server of solman system
    XXXX: HTTP service that you can see in SMICM->Goto->Services
    YYY: Service desk client
    Look in SAP SMP for notes with string dswp_create_msg.
    From note  699087 ( a little old but ok):
    For the application to function, perform the following in the Solution
    Manager system:
        o  Ensure that an HTTP or HTTPS service is running in the Internet
           Communications Manager (transaction SMICM).
        o  Ensure that the services necessary for running BSP applications
           are activated (transaction SICF). These services include:
           -  /default_host/sap/public/bc/ur
           -  /default_host/sap/public/bsp/sap/htmlb
           -  /default_host/sap/public/bsp/sap/public/bc
           -  /default_host/sap/bc/bsp/sap/dswp_create_msg
    The URL necessary to call dswp_create_msg takes the following form:
        o  http://<host>:<port>/sap/bc/bsp/sap/dswp_create_msg?sap-client=
           <client>
    Where <host>, <port> and <client> are the host name, port and client
    respectively of the SAP Web Application Server. For futher information
    on the Internet Communications Manager, please see the SAP Web
    Application Server online documentation.
    Best regards,
    Dolores

  • MDB receive a message and then call an external web service

    Title basically says it all, but I'm looking for suggestions for the best way to have a message driven bean receive a message then process it and call an external web service with the results. This seems like a straightforward problem to solve but I keep getting stuck in the deployment to weblogic when I do it my way so I'm looking for new ideas.
    Basically, I have an MDB that gets deployed to WL 10.3 and receives messages just fine. Also, I have a standalone class, that runs from the command line or IDE, that can send messages to the external web service. But when I try to bring the code from the standalone class into the MDB and get it deployed, I can't get all the dependencies to resolve.
    So, is there a proper (quick and easy) way to do this? Which wizard should I be using to get Workshop to create web service client so that I can use it in my MDB project? Any suggestions to tutorials?
    Thanks,
    Matt

    Yes BusinessService is the reference point used in OSB to call a backend provider service. So we need to configure the business service based on the external service (they can be http based, jms based, etc ..)
    In your case I am assuming it is a http based web service. So below are the steps to be done:
    1. Create a business service (if you dont have a wsdl then create it as "Any soap type" else upload the wsdl as a wsdl resource and then use it) and configure the url of the business service with the URL of the external service you want to invoke.
    2. From the proxy flow, have a service callout action and select the business service. Then configure the appropriate body and header variables.
    3. Then test the proxy service from the test console, you should be able to see the response from the external service as a part of the service callout response.
    Let me know if you still have issues.
    Thanks,
    Patrick

Maybe you are looking for