Hi,
I have the following scenario. ProfileManager is a web service contained
within CampaignManager web service. I can access the profile manager
only through campaign manager.
@WebService
public class CampaignManagerImpl implements CampaignManager {
private String name;
private ProfileManager profileMgr;
@WebMethod
public String getName() {
return name;
}
@WebMethod
public ProfileManager getProfileManager() {
if (profileMgr != null)
profileMgr = new ProfileManagerImpl();
return profileMgr;
}
}
@WebService
public class ProfileManagerImpl implements ProfileManager {
private String username;
private String password;
private ProfileManager manager;
public ProfileManagerImpl(ProfileManager mgr) {
this.manager = mgr;
}
@WebMethod
public String getUsername() {
return mgr.getUsername();
}
@WebMethod
public String getPassword() {
return mgr.getPassword();
}
}
When I actually create the campaign service, I am thinking to do
something like this:.
JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
sf.setServiceClass(CampaignManager.class);
sf.getServiceFactory().setWrapped(true);
sf.setServiceName(new QName(NAMESPACE_URI, localPart, ""));
sf.setAddress("http://localhost:8080/campaignservice");
CampaignManager campaignService = new CampaignManagerImpl();
ProfileManager profileService = new
ProfileManagerImpl(campaignService.getProfileManager());//getting the
profile mgr from campaign mgr and creating the profile mgr service.
sf.getServiceFactory().setInvoker(new BeanInvoker(campaignService));
sf.create();
How do I invoke these services from the CXF client? Is it a valid use
case that can be implemented in CXF?
Cheers,
Arul