// JMS Component
JmsComponent component = new JmsComponent();
container.activateComponent(component, "JMSComponent2");
// Add a receiver component
ActivationSpec asEcho = new ActivationSpec("echo", new EchoComponent() {
public Document getServiceDescription(ServiceEndpoint endpoint) {
try {
Definition def = WSDLFactory.newInstance().newDefinition();
PortType type = def.createPortType();
type.setUndefined(false);
type.setQName(new QName("http://test", "MyConsumerInterface"));
Binding binding = def.createBinding();
binding.setUndefined(false);
binding.setPortType(type);
Service svc = def.createService();
svc.setQName(new QName("http://test", "MyConsumerService"));
Port port = def.createPort();
port.setBinding(binding);
port.setName("myConsumer");
svc.addPort(port);
def.setTargetNamespace("http://test");
def.addNamespace("tns", "http://test");
def.addPortType(type);
def.addBinding(binding);
def.addService(svc);
return WSDLFactory.newInstance().newWSDLWriter().getDocument(def);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
});
asEcho.setEndpoint("myConsumer");
asEcho.setService(new QName("http://test", "MyConsumerService"));
container.activateComponent(asEcho);
// Deploy SU
URL url = getClass().getClassLoader().getResource("xbean/xbean.xml");
File path = new File(new URI(url.toString()));