9 Replies Latest reply on Oct 30, 2006 5:08 AM by omatzura

    endpoint handler

    dave2

      Hi,

      I'm trying to add a handler for all web service endpoints, with JBossWS.
      I've altered the /deploy/jbossws.sar/META-INF/standard-jbossws-endpoint-config.xml file, and the handler seems to be added for the endpoint:

      1:25:38,343 DEBUG [ServiceEndpoint] Adding server side handler to service '{htt
      ://whatever.com/bankwizard}BankWizardServiceEndpointPort': [class=com.whatever.util.JAXRPCClientExceptionHandler,headers=[],config={}]
      1:25:38,343 DEBUG [ServiceEndpoint] Init handler chain with [2] handlers
      1:25:38,343 DEBUG [HandlerChainBaseImpl] Create a handler chain for roles: []
      1:25:38,343 DEBUG [HandlerChainBaseImpl] init: [config=null]
      1:25:38,343 DEBUG [HandlerWrapper] init: com.whatever.ejb.JAXR
      CServerExceptionHandler@10848b9
      1:25:38,343 DEBUG [HandlerWrapper] init: com.whatever.util.JAXRPCC
      ientExceptionHandler@dea6bc


      However, the handler methods are never invoked at runtime.

      The handlers I have either extend GenericHandler or implement the Handler interface. The config I've used in standard-jbossws-endpoint-config.xml is below.

      <pre-handler-chain>
      <handler-chain-name>PreHandlerChain</handler-chain-name>

      <j2ee:handler-name>WSExceptionHandlerOutbound</j2ee:handler-name>
      <j2ee:handler-class>com.whatever.ejb.JAXRPCServerExceptionHandler</j2ee:handler-class>


      <j2ee:handler-name>WSExceptionHandlerOutbound</j2ee:handler-name>
      <j2ee:handler-class>com.whatever.util.JAXRPCClientExceptionHandler</j2ee:handler-class>

      </pre-handler-chain>



      The strangest thing is that if I put the same handlers into the standard-jbossws-client-config.xml, their methods are invoked with no problem at all.

      Can anyone assist?

        • 1. Re: endpoint handler
          anders.hedstrom
          • 2. Re: endpoint handler
            dave2

            I tried your suggestion. I now have 3 handlers in my chain. That is, two from the standard-jbossws-endpoint-config.xml and one from my webservices.xml.

            However, none of them are getting their methods invoked at runtime.

            My webservices.xml now reads:

            <port-component-name>BankWizardServiceEndpoint</port-component-name>
            <wsdl-port>bupa0:BankWizardServiceEndpointPort</wsdl-port>
            <service-endpoint-interface>com.whatever.ejb.BankWizardServiceEndpoint</service-endpoint-interface>
            <service-impl-bean>
            <ejb-link>BankWizardServiceEndpoint</ejb-link>
            </service-impl-bean>

            <handler-name>JAXRPCExceptionHandler</handler-name>
            <handler-class>com.whatever.ejb.JAXRPCServerExceptionHandler</handler-class>

            </port-component>

            • 3. Re: endpoint handler
              dave2

              I changed to JBoss-4.0.4-RC2 and the handler's handleRequest method is being invoked.
              Sadly handleFault() isn't, which is the one I wanted to be invoked.

              Posting a bug with JBossws....

              • 4. Re: endpoint handler
                kpve1

                I am experiencing a similar behavior with 4.04.GA. Has anyone else run into this? My handler's init method is called, but the handleRequest method is not.

                Thanks,
                Ken

                • 5. Re: endpoint handler
                  romeufigueira

                  I'm also experiencing a similar behaviour under JBoss AS 4.0.4

                  I've tried all kind of handlers, mainly Handler and Generic Handler.

                  None of them is being triggered, as I'm placing a log call under each one of them and checking the server log for info but none of them shows up.



                  • 6. Re: endpoint handler
                    jason.greene

                    Have you tried jbossws-1.0.3.GA (this installs onto 4.0.4)?


                    If you guys find a problem, and can produce a small test case that shows it, file a jira issue and we will take a look at it. (jira.jboss.com)

                    Thanks,
                    -Jason

                    • 7. Re: endpoint handler
                      romeufigueira

                      I've solved this problem by:

                      1º Generating the artifacts first (JbossIDE WS Pluggin (2.0 Beta2))
                      2º Manually editing webservices.xml to include the following lines:

                      ....
                       </service-impl-bean>
                       <handler>
                       <handler-name>ServiceAttachmentHandler</handler-name>
                       <handler-class>provisioning.ServiceAttachmentHandler</handler-class>
                       </handler>
                       </port-component>
                      .....


                      Handler is now properly interpreted as shown in the jboss log.

                      • 8. Re: endpoint handler
                        romeufigueira

                        To further clear my previous post, here's my complete description:

                        I've got 3 java files
                        1 - My WS interface
                        2 - My WS Implementacion
                        3 - My Handler class (in this case a class for handling attachments)

                        With the WS Plugin, I've generated my WS artifacts (WSDL file, web.xml, webservices.xml and jaxrpc-mapping.xml).

                        Problem is that webservices.xml didn't include any link to the handler, so I had to manually insert them (see above post).

                        Then it was just a case of packagin my files into a .WAR file (ant - f packaging-build.xml) and deploy it to my JBoss AS.

                        Hope this helps anyone with this sort of problem.

                        • 9. Re: endpoint handler

                          Hi,

                          We'll add handler support to the JBossIDE plugin before the final release... thanks for your feedback.

                          regards,

                          /Ole