You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Stefano Gaspari (JIRA)" <ji...@apache.org> on 2010/11/05 16:52:45 UTC
[jira] Issue Comment Edited: (DOSGI-82) populate custom
servicename, portname and targetnamespace for jax-ws
[ https://issues.apache.org/jira/browse/DOSGI-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12928634#action_12928634 ]
Stefano Gaspari edited comment on DOSGI-82 at 11/5/10 11:51 AM:
----------------------------------------------------------------
Seems that also "org.apache.cxf.dosgi.dsw.handlers.HttpServiceConfigurationTypeHandler" has a similar problem.
I'm using single bundle distribution to integrate it with my OSGI HTTP service (Jetty) and testing it with a simple example with configurations like Greeter demo example (http://cxf.apache.org/distributed-osgi-greeter-demo-walkthrough.html) i checked they are ignored.
My activator:
public class DOSGIWebserviceRegisterActivator implements BundleActivator {
private static final String CXF_WS_HTTPSERVICE_CONTEXT = "org.apache.cxf.ws.httpservice.context";
private static final String CXF_WS_DATABINDING = "org.apache.cxf.ws.databinding";
private static final String CXF_WS_FRONTEND = "org.apache.cxf.ws.frontend";
private static final String CXF_WS_ADDRESS = "org.apache.cxf.ws.address";
private static final String SERVICE_EXPORTED_CONFIGS = "service.exported.configs";
private static final String SERVICE_EXPORTED_INTERFACES = "service.exported.interfaces";
private static BundleContext context;
private ServiceRegistration registrator;
static BundleContext getContext() {
return context;
}
public void start(BundleContext bundleContext) throws Exception {
DOSGIWebserviceRegisterActivator.context = bundleContext;
String applicationUrl = "http://localhost:8080/web";
String servletMapping = "/services";
String serviceName = "/ServiceTest";
Dictionary<String, String> props = new Hashtable<String, String>();
props.put(SERVICE_EXPORTED_INTERFACES, "*");
props.put(SERVICE_EXPORTED_CONFIGS, "org.apache.cxf.ws");
props.put(CXF_WS_ADDRESS, applicationUrl + servletMapping + serviceName);
props.put(CXF_WS_FRONTEND, "jaxws");
props.put(CXF_WS_DATABINDING, "jaxb");
props.put(CXF_WS_HTTPSERVICE_CONTEXT, servletMapping);
registrator = context.registerService(ServiceTest.class.getName(), new ServiceImpl(), props);
}
...
}
Properties like "org.apache.cxf.ws.address" are simply ignored, in fact in console log i found:
*** EndpointDescription: ****
endpoint.framework.uuid => 45420387-0310-468e-91fb-fe7475514b63
endpoint.id => http://10.0.1.170:8080/services
endpoint.package.version.org.cxf.test => 0.0.0
endpoint.service.id => 47
objectClass => [Ljava.lang.String;@1609af9
--> org.apache.cxf.ws.address => http://10.0.1.170:8080/services --> INSTEAD OF "http://localhost:8080/web/services/ServiceTest"
org.apache.cxf.ws.databinding => jaxb
org.apache.cxf.ws.frontend => jaxws
org.apache.cxf.ws.httpservice.context => /services
service.imported => true
service.imported.configs => [Ljava.lang.String;@15e8a8f
service.intents => [Ljava.lang.String;@14a3da8
*** Exception: null ****
*** isClosed : false ****
]
Could it be the same problem??
was (Author: stefgasp):
Seems that also "org.apache.cxf.dosgi.dsw.handlers.HttpServiceConfigurationTypeHandler" has a similar problem.
I'm using single bundle distribution to integrate it with my OSGI HTTP service (Jetty) and testing it with a simple example with configurations like Greeter demo example (http://cxf.apache.org/distributed-osgi-greeter-demo-walkthrough.html) i checked they are ignored.
My activator:
public class DOSGIWebserviceRegisterActivator implements BundleActivator {
private static final String CXF_WS_HTTPSERVICE_CONTEXT = "org.apache.cxf.ws.httpservice.context";
private static final String CXF_WS_DATABINDING = "org.apache.cxf.ws.databinding";
private static final String CXF_WS_FRONTEND = "org.apache.cxf.ws.frontend";
private static final String CXF_WS_ADDRESS = "org.apache.cxf.ws.address";
private static final String SERVICE_EXPORTED_CONFIGS = "service.exported.configs";
private static final String SERVICE_EXPORTED_INTERFACES = "service.exported.interfaces";
private static BundleContext context;
private ServiceRegistration registrator;
static BundleContext getContext() {
return context;
}
public void start(BundleContext bundleContext) throws Exception {
DOSGIWebserviceRegisterActivator.context = bundleContext;
String applicationUrl = "http://localhost:8080/web";
String servletMapping = "/services";
String serviceName = "/ServiceTest";
Dictionary<String, String> props = new Hashtable<String, String>();
props.put(SERVICE_EXPORTED_INTERFACES, "*");
props.put(SERVICE_EXPORTED_CONFIGS, "org.apache.cxf.ws");
props.put(CXF_WS_ADDRESS, applicationUrl + servletMapping + serviceName);
props.put(CXF_WS_FRONTEND, "jaxws");
props.put(CXF_WS_DATABINDING, "jaxb");
props.put(CXF_WS_HTTPSERVICE_CONTEXT, servletMapping);
registrator = context.registerService(ServiceTest.class.getName(), new ServiceImpl(), props);
}
...
}
Properties like "org.apache.cxf.ws.address" are simply ignored, in fact in console log i found:
*** EndpointDescription: ****
endpoint.framework.uuid => 45420387-0310-468e-91fb-fe7475514b63
endpoint.id => http://10.0.1.170:8080/services
endpoint.package.version.org.cxf.test => 0.0.0
endpoint.service.id => 47
objectClass => [Ljava.lang.String;@1609af9
--> org.apache.cxf.ws.address => http://10.0.1.170:8080/services --> INSTEAD OF "http://localhost:8080/web/services/ServiceTest"
org.apache.cxf.ws.databinding => jaxb
org.apache.cxf.ws.frontend => jaxws
org.apache.cxf.ws.httpservice.context => /services
service.imported => true
service.imported.configs => [Ljava.lang.String;@15e8a8f
service.intents => [Ljava.lang.String;@14a3da8
*** Exception: null ****
*** isClosed : false ****
]
Could it be the same problem??
> populate custom servicename, portname and targetnamespace for jax-ws
> --------------------------------------------------------------------
>
> Key: DOSGI-82
> URL: https://issues.apache.org/jira/browse/DOSGI-82
> Project: CXF Distributed OSGi
> Issue Type: Improvement
> Components: DSW
> Reporter: Ronald Müller
> Attachments: Constants.java.diff, PojoConfigurationTypeHandler.java.diff
>
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> At the moment it seems not to be possible to configure servicename and portname for jax-ws in DOSGi, as the appropriate annotations are silently ignored. So i suggest to implement a handy solution to this problem by making these things configurable by service-properties, introducing 4 new property-keys "org.apache.cxf.ws.targetnamespace" , "org.apache.cxf.ws.servicename" , "org.apache.cxf.ws.portname" and "org.apache.cxf.ws.wsdl_location" . This solution affects 2 classes from the DSW implementation : "org.apache.cxf.dosgi.dsw.Constants" and
> "org.apache.cxf.dosgi.dsw.handlers". The patches to current trunk a given.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.