Package com.eviware.soapui.impl.wsdl

Examples of com.eviware.soapui.impl.wsdl.WsdlOperation$WsdlFaultPart


    QName contentQName = XmlUtils.getQName( contentElm.getDomNode() );
    NodeList contentChildNodes = null;

    for( int c = 0; c < operations.size(); c++ )
    {
      WsdlOperation wsdlOperation = operations.get( c );
      String action = wsdlOperation.getAction();

      // matches soapAction?
      if( !requireSoapActionMatch
          || ( ( soapAction == null && wsdlOperation.getAction() == null ) || ( action != null && action
              .equals( soapAction ) ) ) )
      {
        QName qname = wsdlOperation.getRequestBodyElementQName();

        if( !contentQName.equals( qname ) )
          continue;

        SoapVersion ifaceSoapVersion = wsdlOperation.getInterface().getSoapVersion();

        if( requireSoapVersionMatch && ifaceSoapVersion != soapVersion )
        {
          continue;
        }

        // check content
        if( wsdlOperation.getStyle().equals( WsdlOperation.STYLE_DOCUMENT ) )
        {
          // check that all attachments match
          BindingOperation bindingOperation = wsdlOperation.getBindingOperation();
          Message message = bindingOperation.getOperation().getInput().getMessage();
          List<Part> parts = message.getOrderedParts( null );

          for( int x = 0; x < parts.size(); x++ )
          {
            // check for attachment part
            if( WsdlUtils.isAttachmentInputPart( parts.get( x ), bindingOperation ) )
            {
              for( Attachment attachment : attachments )
              {
                if( attachment.getPart().equals( parts.get( x ).getName() ) )
                {
                  parts.remove( x );
                  x-- ;
                }
              }
            }
            else
            {
              parts.remove( x );
              x-- ;
            }
          }

          // matches!
          if( parts.isEmpty() )
          {
            return wsdlOperation;
          }
        }
        else if( wsdlOperation.getStyle().equals( WsdlOperation.STYLE_RPC ) )
        {
          BindingOperation bindingOperation = wsdlOperation.getBindingOperation();
          Message message = bindingOperation.getOperation().getInput().getMessage();
          List<Part> parts = message.getOrderedParts( null );

          if( contentChildNodes == null )
            contentChildNodes = XmlUtils.getChildElements( ( Element )contentElm.getDomNode() );
View Full Code Here


    QName contentQName = XmlUtils.getQName( contentElm.getDomNode() );
    NodeList contentChildNodes = null;

    for( int c = 0; c < operations.size(); c++ )
    {
      WsdlOperation wsdlOperation = operations.get( c );
      String action = wsdlOperation.getAction();

      // matches soapAction?
      if( !requireSoapActionMatch
          || ( ( soapAction == null && wsdlOperation.getAction() == null ) || ( action != null && action
              .equals( soapAction ) ) ) )
      {
        QName qname = wsdlOperation.getResponseBodyElementQName();

        if( !contentQName.equals( qname ) )
          continue;

        SoapVersion ifaceSoapVersion = wsdlOperation.getInterface().getSoapVersion();

        if( requireSoapVersionMatch && ifaceSoapVersion != soapVersion )
        {
          continue;
        }

        // check content
        if( wsdlOperation.getStyle().equals( WsdlOperation.STYLE_DOCUMENT ) )
        {
          // matches!
          return wsdlOperation;
        }
        else if( wsdlOperation.getStyle().equals( WsdlOperation.STYLE_RPC ) )
        {
          BindingOperation bindingOperation = wsdlOperation.getBindingOperation();
          Message message = bindingOperation.getOperation().getOutput().getMessage();
          List<Part> parts = message.getOrderedParts( null );

          if( contentChildNodes == null )
            contentChildNodes = XmlUtils.getChildElements( ( Element )contentElm.getDomNode() );
View Full Code Here

    Set<WsdlInterface> interfaces = new HashSet<WsdlInterface>();

    for( int i = 0; i < mockService.getMockOperationCount(); i++ )
    {
      WsdlOperation operation = mockService.getMockOperationAt( i ).getOperation();
      if( operation != null )
        interfaces.add( operation.getInterface() );
    }

    for( WsdlInterface iface : interfaces )
      iface.getWsdlContext().loadIfNecessary();
View Full Code Here

      SoapVersion soapVersion = mockRequest.getSoapVersion();
      if( soapVersion == null )
        throw new DispatchException( "Unrecognized SOAP Version" );

      String soapAction = mockRequest.getSoapAction();
      WsdlOperation operation = null;

      if( SoapUtils.isSoapFault( mockRequest.getRequestContent(), soapVersion ) )
      {
        // we should inspect fault detail and try to find matching operation
        // but not for now..
View Full Code Here

  public MessagePart[] getResponseParts()
  {
    try
    {
      // init
      WsdlOperation op = getMockOperation().getOperation();
      if( op == null || op.isUnidirectional() )
        return new MessagePart[0];

      List<MessagePart> result = new ArrayList<MessagePart>();
      WsdlContext wsdlContext = op.getInterface().getWsdlContext();
      BindingOperation bindingOperation = op.findBindingOperation( wsdlContext.getDefinition() );

      if( bindingOperation == null )
        return new MessagePart[0];

      // header parts
View Full Code Here

  {
    if( definedAttachmentParts == null )
    {
      try
      {
        WsdlOperation operation = getMockOperation().getOperation();
        if( operation == null )
        {
          definedAttachmentParts = new ArrayList<HttpAttachmentPart>();
        }
        else
View Full Code Here

  }

  private String writeResponse( WsdlMockResult response, String responseContent ) throws Exception
  {
    MimeMultipart mp = null;
    WsdlOperation operation = getMockOperation().getOperation();
    if( operation == null )
      throw new Exception( "Missing WsdlOperation for mock response" );

    SoapVersion soapVersion = operation.getInterface().getSoapVersion();

    StringToStringMap contentIds = new StringToStringMap();
    boolean isXOP = isMtomEnabled() && isForceMtom();

    // preprocess only if neccessary
View Full Code Here

  {
    WsdlInterface iface = ( WsdlInterface )getTestCase().getTestSuite().getProject().getInterfaceByName( string );
    if( iface != null )
    {
      mockResponseStepConfig.setInterface( iface.getName() );
      WsdlOperation operation = iface.getOperationAt( 0 );
      mockResponseStepConfig.setOperation( operation.getName() );
      mockOperation.setOperation( operation );
    }
  }
View Full Code Here

    }
  }

  public void setOperation( String string )
  {
    WsdlOperation operation = getInterface().getOperationByName( string );
    if( operation != null )
    {
      mockResponseStepConfig.setOperation( string );
      mockOperation.setOperation( operation );
    }
View Full Code Here

          {

            @Override
            public boolean update()
            {
              WsdlOperation operation = ( WsdlOperation )getSelectedOperation();
              setInterface( operation.getInterface().getName() );
              setOperation( operation.getName() );
              initMockObjects( getTestCase() );
              initProperties();
              setDisabled( false );
              return true;
            }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.wsdl.WsdlOperation$WsdlFaultPart

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.