ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | celtix List | May 2006 Index

<--  Date Index  --> <--  Thread Index  -->

RE: [celtix] How to add handlers


Title: How to add handlers
Thanks for that.
 
The only thing that doesn't seem to work in the client side handler. The server side is working fine and generating the log entries but the client side is not intercepting the small numbers.
 
I assume that client side in the this example refers to the request leaving the router. So I am expecting to see the server side handler on the front of the router logging the request and the client side handler on the back of the router intercepting the small numbers.
 
I'm not sure what to do to find out why it isn't working.
 
THe other question I have is abot the init-param section of the client handler - is this required ? The names don't tie up with anything in the WSDL file so I can't see what it is doing. The handler uses getArg0() & getArg1() to get the parameters that it wants from the request, so I can't see what this section is for - I could try removing it but I haven't yet.

<!--Client Side Handler-->

<bean id="celtix.{http://www.objectweb.org/handlers}AddNumbersService/AddNumbersPort" class="org.objectweb.celtix.bus.jaxws.port_config.spring.PortConfigBean">

<property name="handlerChain">

<value>

<jaxws-types:handler-chain>

<jaxws-types:handler>

<jaxws-types:handler-name>Small Number Handler</jaxws-types:handler-name>

<jaxws-types:handler-class>demo.handlers.common.SmallNumberHandler</jaxws-types:handler-class>

<jaxws-types:init-param>

<jaxws-types:param-name>arg1</jaxws-types:param-name>

<jaxws-types:param-value>value1</jaxws-types:param-value>

</jaxws-types:init-param>

<jaxws-types:init-param>

<jaxws-types:param-name>arg2</jaxws-types:param-name>

<jaxws-types:param-value>value2</jaxws-types:param-value>

</jaxws-types:init-param>

</jaxws-types:handler>

</jaxws-types:handler-chain>

</value>

</property>

</bean>

 

Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw  
Technical Design Authority - Information Solutions Consultancy  
Intelligent Transport Systems

Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407 
Fax: +44 (0) 1372 740055
Mob: 07740 817586 
E-mail: richard.shaw@xxxxxxxxxxxxxxxx

www.atkinsglobal.com/its

 


From: Paibir, Ajay [mailto:ajay.paibir@xxxxxxxx]
Sent: 26 May 2006 18:32
To: celtix@xxxxxxxxxxxxx
Subject: RE: [celtix] How to add handlers

Hi Richard,

The following changes need to be done to the sample.

a)     In Client.java, the client was invoking on the AddNumbersService, this is the far-end server.

Instead it should invoke upon the service in the router i.e. RouterAddNumberService.  The portName variable also needs to be updated.

The updated Client.java is attached.

b)     In the addNumbers.wsdl the routes are to be defined as below.

    <router:route name="RouterAddNumbers">

        <router:source port="RouterAddNumbersPort" service="tns:RouterAddNumbersService"/>

        <router:destination port="AddNumbersPort" service="tns:AddNumbersService"/>

    </router:route>

As per the schema in resources/schema/wsdl/routing.xsd.

The ?port?  attribute takes the port defined in the wsdl service and is a xsd:string and not a xsd:QName.

Hence the router was not starting up the RouterAddNumbersService as it could not find the port defined in the particular service.

The updated addNumbers.wsdl is attached.

      c) Since the initial problem you were looking for adding handlers into the router.

I have added another target ?router1? to build.xml which starts up the router and demonstrates handlers getting invoked when the client does the invocations.

 Attached is the corrp. configuration to insert the handlers celtix-router1.xml, and build.xml

Hope this helps.

Ajay


From: Shaw, Richard A [mailto:richard.shaw@xxxxxxxxxxxxxxxx]
Sent: 26 May 2006 14:30
To: celtix@xxxxxxxxxxxxx
Subject: RE: [celtix] How to add handlers

Thanks for that - I understand now. However, I can't get it to work.

I've added a zip of my samples\handlers project. I've done the following to it -

1 - added 2 new rules to the build router & client.router

         router - starts the router

        client.router - starts the client using the routers port number

2 - edited the wsdl file to include another service on port 9999 and a routing definition

3 - changed the name of the bus from celtix-st to celtix (not sure why I did this)

4 - to run it I do the following -

        ant server

        ant router

        ant client.router

and it doesn't work the client says the connection is refused.

I've checked my config for the client. If I change the address in the config back to 9000, it then works.

I started out by trying it with my real service but the router says unsupported route, so I tried this example instead, which seems to be closer to working.

Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw  
Technical Design Authority - Information Solutions Consultancy  
Intelligent Transport Systems

Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407 
Fax: +44 (0) 1372 740055
Mob: 07740 817586 
E-mail: richard.shaw@xxxxxxxxxxxxxxxx

www.atkinsglobal.com/its


From: Sakala, Adinarayana [mailto:ASAKALA@xxxxxxxx]
Sent: 25 May 2006 20:23
To: celtix@xxxxxxxxxxxxx
Subject: RE: [celtix] How to add handlers

Hi Richard,

You need to do following things inorder to build a BPMS to Legacy Relay service using Celtix Router.

1. First you need to define a Route in your WSDL. I havent seen your WSDL but since it is a plain vanilla SOAP/HTTP service

    The following example should work for you.

    All i did was creating a RelayService which will be used by celtix router to receive messages from BPMS to relay them to legacy backend application.

    Inorder for the Router to kickoff, I defined a router:router tag with Source and Destination for your scenario.

    <!-- This Service is used for BPMS Process to talk to Relay Service -->

    <service name= "RelayService">
        <port name="RelayPort" binding="tns:MySOAPBinding">
            <soap:address location="
http://localhost:9001/RelayService"/>
        </port>
    </service>

    <!-- This Service is used for Relay Service to talk to Legacy Service -->
    <service name="LegacyService">
        <port name="LegacyPort" binding="tns:MySOAPBinding">
            <soap:address location="
http://localhost:9002/LegacyService"/>
        </port>
    </service>
    <!--Route Used for BPMS to Legacy Relay  -->
    <router:route name="BPMSToLegacyRelay">
        <router:source port="RelayPort" service="tns:RelayService"/>
        <router:destination port="LegacyPort" service="tns:LegacyService"/>
    </router:route>

2. In the routing configuration file (samples/routing/soap_jms_http/celtix-router.xml) you need to update it to point to the above wsdl that contains routing information.

    This is just a spring configuration file that defines router specific information. Since you mentioned you wanted to add some handlers, you can just use this same configuation file to define handlers for you RelayService. Essentially what i am trying to clarify is you can just have one config file that defines both routing configuration and also handler configuration. See our Configuration documentation for more info [1]

3. Start the Relay Server (Router) using the config file. See the ant target that starts router in samples/routing/soap_jms_http/build.xml for example.

       <target name="router" description="run celtix router">
        <celtixrun classname="org.objectweb.celtix.routing.RouterManager" jvmarg1="-Dceltix.config.file=file:///${basedir}/celtix-router.xml" param1="-BUSid" param2="celtix-st"/>
    </target>

   If you are familiar with Ant, all this is doing is setting up the classpath and starting the router process by passing in configuration file.

   Probably Celtix should provide a Script for this :)

4. Make sure you BPMS client process is talking to RelayService by ensuring it uses the same soap client address that you used for Relay Service.

FYI, The above example and steps shows just one route. But technically you can have multiple routes in the same relay server. I never tried this but something that should work :).

Hope this helps,

Thanks,

Adi Sakala

-----Original Message-----
From: Shaw, Richard A [mailto:richard.shaw@xxxxxxxxxxxxxxxx]
Sent: Thursday, May 25, 2006 11:05 AM
To: celtix@xxxxxxxxxxxxx
Subject: RE: [celtix] How to add handlers

Thanks, but my real question is -

My BPMS process talks to my legacy software using SOAP over HTTP without me having installed any Celtix software at all. So if I add celtix-router config to the WSDL file how does it start using Celtix ?

Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw  
Technical Design Authority - Information Solutions Consultancy  
Intelligent Transport Systems

Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407 
Fax: +44 (0) 1372 740055
Mob: 07740 817586 
E-mail: richard.shaw@xxxxxxxxxxxxxxxx

www.atkinsglobal.com/its


From: Paibir, Ajay [mailto:ajay.paibir@xxxxxxxx]
Sent: 25 May 2006 13:04
To: celtix@xxxxxxxxxxxxx
Subject: RE: [celtix] How to add handlers

Hi Richard,

Yes this is possible using the Celtix-Router and defining routes for each of the BPMS Services to Legacy Services in the wsdl that need a relay server hop.

Since the BPMS and Legacy Server talk SOAP, the router will not do marshalling/unmarshalling, just pass the message on to the legacy end and back.

Regarding adding handlers, handler-chain can be defined for a wsdl service/endpoint using a bean definition.

A good start may be is to have a look at the samples in the celtix kit

Handlers ? to add handlers for a particular Service/Port defined in the wsdl.

Routing/soap_jms_http ? for the usage of celtix-router and defining the routes wsdl and configuration.

Ajay


From: Shaw, Richard A [mailto:richard.shaw@xxxxxxxxxxxxxxxx]
Sent: 25 May 2006 11:43
To: celtix@xxxxxxxxxxxxx
Subject: [celtix] How to add handlers

I want to add a handler to the bus to provide logging among other things, but I don't think I have a bus to connect to.

My client is an Intalio BPMS process and my server is a legacy system hosted in IIS. I'm using SOAP over HTTP to make the requests, and this is all described in a WSDL file.

So because my client and server are not written using Celtix I am assuming I don't have a Celtix bus to add handlers to.

What I was thinking was that I need a relay server which sits between these processes and is written using Celtix. The BPMS then talks to the relay server which passes the request to the legacy server. I can then add handlers to the bus. However, I don't want to create a relay process for every legacy system I have, I want to create a generic one that just passes things on without needing to interpret them.

Does what I am saying make sense ?

Is it possible to create a generic relay server ?

Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw  
Technical Design Authority - Information Solutions Consultancy  
Intelligent Transport Systems

Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407 
Fax: +44 (0) 1372 740055
Mob: 07740 817586 
E-mail: richard.shaw@xxxxxxxxxxxxxxxx

www.atkinsglobal.com/its

This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.

This message has been scanned for viruses by MailControl



<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.