Search in sources :

Example 6 with SoapBodyInfo

use of org.apache.cxf.binding.soap.model.SoapBodyInfo in project cxf by apache.

the class SwAOutInterceptor method handleMessage.

public void handleMessage(SoapMessage message) throws Fault {
    Exchange ex = message.getExchange();
    BindingOperationInfo bop = ex.getBindingOperationInfo();
    if (bop == null) {
        return;
    }
    if (bop.isUnwrapped()) {
        bop = bop.getWrappedOperation();
    }
    boolean client = isRequestor(message);
    BindingMessageInfo bmi = client ? bop.getInput() : bop.getOutput();
    if (bmi == null) {
        return;
    }
    SoapBodyInfo sbi = bmi.getExtensor(SoapBodyInfo.class);
    if (sbi == null || sbi.getAttachments() == null || sbi.getAttachments().isEmpty()) {
        Service s = ex.getService();
        DataBinding db = s.getDataBinding();
        if (db instanceof JAXBDataBinding && hasSwaRef((JAXBDataBinding) db)) {
            setupAttachmentOutput(message);
        }
        return;
    }
    processAttachments(message, sbi);
}
Also used : Exchange(org.apache.cxf.message.Exchange) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) BindingMessageInfo(org.apache.cxf.service.model.BindingMessageInfo) SoapBodyInfo(org.apache.cxf.binding.soap.model.SoapBodyInfo) DataBinding(org.apache.cxf.databinding.DataBinding) JAXBDataBinding(org.apache.cxf.jaxb.JAXBDataBinding) Service(org.apache.cxf.service.Service) JAXBDataBinding(org.apache.cxf.jaxb.JAXBDataBinding)

Aggregations

SoapBodyInfo (org.apache.cxf.binding.soap.model.SoapBodyInfo)6 BindingMessageInfo (org.apache.cxf.service.model.BindingMessageInfo)6 BindingOperationInfo (org.apache.cxf.service.model.BindingOperationInfo)5 MessagePartInfo (org.apache.cxf.service.model.MessagePartInfo)5 QName (javax.xml.namespace.QName)4 Definition (javax.wsdl.Definition)3 Bus (org.apache.cxf.Bus)3 BindingFactoryManager (org.apache.cxf.binding.BindingFactoryManager)3 SoapBindingInfo (org.apache.cxf.binding.soap.model.SoapBindingInfo)3 SoapOperationInfo (org.apache.cxf.binding.soap.model.SoapOperationInfo)3 BindingInfo (org.apache.cxf.service.model.BindingInfo)3 ServiceInfo (org.apache.cxf.service.model.ServiceInfo)3 DestinationFactoryManager (org.apache.cxf.transport.DestinationFactoryManager)3 WSDLServiceBuilder (org.apache.cxf.wsdl11.WSDLServiceBuilder)3 Test (org.junit.Test)3 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 DataHandler (javax.activation.DataHandler)1 ExtensibilityElement (javax.wsdl.extensions.ExtensibilityElement)1