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

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


        final XmlObject detail = XmlObject.Factory.newInstance();
        for(MessagePart messagePart: faultParts)
        {
            final MessagePart.FaultPart faultPart = (MessagePart.FaultPart)messagePart ;
            final String faultName = faultPart.getName() ;
            final SampleXmlUtil generator = new SampleXmlUtil(false) ;
            generator.setExampleContent(false) ;
            generator.setTypeComment(false) ;
            final XmlCursor cursor = detail.newCursor();
            cursor.toFirstContentToken() ;
            generator.setTypeComment(true) ;
            generator.setIgnoreOptional(wsdlOperation.getInterface().getSettings().getBoolean( WsdlSettings.XML_GENERATION_ALWAYS_INCLUDE_OPTIONAL_ELEMENTS ) );
            for(Part part: faultPart.getWsdlParts())
            {
                try
                {
                    soapMessageBuilder.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

    return iface == null ? wsdlContext.getSoapVersion() : iface.getSoapVersion();
  }

  public static String buildFault( String faultcode, String faultstring, SoapVersion soapVersion )
  {
    SampleXmlUtil generator = new SampleXmlUtil( false );
    generator.setTypeComment( false );
    generator.setIgnoreOptional( true );

    String emptyResponse = buildEmptyFault( generator, soapVersion );

    if( soapVersion == SoapVersion.Soap11 )
    {
View Full Code Here

    return buildEmptyFault( getSoapVersion() );
  }

  public static String buildEmptyFault( SoapVersion soapVersion )
  {
    SampleXmlUtil generator = new SampleXmlUtil( false );

    String emptyResponse = buildEmptyFault( generator, soapVersion );

    return emptyResponse;
  }
View Full Code Here

    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

    }
  }

  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 SoapVersion getSoapVersion() {
        return iface == null ? wsdlContext.getSoapVersion() : iface.getSoapVersion();
    }

    public static String buildFault(String faultcode, String faultstring, SoapVersion soapVersion) {
        SampleXmlUtil generator = new SampleXmlUtil(false);
        generator.setTypeComment(false);
        generator.setIgnoreOptional(true);

        String emptyResponse = buildEmptyFault(generator, soapVersion);

        if (soapVersion == SoapVersion.Soap11) {
            emptyResponse = XmlUtils.setXPathContent(emptyResponse, "//faultcode", faultcode);
View Full Code Here

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

    public static String buildEmptyFault(SoapVersion soapVersion) {
        SampleXmlUtil generator = new SampleXmlUtil(false);

        String emptyResponse = buildEmptyFault(generator, soapVersion);

        return emptyResponse;
    }
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.