Package org.jibx.ws.io

Examples of org.jibx.ws.io.MessageOptions


        try {
            closeChannel()// will need a new channel for the new output options
        } catch (IOException e) {
            logger.warn("Unable to close existing channel", e);
        }
        m_messageOptions = new MessageOptions(options);
        setModified(true);
    }
View Full Code Here


     *
     * @return message options - will always be non-null
     */
    protected final MessageOptions getMessageOptions() {
        if (m_messageOptions == null) {
            m_messageOptions = new MessageOptions();
        }
        return m_messageOptions;
    }
View Full Code Here

    protected Object configure(String path, String protocol, String reqtype, String[] rsptypes) {
        try {
            IBindingFactory fact = BindingDirectory.getFactory(Query.class);
            System.out.println("Connecting to service at " + path + " using protocol " + protocol);
            Protocol p = ProtocolDirectory.getProtocol(protocol);
            MessageOptions options = new MessageOptions();
            options.setOutMediaTypeCode(reqtype);
            options.setInMediaTypeCodes(rsptypes);
            return p.createClient(path, fact, options);
        } catch (Exception ex) {
            ex.printStackTrace(System.err);
            throw new RuntimeException("Error: " + ex.getMessage(), ex);
        }
View Full Code Here

     * @throws Throwable
     */
    public void testSetMessageOptionsChangesOutputFormat() throws Throwable {
        StubbedChannel.setInput(TestObjects.RESPONSE_SOAP);

        m_soapClient.setMessageOptions(new MessageOptions(' ', 4, "\n"));
        invokeCall();

        String expectedRequest = EXPECTED_REQUEST_XML_FORMATTED;
       
        assertEquals("SOAP Request: ", expectedRequest, StubbedChannel.getOutput());
View Full Code Here

     * @throws Throwable
     */
    public void testSetMessageOptionsSetsXMLEncodingAndStandaloneDeclaration() throws Throwable {
        StubbedChannel.setInput(TestObjects.RESPONSE_SOAP);

        m_soapClient.setMessageOptions(new MessageOptions(XmlEncoding.UTF_8, true, Boolean.TRUE));
        invokeCall();

        String expectedRequest = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
            + EXPECTED_REQUEST_XML_UNFORMATTED;

View Full Code Here

     * @throws Throwable
     */
    public void testSetMessageOptionsSetsXMLEncodingAndNotStandaloneDeclaration() throws Throwable {
        StubbedChannel.setInput(TestObjects.RESPONSE_SOAP);

        m_soapClient.setMessageOptions(new MessageOptions(XmlEncoding.UTF_8, true, Boolean.FALSE));
        invokeCall();

        String expectedRequest = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>"
            + EXPECTED_REQUEST_XML_UNFORMATTED;

View Full Code Here

     * @throws Throwable
     */
    public void testSetMessageOptionsSetsStandaloneDeclaration() throws Throwable {
        StubbedChannel.setInput(TestObjects.RESPONSE_SOAP);

        m_soapClient.setMessageOptions(new MessageOptions(XmlEncoding.UTF_8, false, Boolean.FALSE));
        invokeCall();

        String expectedRequest = "<?xml version=\"1.0\" standalone=\"no\"?>"
            + EXPECTED_REQUEST_XML_UNFORMATTED;

View Full Code Here

     * @throws Throwable
     */
    public void testSetMessageOptionsSetsXMLEncoding() throws Throwable {
        StubbedChannel.setInput(TestObjects.RESPONSE_SOAP);

        m_soapClient.setMessageOptions(new MessageOptions(XmlEncoding.UTF_8, true, null));
        invokeCall();

        String expectedRequest = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
            + EXPECTED_REQUEST_XML_UNFORMATTED;

View Full Code Here

     * @throws Throwable
     */
    public void testSetMessageOptionsChangesOutputFormatAndXmlEncoding() throws Throwable {
        StubbedChannel.setInput(TestObjects.RESPONSE_SOAP);

        m_soapClient.setMessageOptions(new MessageOptions(XmlEncoding.UTF_8, true, Boolean.TRUE, ' ', 4, "\n"));
        invokeCall();

        String expectedRequest = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
            + EXPECTED_REQUEST_XML_FORMATTED;

View Full Code Here

TOP

Related Classes of org.jibx.ws.io.MessageOptions

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.