Package com.eviware.soapui.impl.wsdl

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


      {
        wsdlContext.getSoapVersion().validateSoapEnvelope( response, errors );

        if( errors.isEmpty() && !envelopeOnly )
        {
          WsdlOperation operation = messageExchange.getOperation();
          BindingOperation bindingOperation = operation.getBindingOperation();
          if( bindingOperation == null )
          {
            errors.add( XmlError.forMessage( "Missing operation [" + operation.getBindingOperationName()
                + "] in wsdl definition" ) );
          }
          else
          {
            Part[] outputParts = WsdlUtils.getOutputParts( bindingOperation );
View Full Code Here


    super( "Open Request", "Opens/Creates a request for this MockResponse with correct endpoint" );
  }

  public void perform( WsdlMockResponse mockResponse, Object param )
  {
    WsdlOperation operation = mockResponse.getMockOperation().getOperation();
    if( operation == null )
    {
      UISupport.showErrorMessage( "Missing operation for this mock response" );
      return;
    }

    String[] names = ModelSupport.getNames( operation.getRequestList(), new String[] { "-> Create New" } );

    String name = ( String )UISupport.prompt( "Select Request for Operation [" + operation.getName() + "] "
        + "to open or create", "Open Request", names );
    if( name != null )
    {
      WsdlRequest request = operation.getRequestByName( name );
      if( request == null )
      {
        name = UISupport.prompt( "Specify name of new request", "Open Request",
            "Request " + ( operation.getRequestCount() + 1 ) );
        if( name == null )
          return;

        boolean createOptional = operation.getSettings().getBoolean(
            WsdlSettings.XML_GENERATION_ALWAYS_INCLUDE_OPTIONAL_ELEMENTS );
        if( !createOptional )
          createOptional = UISupport.confirm( "Create optional elements from schema?", "Create Request" );

        request = operation.addNewRequest( name );
        String requestContent = operation.createRequest( createOptional );
        if( requestContent != null )
        {
          request.setRequestContent( requestContent );
        }
      }
View Full Code Here

    super( "Open Request", "Opens/Creates a request for this MockOperation with correct endpoint" );
  }

  public void perform( WsdlMockOperation mockOperation, Object param )
  {
    WsdlOperation operation = mockOperation.getOperation();
    if( operation == null )
    {
      UISupport.showErrorMessage( "Missing operation for this mock response" );
      return;
    }

    String[] names = ModelSupport.getNames( operation.getRequestList(), new String[] { "-> Create New" } );

    String name = ( String )UISupport.prompt( "Select Request for Operation [" + operation.getName() + "] "
        + "to open or create", "Open Request", names );
    if( name != null )
    {
      WsdlRequest request = operation.getRequestByName( name );
      if( request == null )
      {
        name = UISupport.prompt( "Specify name of new request", "Open Request",
            "Request " + ( operation.getRequestCount() + 1 ) );
        if( name == null )
          return;

        boolean createOptional = operation.getSettings().getBoolean(
            WsdlSettings.XML_GENERATION_ALWAYS_INCLUDE_OPTIONAL_ELEMENTS );
        if( !createOptional )
          createOptional = UISupport.confirm( "Create optional elements from schema?", "Create Request" );

        request = operation.addNewRequest( name );
        String requestContent = operation.createRequest( createOptional );
        if( requestContent != null )
        {
          request.setRequestContent( requestContent );
        }
      }
View Full Code Here

  {
    Set<WsdlInterface> requiredInterfaces = new HashSet<WsdlInterface>();

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

    if( requiredInterfaces.size() > 0 && targetProject.getInterfaceCount() > 0 )
    {
      Map<String, WsdlInterface> bindings = new HashMap<String, WsdlInterface>();
View Full Code Here

        public void valueChanged( XFormField sourceField, String newValue, String oldValue )
        {
          WsdlProject project = testStep.getMockService().getProject();
          dialog.setOptions( Form.OPERATION,
              ModelSupport.getNames( project.getInterfaceByName( newValue ).getOperationList() ) );
          WsdlOperation operation = testStep.getOperation();
          dialog.setValue( Form.OPERATION, operation == null ? "" : operation.getName() );
        }
      } );

      dialog.getFormField( Form.RECREATE_REQUEST ).addFormFieldListener( new XFormFieldListener()
      {

        public void valueChanged( XFormField sourceField, String newValue, String oldValue )
        {
          boolean enabled = Boolean.parseBoolean( newValue );

          dialog.getFormField( Form.CREATE_OPTIONAL ).setEnabled( enabled );
          dialog.getFormField( Form.KEEP_EXISTING ).setEnabled( enabled );
        }
      } );

      dialog.getFormField( Form.CREATE_OPTIONAL ).setEnabled( false );
      dialog.getFormField( Form.KEEP_EXISTING ).setEnabled( false );
    }

    WsdlOperation operation = testStep.getOperation();
    WsdlProject project = testStep.getMockService().getProject();
    String[] interfaceNames = ModelSupport.getNames( project.getInterfaceList(),
        new ModelSupport.InterfaceTypeFilter( WsdlInterfaceFactory.WSDL_TYPE ) );
    dialog.setOptions( Form.INTERFACE, interfaceNames );
    dialog.setValue( Form.INTERFACE, operation == null ? interfaceNames[0] : operation.getInterface().getName() );

    dialog.setOptions( Form.OPERATION,
        ModelSupport.getNames( project.getInterfaceByName( dialog.getValue( Form.INTERFACE ) ).getOperationList() ) );
    dialog.setValue( Form.OPERATION, operation == null ? null : operation.getName() );
    dialog.setValue( Form.NAME, target.getName() );

    if( dialog.show() )
    {
      String ifaceName = dialog.getValue( Form.INTERFACE );
      String operationName = dialog.getValue( Form.OPERATION );

      WsdlInterface iface = ( WsdlInterface )project.getInterfaceByName( ifaceName );
      operation = iface.getOperationByName( operationName );
      target.setOperation( operation );

      String name = dialog.getValue( Form.NAME ).trim();
      if( name.length() > 0 && !target.getName().equals( name ) )
        target.setName( name );

      if( dialog.getBooleanValue( Form.RECREATE_REQUEST ) )
      {
        String req = operation.createResponse( dialog.getBooleanValue( Form.CREATE_OPTIONAL ) );
        if( req == null )
        {
          UISupport.showErrorMessage( "Response creation failed" );
        }
        else
View Full Code Here

    }
  }

  public static TestStepConfig createNewTestStep( WsdlMockResponse mockResponse )
  {
    WsdlOperation operation = mockResponse.getMockOperation().getOperation();
    if( operation == null )
    {
      UISupport.showErrorMessage( "Missing operation for this mock response" );
      return null;
    }

    ensureDialog();

    dialog.setValue( CreateForm.INTERFACE, operation.getInterface().getName() );
    dialog.setValue( CreateForm.OPERATION, operation.getName() );
    dialog.setBooleanValue( CreateForm.CREATE_RESPONSE, false );
    dialog.setIntValue( CreateForm.PORT, mockResponse.getMockOperation().getMockService().getPort() );
    dialog.setValue( CreateForm.PATH, mockResponse.getMockOperation().getMockService().getPath() );

    return createFromDialog( operation.getInterface().getProject(), mockResponse.getMockOperation().getName() + " - "
        + mockResponse.getName() );
  }
View Full Code Here

    {
      String ifaceName = dialog.getValue( Form.INTERFACE );
      String operationName = dialog.getValue( Form.OPERATION );

      WsdlInterface iface = ( WsdlInterface )project.getInterfaceByName( ifaceName );
      WsdlOperation operation = iface.getOperationByName( operationName );
      target.setOperation( operation );

      String name = dialog.getValue( Form.NAME ).trim();
      if( name.length() > 0 && !target.getName().equals( name ) )
        target.setName( name );

      if( dialog.getBooleanValue( Form.RECREATE_REQUEST ) )
      {
        String req = operation.createRequest( dialog.getBooleanValue( Form.CREATE_OPTIONAL ) );
        if( req == null )
        {
          UISupport.showErrorMessage( "Request creation failed" );
          return;
        }
View Full Code Here

    if( op != null )
    {
      int ix = options.indexOf( op );
      if( ix != -1 )
      {
        WsdlOperation operation = ( WsdlOperation )operations.get( ix );

        if( dialog == null )
          buildDialog();

        dialogValues.put( STEP_NAME, name );
View Full Code Here

    WsdlTestRequestStep step = ( WsdlTestRequestStep )result.getTestStep();
    String name = UISupport.prompt( "Specify name of request", "Create Request", "Result from " + step.getName() );

    if( name != null )
    {
      WsdlOperation operation = ( WsdlOperation )step.getTestRequest().getOperation();
      WsdlRequest request = operation.addNewRequest( name );
      request.setRequestContent( result.getRequestContent() );
      request.setDomain( result.getDomain() );
      request.setEncoding( result.getEncoding() );
      request.setEndpoint( result.getEndpoint() );
      request.setPassword( result.getPassword() );
View Full Code Here

  public void perform( WsdlRequest request, Object param )
  {
    if( UISupport.confirm( "Delete request [" + request.getName() + "] from operation ["
        + request.getOperation().getName() + "]", "Delete Request" ) )
    {
      WsdlOperation operation = ( WsdlOperation )request.getOperation();
      operation.removeRequest( request );
    }
  }
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.