Package com.eviware.soapui.impl.wsdl.support.xsd

Examples of com.eviware.soapui.impl.wsdl.support.xsd.SampleXmlUtil


    public String buildEmptyMessage() {
        return buildEmptyMessage(getSoapVersion());
    }

    public static String buildEmptyMessage(SoapVersion soapVersion) {
        SampleXmlUtil generator = new SampleXmlUtil(false);
        generator.setTypeComment(false);
        generator.setIgnoreOptional(true);
        return generator.createSample(soapVersion.getEnvelopeType());
    }
View Full Code Here


    }

    public String buildSoapMessageFromInput(BindingOperation bindingOperation, boolean buildOptional,
                                            boolean alwaysBuildHeaders) throws Exception {
        boolean inputSoapEncoded = WsdlUtils.isInputSoapEncoded(bindingOperation);
        SampleXmlUtil xmlGenerator = new SampleXmlUtil(inputSoapEncoded);
        xmlGenerator.setMultiValues(multiValues);
        xmlGenerator.setIgnoreOptional(!buildOptional);

        XmlObject object = XmlObject.Factory.newInstance();
        XmlCursor cursor = object.newCursor();
        cursor.toNextToken();
        cursor.beginElement(wsdlContext.getSoapVersion().getEnvelopeQName());
View Full Code Here

    }

    public String buildSoapMessageFromOutput(BindingOperation bindingOperation, boolean buildOptional,
                                             boolean alwaysBuildHeaders) throws Exception {
        boolean inputSoapEncoded = WsdlUtils.isInputSoapEncoded(bindingOperation);
        SampleXmlUtil xmlGenerator = new SampleXmlUtil(inputSoapEncoded);
        xmlGenerator.setIgnoreOptional(!buildOptional);
        xmlGenerator.setMultiValues(multiValues);

        XmlObject object = XmlObject.Factory.newInstance();
        XmlCursor cursor = object.newCursor();
        cursor.toNextToken();
        cursor.beginElement(wsdlContext.getSoapVersion().getEnvelopeQName());
View Full Code Here

            return object.xmlText();
        }
    }

    public String buildFault(FaultPart faultPart) {
        SampleXmlUtil generator = new SampleXmlUtil(false);
        generator.setExampleContent(false);
        generator.setTypeComment(false);
        generator.setMultiValues(multiValues);
        String faultResponse = iface.getMessageBuilder().buildEmptyFault();

        XmlCursor cursor = null;
        try {
            // XmlObject xmlObject = XmlObject.Factory.parse( faultResponse );
            XmlObject xmlObject = XmlUtils.createXmlObject(faultResponse);
            XmlObject[] detail = xmlObject.selectPath("//detail");
            if (detail.length > 0) {
                cursor = detail[0].newCursor();

                cursor.toFirstContentToken();

                generator.setTypeComment(true);
                generator.setIgnoreOptional(iface.getSettings().getBoolean(
                        WsdlSettings.XML_GENERATION_ALWAYS_INCLUDE_OPTIONAL_ELEMENTS));

                for (Part part : faultPart.getWsdlParts()) {
                    createElementForPart(part, cursor, generator);
                }
View Full Code Here

    }

    public String getDefaultContent() {
        if (getSchemaType() != null) {
            // Document document = XmlUtils.createDocument( getElement() );
            SampleXmlUtil generator = new SampleXmlUtil(false);
            generator.setIgnoreOptional(false);
            return generator.createSample(getSchemaType());
            // return XmlUtils.serialize( document );
        } else {
            return "";
        }
    }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.wsdl.support.xsd.SampleXmlUtil

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.