Package org.w3.www._2005._05.xmlmime

Examples of org.w3.www._2005._05.xmlmime.HexBinary


                                                                                AddressingProperties addressingProperties)
    {
        // TODO - we need the 2.1 verison of Service so we can specify that we want to use the WS Addressing feature
        TerminationCoordinatorService service = getTerminationCoordinatorService();
        // TerminationCoordinatorPortType port = service.getPort(endpointReference, TerminationCoordinatorPortType.class, new AddressingFeature(true, true));
        TerminationCoordinatorPortType port = service.getPort(endpointReference, TerminationCoordinatorPortType.class);
        BindingProvider bindingProvider = (BindingProvider)port;
        /*
         * we have to add the JaxWS WSAddressingClientHandler because we cannoy specify the WSAddressing feature
         */
        List<Handler> customHandlerChain = new ArrayList<Handler>();
View Full Code Here


     * @return
     */
    private static synchronized TerminationCoordinatorService getTerminationCoordinatorService()
    {
        if (terminationCoordinatorService.get() == null) {
            terminationCoordinatorService.set(new TerminationCoordinatorService());
        }
        return terminationCoordinatorService.get();
    }
View Full Code Here

        return dataFormat;
    }

    @Override
    public Object doMarshal(Exchange exchange, Object inputObject, OutputStream stream, String soapAction) throws IOException {
        Body body = new Body();
        Header header = new Header();

        Throwable exception = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Throwable.class);
        if (exception == null) {
            exception = exchange.getIn().getHeader(Exchange.EXCEPTION_CAUGHT, Throwable.class);
        }

        final List<JAXBElement<?>> bodyContent;
        List<JAXBElement<?>> headerContent = new ArrayList<JAXBElement<?>>();
        if (exception != null) {
            bodyContent = new ArrayList<JAXBElement<?>>();
            bodyContent.add(createFaultFromException(exception));
        } else {
            bodyContent = getDataFormat().createContentFromObject(inputObject, soapAction, headerContent);
        }

        for (JAXBElement<?> elem : bodyContent) {
            body.getAny().add(elem);
        }
        for (JAXBElement<?> elem : headerContent) {
            header.getAny().add(elem);
        }
        Envelope envelope = new Envelope();
View Full Code Here

        return dataFormat;
    }

    @Override
    public Object doMarshal(Exchange exchange, Object inputObject, OutputStream stream, String soapAction) throws IOException {
        Body body = objectFactory.createBody();
        Header header = objectFactory.createHeader();

        Throwable exception = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Throwable.class);
        if (exception == null) {
            exception = exchange.getIn().getHeader(Exchange.EXCEPTION_CAUGHT, Throwable.class);
        }

        final List<JAXBElement<?>> bodyContent;
        List<JAXBElement<?>> headerContent = new ArrayList<JAXBElement<?>>();
        if (exception != null) {
            bodyContent = new ArrayList<JAXBElement<?>>();
            bodyContent.add(createFaultFromException(exception));
        } else {
            bodyContent = getDataFormat().createContentFromObject(inputObject, soapAction, headerContent);
        }

        for (JAXBElement<?> elem : bodyContent) {
            body.getAny().add(elem);
        }
        for (JAXBElement<?> elem : headerContent) {
            header.getAny().add(elem);
        }
        Envelope envelope = new Envelope();
View Full Code Here

        Reasontext text = new Reasontext();
        text.setValue(exception.getMessage());
        text.setLang("en");
        fault.setReason(new Faultreason().withText(text));

        Detail detailEl = new ObjectFactory().createDetail();
        @SuppressWarnings("rawtypes")
        JAXBElement<?> faultDetailContent = new JAXBElement(name, faultObject.getClass(), faultObject);
        detailEl.getAny().add(faultDetailContent);
        fault.setDetail(detailEl);
        return new ObjectFactory().createFault(fault);
    }
View Full Code Here

        Reasontext text = new Reasontext();
        text.setValue(exception.getMessage());
        text.setLang("en");
        fault.setReason(new Faultreason().withText(text));

        Detail detailEl = new ObjectFactory().createDetail();
        @SuppressWarnings("rawtypes")
        JAXBElement<?> faultDetailContent = new JAXBElement(name, faultObject.getClass(), faultObject);
        detailEl.getAny().add(faultDetailContent);
        fault.setDetail(detailEl);
        return new ObjectFactory().createFault(fault);
    }
View Full Code Here

            body.getAny().add(elem);
        }
        for (JAXBElement<?> elem : headerContent) {
            header.getAny().add(elem);
        }
        Envelope envelope = new Envelope();
        if (headerContent.size() > 0) {
            envelope.setHeader(header);
        }
        envelope.setBody(body);
        JAXBElement<Envelope> envelopeEl = new ObjectFactory().createEnvelope(envelope);
        return envelopeEl;
    }
View Full Code Here

    @Override
    public Object doUnmarshal(Exchange exchange, InputStream stream, Object rootObject) throws IOException {
        if (rootObject.getClass() != Envelope.class) {
            throw new RuntimeCamelException("Expected Soap Envelope but got " + rootObject.getClass());
        }
        Envelope envelope = (Envelope) rootObject;

        Header header = envelope.getHeader();
        if (header != null) {
            List<Object> returnHeaders;
            List<Object> anyHeaderElements = envelope.getHeader().getAny();
            if (null != anyHeaderElements && !(getDataFormat().isIgnoreUnmarshalledHeaders())) {
                if (getDataFormat().isIgnoreJAXBElement()) {
                    returnHeaders = new ArrayList<Object>();
                    for (Object headerEl : anyHeaderElements) {
                        returnHeaders.add(JAXBIntrospector.getValue(headerEl));
                    }
                } else {
                    returnHeaders = anyHeaderElements;
                }
                exchange.getOut().setHeader(SoapJaxbDataFormat.SOAP_UNMARSHALLED_HEADER_LIST, returnHeaders);
            }
        }

        List<Object> anyElement = envelope.getBody().getAny();
        if (anyElement.size() == 0) {
            // No parameter so return null
            return null;

        }
View Full Code Here

            body.getAny().add(elem);
        }
        for (JAXBElement<?> elem : headerContent) {
            header.getAny().add(elem);
        }
        Envelope envelope = new Envelope();
        if (headerContent.size() > 0) {
            envelope.setHeader(header);
        }
        envelope.setBody(body);
        JAXBElement<Envelope> envelopeEl = objectFactory.createEnvelope(envelope);
        return envelopeEl;
    }
View Full Code Here

    @Override
    public Object doUnmarshal(Exchange exchange, InputStream stream, Object rootObject) throws IOException {
        if (rootObject.getClass() != Envelope.class) {
            throw new RuntimeCamelException("Expected Soap Envelope but got " + rootObject.getClass());
        }
        Envelope envelope = (Envelope) rootObject;

        Header header = envelope.getHeader();
        if (header != null) {
            List<Object> returnHeaders;
            List<Object> anyHeaderElements = envelope.getHeader().getAny();
            if (null != anyHeaderElements && !(getDataFormat().isIgnoreUnmarshalledHeaders())) {
                if (getDataFormat().isIgnoreJAXBElement()) {
                    returnHeaders = new ArrayList<Object>();
                    for (Object headerEl : anyHeaderElements) {
                        returnHeaders.add(JAXBIntrospector.getValue(headerEl));
                    }
                } else {
                    returnHeaders = anyHeaderElements;
                }
                exchange.getOut().setHeader(SoapJaxbDataFormat.SOAP_UNMARSHALLED_HEADER_LIST, returnHeaders);
            }
        }

        List<Object> anyElement = envelope.getBody().getAny();
        if (anyElement.size() == 0) {
            // No parameter so return null
            return null;

        }
View Full Code Here

TOP

Related Classes of org.w3.www._2005._05.xmlmime.HexBinary

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.