Handler chains in 8.1

First, I noticed that Weblogic Workshop projects don't have a
web-services.xml file. Since that's where handler chains are defined, how
does one create handler chains with Workshop? Is it possible?
For Weblogic Server, there is a web-services.xml file and this is where you
define handler chains.
What if you want a global handler? For example you might want a handler that
looks at headers for all message traffic coming into or going out of your
Weblogic Server. Is it possible to define handler chains in a global config
file for this?
If there is no way to do the global config file, how about doing it
programmatically? Is there a way to make the server load your own custom
class on startup, and have that custom class register a handler chain for
all inbound and outbound SOAP calls?
Thanks,

I put it in the debugger and found that HandlerRegistryImpl fires for both
client & server side calls. Looks like this will work.
"manoj cheenath" <[email protected]> wrote in message
news:[email protected]..
I think that is also client side. I think the best option for you
is to contact support and file an enhancement request for
global handler chain.
http://manojc.com
"Michael R. Clements" <[email protected]> wrote in message
news:[email protected]..
"manoj cheenath" <[email protected]> wrote in message
news:3ee0d4d3$[email protected]..
weblogic.webservice.core.rpc.ServiceFactoryImpl is used
only on the client side. Subclassing and adding handler may
work at the client side, but this usecase is not planned or tested.That gave me a different idea. Is HandlerRegistryImpl used for bothclients
and servers?
Suppose we override HandlerRegistryImpl to always add our handler to
every
chain, even for QNames that don't have chains. Then this single "hook"would
always fire our handler in both cases, and no server or client code
would
even know it exists.

Similar Messages

  • Problem using Handler chain with JAXWS

    Hi, I want to use handler chain on a web service and I'm not sure if I understood correctly how it works. In every example I found on the web the handler chain is applied on the client side (the binding is made on the generated client side). So, when I send a request the handler catch an outbound message and when the web service respond, it receive an inbound message. The problem is that I would like to link the handler on the server side, i.e. when the web service receive a request, the handler receives an inbound message and when the WS respond it receives an outbound message.
    Is it possible to do so?? I mean, it makes no sense to link the handler on the client side, since I don't have control on the client side, I produce web services and I want to apply some handlers at this level.
    Any idea??? Or is there something that I didn't understand about handler chains??
    Thanks,
    Korg

    Hello again, I finally found how to do what I wanted to do. The problem came from different examples I found on the web. In my handler.xml file, the structure must be something like:
    <jws:handler-chains xmlns:jws="http://java.sun.com/xml/ns/javaee">
    <jws:handler-chain>
    <jws:handler>
    <jws:handler-class>........</jws:handler-class>
    </jws:handler>
    </jws:handler-chain>
    </jws:handler-chains>
    In many examples, there is an element at the root that is "handler-config" and it doesn't work if I use it this way. Here's an example of a handler.xml file that doesn't work:
    <handler-config>
    <handler-chains>
    <handler-chain>
    <handler>
    <handler-class>............</handler-class>
    </handler>
    </handler-chain>
    </handler-chains>
    </handler-config>
    Korg

  • Web-services.xml for EJB component and SOAP Message Handler Chain

    I have used the following example for my own web service with EJB component and SOAP
    Message Handler Chain:
    http://e-docs.bea.com/wls/docs70/webServices/dd.html#1058208
    I have a deployment error:
    javax.naming.NameNotFoundException: Unable to resolve 'app/ejb/DocumentService.j
    ar#DocumentService/home' Resolved: 'app/ejb' Unresolved:'DocumentService.jar#Doc
    umentService' ; remaining name 'DocumentService.jar#DocumentService/home'
    In attachement is the ear file.
    Is there a problem in web-services.xml?
    Thanks
    [ws_dox_sdi.ear]

    It works. Thanks,
    Ioana
    "Neal Yin" <[email protected]> wrote:
    The error means your EJB is not deployed.
    Adding a EJB module to your application.xml file of the ear should fixe
    it.
    <application>
    <display-name />
    <module>
    <web>
    <web-uri>dox_sdi.war</web-uri>
    </web>
    </module>
    <module>
    <ejb>DocumentService.jar</ejb>
    </module>
    </application>
    "Ioana Meissner" <[email protected]> wrote in message
    news:3cf640cc$[email protected]..
    I have used the following example for my own web service with EJBcomponent and SOAP
    Message Handler Chain:
    http://e-docs.bea.com/wls/docs70/webServices/dd.html#1058208
    I have a deployment error:
    javax.naming.NameNotFoundException: Unable to resolve'app/ejb/DocumentService.j
    ar#DocumentService/home' Resolved: 'app/ejb'Unresolved:'DocumentService.jar#Doc
    umentService' ; remaining name 'DocumentService.jar#DocumentService/home'
    In attachement is the ear file.
    Is there a problem in web-services.xml?
    Thanks

  • Handler chain file - validation files

    Hi Everyone,
    I have webservice where I would like to log all SOAP messages. Back in the WebLogic 8.1 days the developer merely specified an annotation to a soap handler like this:
    * @editor-info:link autogen-style="java" autogen="false"
    * @jws:handler operation="foo.utils.soaphandlers.BARHandler"
    During the WebLogic 10.3 upgrade/import process this annotation disappeared. I am thus trying to restore this link to BARHandler. So... following this documentation:
    http://download.oracle.com/docs/cd/E15523_01/web.1111/e13734/handlers.htm#i261458
    I add an annotation:
    @HandlerChain(file="bar_handler.xml")
    and created XML...
    <?xml version="1.0" encoding="UTF-8"?>
    <handler-chains xmlns="http://java.sun.com/xml/ns/javaee">
    <handler-chain>
    <handler>
    <handler-class>foo.utils.soaphandlers.BARHandler</handler-class>
    </handler>
    </handler-chain>
    </handler-chains>
    BARHandler is a modern SOAP handler I know works in another context...
    package foo.utils.soaphandlers;
    ...snip...
    public class BARHandler implements SOAPHandler<SOAPMessageContext>
    ...snip...
    Everything seems to go fairly well, until my <jwsc> task in build.xml blows up with this error (re-spaced for reading):
    build.xml:123: weblogic.wsee.tools.WsBuildException: JWS Validation failed:
    [Handler chain file validation error for file:
    file:/path/src/foo/webservice/bar_handler.xml.
    Element handler-chains@http://java.sun.com/xml/ns/javaee is not a valid
       handler-config@http://www.bea.com/xml/ns/jws document or
         a valid substitution.,
    Handler chain file validation error for file:
    file:/path/src/foo/webservice/bar_handler.xml.
    Element handler-chains@http://java.sun.com/xml/ns/javaee is not a valid
       handler-config@http://www.bea.com/xml/ns/jws document or
         a valid substitution.]
    I worked all day searching for an answer, but no luck so far. I also feel like the gremlins are mocking me! Not only does the validation error repeat twice but the first sentence of JSR 181 specification says all of this is "a simplified programming model". Alas, for me, it hasn't be so "simple" :(
    Thanks a bunch for reading and if you reply I will be very grateful!
    Cheers,
    -Randy

    Hello Randy -
    Please check the following thread.
    Validation Error in the JWS
    Regards,
    Justin.

  • Firefox doesn't handle chained deadkeys on Windows

    It seems that Firefox doesn't handle chained deadkeys as produced by for example this layout http://blogs.msdn.com/b/michkap/archive/2011/04/16/10154700.aspx . Correct characters are not produced as in contrast with them being produced in Windows explorer.

    I think it will be hard to get clear answers about custom keyboard layouts here...
    I did see a bug that sounds related: [https://bugzilla.mozilla.org/show_bug.cgi?id=791300 791300 – Dead-key diacritics non-functional in text forms and address bar] -- the last comment mentions a code comment that chaining is not supported.
    About the bug tracking system:
    * [https://bugzilla.mozilla.org/page.cgi?id=etiquette.html Bugzilla Etiquette]
    * [https://bugzilla.mozilla.org/page.cgi?id=voting.html Voting]

  • Web-services.xml  handler chain

    Hi All,
    My question is this. I use servicegen ant task to generate the web-services.xml
    file,
    then I open the .ear file using winzip and edit the web-services.xml file to include
    the handler-chain information. I have included the following information :
    <handler-chains>
    <handler-chain name="myChain">
    <handler class-name="com.whatever.core.sec.iec.ejb.IECSOAPHandler">
    <init-params>
    <init-param name="logDirectory" value="C:/temp" />
    <init-param name="severityLevel" value="verbose" />
    </init-params>
    </handler>
    </handler-chain>
    </handler-chains>
    and then I include the following in the operation tag:
    <operation method="batchResponseToPSS([B)" component="ejbcomp0" name="batchResponseToPSS"
    handler-chain="myChain">
    and the also following
          <operation method="onlineResponseToPSS([B)" component="ejbcomp0" name="onlineResponseToPSS"
    handler-chain="myChain">
    Without the handler-chains element my app works fine.
    My whole web-sercvices.xml is located at following location:
    http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.webservices&item=3921&utag=
    Any insight will be appreciated.
    Thanks
    ---Radhe
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    I am still not clear what error you are getting.
    1. Are you saying that the handler is not getting
    called?
    2. or you are not able to invoke the web service
    at all?
    If it is 1 check the web-service.xml file of the ear
    deployed. Make sure that your change is not overwritten
    by servicegen.
    If it is 2 then check the URL of the web service in
    web-service.xml file and use a browser to get to
    that URL.
    Regards,
    -manoj
    http://manojc.com
    "Radhe" <[email protected]> wrote in message
    news:[email protected]...
    >
    Manoj,
    Thanks for your reply. When I bring up the WLS, from the messages on theconsole,
    it comes-up pretty cleanly. Theare are no error messages.
    I looked into log files and their is nothing. This has surprised me.
    I worked with some of my friends and they are clueless. I never thoughtto just
    read SOAP Headers, that I have to go through so much pain.
    Also part of my web-services.xml file is generated through servicegen,then I
    crack open the .ear file strip the web-services.xml file, edit it and putit back.
    >
    IF there is some error I would have fixed it.
    Does handler-chains in web-services.xml work, or it is some fiction, BEAmade
    up. I am clueless where I am screwing it up.
    Thanks
    ---Radhe
    "manoj cheenath" <[email protected]> wrote:
    Can you please post the error message?
    This example may also help you:
    http://www.manojc.com/?sample4
    Regards,
    -manoj
    http://manojc.com
    "Radhe" <[email protected]> wrote in message
    news:[email protected]...
    Hi All,
    My question is this. I use servicegen ant task to generate theweb-services.xml
    file,
    then I open the .ear file using winzip and edit the web-services.xmlfile
    to include
    the handler-chain information. I have included the following
    information
    <handler-chains>
    <handler-chain name="myChain">
    <handler
    class-name="com.whatever.core.sec.iec.ejb.IECSOAPHandler">
    <init-params>
    <init-param name="logDirectory" value="C:/temp" />
    <init-param name="severityLevel" value="verbose" />
    </init-params>
    </handler>
    </handler-chain>
    </handler-chains>
    and then I include the following in the operation tag:
    <operation method="batchResponseToPSS([B)" component="ejbcomp0"
    name="batchResponseToPSS"> >> handler-chain="myChain">> >>> >> and the also following> >>> >>       <operation method="onlineResponseToPSS([B)" component="ejbcomp0"> >name="onlineResponseToPSS"> >> handler-chain="myChain">> >>> >> Without the handler-chains element my app works fine.> >>> >> My whole web-sercvices.xml is located at following location:> >>> >>>>http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.webservices&item=3921&utag=> >>> >>> >> Any insight will be appreciated.> >>> >> Thanks> >> ---Radhe> >> >>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Message Handler chain in ALSB2.6

    We need to move WLI webservices to ALSB2.6. Webservices used message handler chain which did lots of custom work.
    ALSB seems to have java callout but making methods in java call out sysnchronized means performance hit.
    Is there anything equivalent to handler chain in ALSB which can be applied to ALL the deployed proxy services?
    Thanks.

    ALSB is not a web service container, simply an intermediary. Therefore there is nothing equivalent to the JAX-RPC handler chain.
    Java callout looks like a reasonable alternative. What is your concern about performance? Why would you synchronize the java callout methods and not the message handler chain?
    As a best practice, I would suggest you create a local proxy containing the implementation you want to share across ALSB services. The invocation af a local proxy is optimized and as fast as simply replicating an action across every services.
    Gregory Haardt
    ALSB Prg. Manager
    [email protected]

  • Getting handler chain

    I'm trying to get the handler chain with jaxb2.1.
    ABCService abcService = new ABCService();
    Iterator<QName> iter = abcService.getPorts();
    while(iter.hasNext()) { // it has only one port
      QName portQName = iter.next();
      QName serviceName = abcService.getServiceName();
      String bindingId = "{http://abc.cas.de}ABCServiceHttpBinding"; // WSDL line: <wsdl:port binding="tns:ABCServiceHttpBinding" name="ABCServiceHttpPort">     
      PortInfo pi = new PortInfoImpl(bindingId, portQName, serviceName);
      HandlerResolver handlerResolver = abcService.getHandlerResolver();
      List<Handler> handlerList = handlerResolver.getHandlerChain(pi);The list is always empty, but a handler is registered with the custom.xml file at the wsimport task. The handler is also called.
    I assume my portname, servicename or bindingId is wrong. Only the bindingID is hard coded by me, the rest is retrieved by my proxy.
    Any idea what's wrong?
    How can i retrieve the bindingId?
    Cheers,
    Ingo

    Hi David,
    If you are using WLS 8.1, you can use
    weblogic.webservice.context.WebServiceContext
    to pass parameters between handler and end
    component.
    A context example here:
    http://manojc.com/?sample30
    WLS 7.0 does not support this. A workaround will
    be to use ThreadLocal. Details here:
    http://java.sun.com/j2se/1.4.1/docs/api/java/lang/ThreadLocal.html
    HTHs,
    -manoj
    http://manojc.com
    "David Selvaraj" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    I want to write a handler chain in which I want to send some parameters inthe Soap request and pass it to the actual class where the web service
    method exists.
    How can I pass the variable from a handler chain to the actual method.
    Please let me know.
    Thanks,
    David

  • Is it possible to throw an exception from a handler chain with JAXWS???

    I know I cannot throw directly an exception from the handler cause my handler extends SOAPHandler and the method handlerMessage cannot throw exceptions. The problem is that I would like to validate some authorization and if the client doesn't have the appropriate rights, I would like to throw an exception from the handler without calling the web service itself, so the client would receive a valid soap response from the server. Is it possible?? Is there another mechanism that I can use to do that??
    Thanks a lot
    Korg

    You can throw a ProtocolException or RuntimeException from handleMessage().
    If you throw ProtocolException, HandleFault() is called on previously invoked handlers.
    If you throw a RuntimeException, handleFault() or handleMessage() is not called on previously invoked handlers, and the Exception is converted to Fault message and dispatched.

  • Error handling -- automatic process chain

    Hello Experts,
    I need your suggestions.
    1) I want to set up the error handling for the ILTC(Intiail load from the trusted client). Do I need to create a process chain to handle errors manually? or will the Process type 'Error handling for ILTC' collects and creates the process chain for the each object type?
    2) Say some how the process chain for the error objects has started. How can the error objects be handled automatically ?
    Thanks,

    Dear Sweatha,
    1 - You have to create a process chain with a start step, error handling step and a step to edit data and then a post step
    2 - If error occurs during ILTC, the error handling chain will be started automatically. Data will be stored in the error handling step.
    To process the error really you have to go to the error handling monitor and press the continue button. Data will be sent to the edit step. Here you can correct manually the errors.
    Please find additional information in the SAP Help Portal: http://help.sap.com/saphelp_mdm300/helpdata/EN/88/454ba493cb43f1b74336772a7f3508/frameset.htm
    Kind regards,
    Markus

  • JAX-WS Handler doesn't work.

    Hi,
    I try to put my handler to handler chain (on client side) this way:
    // MyService class is generated from WSDL file by Apache-CXF wsdl2java tool.
    // Of course MyService extends javax.xml.ws.Service
    MyService myService = mew MyService()
    myService.setHandlerResolver(new HandlerResolver() {
    public List<Handler> getHandlerChain(PortInfo arg0) {
    System.out.println(arg0);
    List c = new ArrayList();
    // MyHandler class prints some text to System.out in handleXXX() methods, it implements javax.xml.ws.handler.Handler
    c.add(new MyHandler());
    return c;
    It is a snippet of StatelessBean - it is client of external services.
    When I next try to invoke some service - myService.getPort().run() - the handler is not "notified".
    Why it doesn't work???
    I tried another way:
    ((BindingProvider) myService.getPort()).getBinding().getHandlerChain().add(new MyHandler())
    It doesn't work too!
    And surprise:)
    I wrote that code:
    ((BindingProvider) myService.getPort()).getBinding().getHandlerChain().add(new MyHandler())
    System.out.println(
    ((BindingProvider) myService.getPort()).getBinding().getHandlerChain().size()
    What's the result of print?
    0 (zero)
    Could someone tell me why?
    Thx,
    Peter.

    I am having a similiar problem with Vista x32.  The preview handler is able to display the pdf, but the fields that were filled in prior to the email are not showing any values, but when you open the pdf with reader the values are there.  Below is a more detail account of what is happening.  I have contacted the third party dll as well, but thought someone here might have an idea too.
    I have a client that is using the a thrid party PDF dll (Syncfusion) to generate and email PDFs reports. There seems to be an issue with the PDFs that are generated and using the built-in PDF Preview Handler for Vista. The scenario is ...
    1. User receives an email into Outlook that contains a generated PDF (see image ''01-Opening-Email.jpg'')
    2. User clicks on the attachment in Outlook and the preview handler starts up (see image ''02-Loading-Previewer.jpg'')
    3. The PDF displayed in the preview handler does not have any of the fields filled out (see image ''03-Report-Loaded-In-Viewer.jpg'')
    4. User then right clicks on the PDF (in outlook) and selects to open the PDF with Adobe Acrobat Version 9.0 and the report is displayed with all the fields filled out (see image ''04-Report-Opened-With-Adobe.jpg'')
    All of these images are included in the attachment that I have uploaded with this incident. As well, in the RAR file is the PDF that was sent by the system using the PDF dll from Syncfusion. Please let me know if you need any more information from me.

  • The handler of the client doesn't work

    the client is a java application, and I have add the handler to de handlerchain of the client's registry, but it just doesn't work. What's the matter?
    This is my code:
    String url = "http://127.0.0.1:8080/HelloWorld/HelloWorld?wsdl";
    String namespace = "urn:HelloWorld/wsdl";
    String portName = "HelloWorldSEIPort";
    String serviceName = "HelloWorld";
    QName serviceQN = new QName(namespace, serviceName);
    ServiceFactory serviceFactory = ServiceFactory.newInstance();
    Service service = serviceFactory.createService(new URL(url), serviceQN);
    QName servicePort = new QName(namespace, portName);
    HandlerRegistry registry = service.getHandlerRegistry();
    List handlerChain = new ArrayList();
    HandlerInfo handlerInfo = new HandlerInfo(ClientHandler.class, null, null);
    handlerChain.add(handlerInfo);
    registry.setHandlerChain(servicePort, handlerChain);
    Stub stub = createProxy();
    stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, url);
    hello.HelloWorldSEI hello = (hello.HelloWorldSEI)stub;
    System.out.println(hello.sayHello(args[0]));
    I use the static stub method and generate the web service client with wscompile of the jwsdp. My web service's name is HelloWorld, but it generates several class such as HelloWorld, HelloWorld_Impl, HelloWorldSEIPort, HelloWorldSEI. What's the differences between them. And I want to know what's the type QName is, it's one of the parameters of the registry.setHandlerChain method. Why I have to use QName? And what my service's portName should be. Anyone who can help me? Thanks!
    I use the NetBeans 4.1 beta IDE.

    the client is a java application, and I have add the
    handler to de handlerchain of the client's registry,
    but it just doesn't work. What's the matter? For anyone following the forum who doesn't receive [email protected] email:
    The question was also sent to the users@jwsdp email list and I responded there. Basically, I think the port qnames don't match, so maybe the one passed to the handler registry isn't correct. Without all the code and the wsdl, it's hard to tell. (One note: in jaxrpc 2.0, getting/setting a handler chain for a port that doesn't exist will result in an exception, which may help cut down on problems like this).
    My suggestion was to add the handler to the config.xml file since it is a static stub. This is just a simpler way to do it.
    Cheers,
    Bobby

  • Client-side handler: static config?

    I would like to provide a client-side JAX-RPC handler that would
    be invoked without any modification to existing client code.
    The idea is that user's would only need to modify a config file
    (something like the web-services.xml file, but on the client-
    side) to use our handler.
    We are already doing this in axis (uses a client-side deployment
    descriptor: client_deploy.wsdd), but based on another thread
    ("Client Handler Chain - help ??"), it looks like there is
    currently no equivalent in WLS?
    Are there plans to add the ability to statically configure
    client-side handlers in WLS via some sort of client-side config
    file/descriptor, or is the programmatic method of modifying
    the HandlerRegistry in the client code the only way?
    Any help/ideas would be greatly appreciated!
    --Terry

    In 7.0, you can do this in a handler:
    import weblogic.webservice.binding.soap.HttpClientBinding;
    String url = http://my/new/address/;
    sslAdapter = null; //only needed for ssl
    Binding binding = new HttpClientBinding( url, sslAdapter );
    context.setProperty( WLMessageContext.BINDING_PROP,
    binding );
    HTHs
    -manoj
    http://manojc.com
    "William Cassidy" <[email protected]> wrote in message
    news:[email protected]...
    >
    Is there a similar way to set the endPointAddress.
    "manoj cheenath" <[email protected]> wrote:
    Ok, I will add this as a feature request.
    If you are ok with using WLS internal APIs (This APIs may change in
    the future), try this:
    weblogic.webservice.Operation operation
    =
    ((weblogic.webservice.WLMessageContext)messageContext).getOperation();
    >>
    weblogic.webservice.Port port = operation.getPort();
    String endPointAddress = port.getAddress();
    regards,
    -manoj
    "Terry Martin" <[email protected]> wrote in message
    news:[email protected]...
    Manoj, thanks for the response.
    We'd definitely like to see a client side dd at some point, but
    can work with the API's for now. Thanks much for adding this as
    a feature request.
    On another subject:
    I need to determine the target/endpoint URL from my client-side
    request handler. Again, this was something we were able to do in
    axis, but is currently not part of the JAX-RPC standard (JSR101).
    I could be missing something, but haven't seen any way of
    determining the target URL given only the SOAPMessageContext.
    The only way seems to be if it were passed as a "standard"
    property in the SOAPMessageContext (this is one way it is done
    in axis).
    I imagine this will someday be standardized in JAX-RPC (I can
    think of many uses for this feature, other than our own). In the
    meantime, could you also add this as a feature request for WLS?
    Thanks again,
    -Terry
    "manoj cheenath" <[email protected]> wrote:
    True. In WLS 7.0 there are no client side dd in which you can specify
    the handler chain. We did not comeup with ourown client side dd,
    hopeing that JSR109 will define the dd.
    It is quite easy to register the handlers through APIs. Let us know
    if
    that will not help you.
    I will add client side dd as a feature requst for the next release.
    regards,
    -manoj
    "Terry Martin" <[email protected]> wrote in message
    news:[email protected]...
    I would like to provide a client-side JAX-RPC handler that would
    be invoked without any modification to existing client code.
    The idea is that user's would only need to modify a config file
    (something like the web-services.xml file, but on the client-
    side) to use our handler.
    We are already doing this in axis (uses a client-side deployment
    descriptor: client_deploy.wsdd), but based on another thread
    ("Client Handler Chain - help ??"), it looks like there is
    currently no equivalent in WLS?
    Are there plans to add the ability to statically configure
    client-side handlers in WLS via some sort of client-side config
    file/descriptor, or is the programmatic method of modifying
    the HandlerRegistry in the client code the only way?
    Any help/ideas would be greatly appreciated!
    --Terry

  • Glassfish can't find JAX-WS handler classes

    Hi,
    Created a JAX-WS Stateless EJB3 Endpoint, configured JAX-WS handlers using a handler chain XML, deployed on Glassfish 3.1.2. Glassfish won't find any of the 3 handler classes. I've verified and reverified that the handler XML uses the correct package and class name. The first two of three handlers are part of the project while the third one is in a jar in the lib, so obviously they are all on the class path.
    Any help is greatly appreciated. Google searches showed that people had similar issue before but no one seemed to have found a solution (or if they did they did not post it back).
    Also posted [http://www.java.net/forum/topic/glassfish/metro-and-jaxb/glassfish-cant-find-jax-ws-handler-classes]
    [#|2012-04-03T21:59:11.769-0400|SEVERE|glassfish3.1.2|javax.enterprise.webservices.org.glassfish.webservices|_ThreadID=16;_ThreadName=Thread-3;|Unable to load handler class edu.certification.abhijitsarkar.ocewsd.jaxws.ejb.webservice.handler.ProgrammaticAuthenticationHandler
    java.lang.ClassNotFoundException: edu.certification.abhijitsarkar.ocewsd.jaxws.ejb.webservice.handler.ProgrammaticAuthenticationHandler
         at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1509)
         at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:247)
         at org.glassfish.webservices.WsUtil.processConfiguredHandlers(WsUtil.java:2141)
         at org.glassfish.webservices.WsUtil.configureJAXWSServiceHandlers(WsUtil.java:2193)
         at org.glassfish.webservices.EjbRuntimeEndpointInfo.prepareInvocation(EjbRuntimeEndpointInfo.java:266)
         at org.glassfish.webservices.EjbRuntimeEndpointInfo.initRuntimeInfo(EjbRuntimeEndpointInfo.java:343)
         at org.glassfish.webservices.WebServiceEjbEndpointRegistry.registerEndpoint(WebServiceEjbEndpointRegistry.java:129)
         at com.sun.ejb.containers.BaseContainer.initializeHome(BaseContainer.java:1181)
         at com.sun.ejb.containers.StatelessSessionContainer.initializeHome(StatelessSessionContainer.java:202)
         at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:167)
         at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:230)
         at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:299)
         at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:105)
         at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)
         at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:264)
         at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
         at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
         at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
         at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
         at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
         at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
         at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
         at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
         at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
         at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
         at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
         at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
         at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
         at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
         at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
         at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
         at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
         at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
         at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
         at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
         at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
         at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
         at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
         at java.lang.Thread.run(Thread.java:680)
    Endpoint:
    @Stateless
    @WebService(name="Time", serviceName="TimeService", portName="TimeServicePort")
    @HandlerChain(file = "/handler-chain.xml")
    @DeclareRoles({ "guest", "user" })
    public class TimeService {
    // code, probably irrelevant to the issue
    handler-chain.xml:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <javaee:handler-chains xmlns:javaee="http://java.sun.com/xml/ns/javaee"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <javaee:handler-chain>
              <javaee:handler>
                   <javaee:handler-class>edu.certification.abhijitsarkar.ocewsd.jaxws.ejb.webservice.handler.HttpBasicAuthenticationHandler
                   </javaee:handler-class>
              </javaee:handler>
              <javaee:handler>
                   <javaee:handler-class>edu.certification.abhijitsarkar.ocewsd.jaxws.ejb.webservice.handler.ProgrammaticAuthenticationHandler
                   </javaee:handler-class>
              </javaee:handler>
              <javaee:handler>
                   <javaee:handler-class>edu.certification.abhijitsarkar.ocewsd.jaxws.utility.handler.SOAPRequestHandler
                   </javaee:handler-class>
              </javaee:handler>
         </javaee:handler-chain>
    </javaee:handler-chains>

    Ok, I found the answer... it is actually a classic bug. The code that is loading the handler is located in WsUtil. Here is a link to version 3.1.1 of that code, although I am running 3.1.2.
    http://grepcode.com/file/repo1.maven.org/maven2/org.glassfish.webservices/jsr109-impl/3.1.1/org/glassfish/webservices/WsUtil.java/
    The method and line that blows up is org.glassfish.webservices.WsUtil.processConfiguredHandlers(WsUtil.java:2141). On that line (in version 3.1.2 - remember the link above is 3.1.1), there is a call to "Class.forName". It turns out that it is passing the exact UNTRIMMED name that is found in the generated JAX-WS handler-chain XML file (it was generated from wsimport in my case).
    In my JAXWS customization file, I had placed the handler name "prettily" on its own line, with a carriage return like so:
    (leading whitespace here - but these forums don't show whitespace)<javaee:handler-class>myHandler
    (leading whitespace here - but these forums don't show whitespace)</javaee:handler-class>
    That extra whitespace is NOT BEING TRIMMED in the code responsible for parsing the file. That is the problem, plain and simple. I fixed that:
    <javaee:handler-class>myHandler</javaee:handler-class>
    ... and the problem went away.
    To confirm this, I looked in the logs of the Glassfish server at all the times it complained it could not load class "myHandler", and found it was actually complaining about "myHandler " (i.e. with many spaces).
    Hope this helps someone.
    Edited by: Bland on Jun 14, 2012 2:41 PM
    Edited by: Bland on Jun 14, 2012 2:43 PM
    Edited by: Bland on Jun 14, 2012 2:44 PM

  • Contradictory soap handler guidelines

    why does bea say this: "...Message handlers should <b>not</b> be used to implement security or encryption..." (Specifying SOAP Handlers for a Web Service).
    but then turns around and contradicts the above with this:
    "...A simple example of using handlers is to encrypt and decrypt secure data in the body of a SOAP message..." (Using SOAP Message Handlers to Intercept the SOAP Message).
    and this: "...you might design an Encryption handler whose handleRequest() method decrypts secure data in the SOAP request and handleResponse() method encrypts the SOAP response..." (Designing the SOAP Message Handlers and Handler Chains).
    does anybody know what BEA's position is on this issue?
    many thanks.

    If i understand your requirement correctly then you can do following to register SOAP handlers
    QName portName = new QName( "http://tutorial/sample4/",
    "ServicePort");
    HandlerRegistry registry = service.getHandlerRegistry();
    List handlerList = new ArrayList();
    handlerList.add( new HandlerInfo( ClientHandler.class, null, null ) );
    registry.setHandlerChain( portName, handlerList )
    http://e-docs.bea.com/wls/docs81/webserv/interceptors.html

Maybe you are looking for