Search in sources :

Example 1 with EndToEndpoint

use of org.apache.cxf.ws.eventing.client.EndToEndpoint in project cxf by apache.

the class SubscriptionEndNotificationTask method run.

@Override
public void run() {
    try {
        // needed SOAP handlers
        ReferenceParametersAddingHandler handler = new ReferenceParametersAddingHandler(target.getNotificationReferenceParams());
        JaxWsProxyFactoryBean service = new JaxWsProxyFactoryBean();
        service.getOutInterceptors().add(new LoggingOutInterceptor());
        service.setServiceClass(EndToEndpoint.class);
        service.setAddress(target.getEndToURL());
        service.getHandlers().add(handler);
        EndToEndpoint endpoint = (EndToEndpoint) service.create();
        SubscriptionEnd message = new SubscriptionEnd();
        message.setStatus(status.toString());
        if (reason != null) {
            LanguageSpecificStringType reasonElement = new LanguageSpecificStringType();
            reasonElement.setLang("en-US");
            reasonElement.setValue(reason);
            message.getReason().add(reasonElement);
        }
        endpoint.subscriptionEnd(message);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : SubscriptionEnd(org.apache.cxf.ws.eventing.SubscriptionEnd) LoggingOutInterceptor(org.apache.cxf.ext.logging.LoggingOutInterceptor) JaxWsProxyFactoryBean(org.apache.cxf.jaxws.JaxWsProxyFactoryBean) EndToEndpoint(org.apache.cxf.ws.eventing.client.EndToEndpoint) ReferenceParametersAddingHandler(org.apache.cxf.ws.eventing.shared.handlers.ReferenceParametersAddingHandler) LanguageSpecificStringType(org.apache.cxf.ws.eventing.LanguageSpecificStringType)

Aggregations

LoggingOutInterceptor (org.apache.cxf.ext.logging.LoggingOutInterceptor)1 JaxWsProxyFactoryBean (org.apache.cxf.jaxws.JaxWsProxyFactoryBean)1 LanguageSpecificStringType (org.apache.cxf.ws.eventing.LanguageSpecificStringType)1 SubscriptionEnd (org.apache.cxf.ws.eventing.SubscriptionEnd)1 EndToEndpoint (org.apache.cxf.ws.eventing.client.EndToEndpoint)1 ReferenceParametersAddingHandler (org.apache.cxf.ws.eventing.shared.handlers.ReferenceParametersAddingHandler)1