You don't need to modify the WSDLs of your member resources (the resources that will be listed in the service group), you just have to provide the WS-SG WSDLs for the WS-SG resource types mentioned.
Also, since you want the SG and the member resources to be completely separate, you'll need to include the wsrf-sg:Add operation in your service group portType - this means you'll need to modify the WS-ServiceGroup-1_2.wsdl file by adding a <wsdl:operation/> for wsrf-sg:Add to its <wsdl:portType/>. The definitions for the Add operation are already in the WSDL, you just have to reference them in the portType. Once this is done, just add the ServiceGroupRegistration capability to muse.xml: http://ws.apache.org/muse/docs/2.2.0/manual/capabilities/wsrf-wssg-sgr.html This capability just exposes the Add() method as a web services operation. Finally, you will need some code to do the service group additions, since you do not have the service group and member resources in the same application. To do this, I recommend the following: 1. Make a class that implements org.apache.muse.core.ResourceManagerListener. 2. Implement the resourceAdded() method with code like this: public void resourceAdded(EndpointReference epr, Resource resource) { URI sgURI = URI.create("http://1.2.3.4/service-group"); EndpointReference sgEPR = new EndpointReference(sgURI); ServiceGroupClient sg = new ServiceGroupClient(sgEPR); sg.add(epr, null); } 3. In the initialize() method of one of your custom capabilities (any one, doesn't matter), enable your ResourceManagerListener: public void initialize() throws SoapFault { super.initialize(); ... ResourceManagerListener rml = new YourListenerClass(); getResource().getResourceManager().addListener(rml); } This will set up your listener code so that every resource created in your application is added to your service group using a remote call to Add(). If you want to filter the resources so that only some are added, you can put that logic in resourceAdded(). Dan "Marco Parmiani" <[EMAIL PROTECTED]> wrote on 05/09/2007 07:41:03 AM: > Hi, I read the oasis specification for WS-ServiceGroup and I'd like to try > the Muse implementation of the standard. > My situation is: > -I have several WS-Resources, each managing one particular device > -I'd like to have a WS-Resource (the ServiceGroup), that groups my existing > services, and I'd like that a remote client can call the Add/Remove > operation on this ServiceGroup as well as query the group members. > If I understood correctly the specification, a ServiceGroup can group local > resources as well as remote WS-Resources (or even plain web services). In my > example the ServiceGroup WS-Resource does not create any resource 'locally': > I'd like it to simply group references to other WS-Resources. > I read at > http://ws.apache.org/muse/docs/2.2.0/manual/how-to/wsrf-add-service-groups.html > some istructions but I'm missing something: > -do I need to update my service WSDL to include the ServiceGroup capability? > Or do I just need to update the muse.xml file? > -If I have to modify the WSDL, what do I need to add in my WSDL? (for > example, given the WSRF example wsdl included in Muse2.2, how can I > customize it to include the ServiceGroup capability) > -How do I create my ServiceGroup resource? Do I need to write some custom > java code in my Initialize() method? > > Could someone provide some example code? > Thanks in advance, > Marco > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
