Search in sources :

Example 51 with JAXBDataBinding

use of org.apache.cxf.jaxb.JAXBDataBinding in project BIMserver by opensourceBIM.

the class SoapChannel method newToken.

@Override
public void newToken(String token) {
    if (useSoapHeaderSessions) {
        for (PublicInterface p : getServiceInterfaces().values()) {
            List<Header> headers = new ArrayList<Header>();
            try {
                Token tokenObject = new Token(token);
                Header sessionHeader = new Header(new QName("uri:org.bimserver.shared", "token"), tokenObject, new JAXBDataBinding(Token.class));
                headers.add(sessionHeader);
            } catch (JAXBException e) {
                LOGGER.error("", e);
            }
            ((BindingProvider) p).getRequestContext().put(Header.HEADER_LIST, headers);
        }
    }
}
Also used : PublicInterface(org.bimserver.shared.interfaces.PublicInterface) Header(org.apache.cxf.headers.Header) QName(javax.xml.namespace.QName) JAXBException(javax.xml.bind.JAXBException) ArrayList(java.util.ArrayList) Token(org.bimserver.shared.Token) JAXBDataBinding(org.apache.cxf.jaxb.JAXBDataBinding)

Aggregations

JAXBDataBinding (org.apache.cxf.jaxb.JAXBDataBinding)51 QName (javax.xml.namespace.QName)24 Test (org.junit.Test)18 JAXBException (javax.xml.bind.JAXBException)15 Header (org.apache.cxf.headers.Header)15 XMLStreamReader (javax.xml.stream.XMLStreamReader)12 ArrayList (java.util.ArrayList)10 DataBinding (org.apache.cxf.databinding.DataBinding)9 ByteArrayInputStream (java.io.ByteArrayInputStream)7 XMLStreamWriter (javax.xml.stream.XMLStreamWriter)7 DepthXMLStreamReader (org.apache.cxf.staxutils.DepthXMLStreamReader)7 Service (org.apache.cxf.service.Service)6 ServiceInfo (org.apache.cxf.service.model.ServiceInfo)6 JAXBContext (javax.xml.bind.JAXBContext)5 Bus (org.apache.cxf.Bus)5 URL (java.net.URL)4 OutofBandHeader (org.apache.cxf.outofband.header.OutofBandHeader)4 HashMap (java.util.HashMap)3 List (java.util.List)3 MessageContext (javax.xml.ws.handler.MessageContext)3