Package com.eviware.soapui.impl.wsdl

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



    private static WsdlOperationInfo getWsdlOperationInfo(final Operation operation)
        throws XMLStreamException
    {
        final WsdlOperation wsdlOperation = (WsdlOperation)operation ;
       
        final String requestTemplate = wsdlOperation.createRequest(true);
        final XMLEventReader requestReader = XMLHelper.getXMLEventReader(new StringReader(requestTemplate)) ;
        final List<XMLEvent> requestEvents = ESBStaxXMLEvent.cloneStream(requestReader) ;
       
        final String responseTemplate = wsdlOperation.createResponse(true);
        final List<XMLEvent> responseEvents ;
        if (responseTemplate != null)
        {
            final XMLEventReader responseReader = XMLHelper.getXMLEventReader(new StringReader(responseTemplate)) ;
            responseEvents = ESBStaxXMLEvent.cloneStream(responseReader) ;
        }
        else
        {
            responseEvents = Collections.emptyList() ;
        }

        final MessagePart[] faultParts = wsdlOperation.getFaultParts();
        final Map<String, List<XMLEvent>> faultEventsMap = new HashMap<String, List<XMLEvent>>() ;
       
        final SoapMessageBuilder soapMessageBuilder = wsdlOperation.getInterface().getMessageBuilder();
        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


    }
    else
    {
      ExtendedHttpMethod httpMethod = ( ExtendedHttpMethod )context
          .getProperty( BaseHttpRequestTransport.HTTP_METHOD );
      WsdlOperation operation = ( ( WsdlRequest )wsdlRequest ).getOperation();
      // TODO check UsingAddressing for particular endpoint when running a
      // request
      // ((WsdlRequest)wsdlRequest).getEndpoint();
      SoapVersion soapVersion = operation.getInterface().getSoapVersion();
      content = new WsaUtils( content, soapVersion, operation, context ).addWSAddressingRequest(
          ( WsdlRequest )wsdlRequest, httpMethod );
      if( content != null )
        context.setProperty( BaseHttpRequestTransport.REQUEST_CONTENT, content );
    }
View Full Code Here

    operationCombo.setPreferredSize( new Dimension( 150, 20 ) );
    operationCombo.addItemListener( new OperationComboListener() );

    toolbar.addLabeledFixed( "Operation", operationCombo );

    WsdlOperation operation = getModelItem().getOperation();
    interfaceCombo.setSelectedItem( operation == null ? null : operation.getInterface().getName() );
    operationCombo.setSelectedItem( operation == null ? null : operation.getName() );

    toolbar.addGlue();
    toolbar.addFixed( createActionButton( new ShowOnlineHelpAction( HelpUrls.MOCKOPERATION_HELP_URL ), true ) );

    return toolbar;
View Full Code Here

  {
    public void itemStateChanged( ItemEvent e )
    {
      WsdlInterface iface = ( WsdlInterface )getModelItem().getMockService().getProject()
          .getInterfaceByName( interfaceCombo.getSelectedItem().toString() );
      WsdlOperation operation = iface.getOperationByName( operationCombo.getSelectedItem().toString() );
      getModelItem().setOperation( operation );
    }
View Full Code Here

      super( xmlEditor, request );
    }

    protected ValidationError[] validateXml( String xml )
    {
      WsdlOperation operation = getModelItem().getOperation();
      WsdlValidator validator = new WsdlValidator( ( operation.getInterface() ).getWsdlContext() );

      WsdlResponseMessageExchange wsdlResponseMessageExchange = new WsdlResponseMessageExchange( getModelItem() );
      wsdlResponseMessageExchange.setRequestContent( xml );
      return validator.assertRequest( wsdlResponseMessageExchange, false );
    }
View Full Code Here

      super( xmlEditor, mockResponse );
    }

    protected ValidationError[] validateXml( String xml )
    {
      WsdlOperation operation = getModelItem().getMockOperation().getOperation();

      if( operation == null )
      {
        return new ValidationError[] { new AssertionError( "Missing operation for MockResponse" ) };
      }

      WsdlValidator validator = new WsdlValidator( ( operation.getInterface() ).getWsdlContext() );
      return validator.assertRequest( new WsdlMockResultMessageExchange( getModelItem().getMockResult(),
          getModelItem() ), false );
    }
View Full Code Here

      {
        WsdlTestRequest testRequest = ( WsdlTestRequest )getModelItem();
        testRequest.assertResponse( new WsdlTestRunContext( testRequest.getTestStep() ) );
      }

      WsdlOperation operation = getModelItem().getOperation();
      WsdlValidator validator = new WsdlValidator( ( operation.getInterface() ).getWsdlContext() );

      return validator.assertResponse( new WsdlResponseMessageExchange( getModelItem() ), false );
    }
View Full Code Here

      getValidateXmlAction().setEnabled( getModelItem().getMockOperation().getOperation().isBidirectional() );
    }

    protected ValidationError[] validateXml( String xml )
    {
      WsdlOperation operation = getModelItem().getMockOperation().getOperation();
      if( operation == null )
      {
        return new ValidationError[] { new AssertionError( "Missing operation for MockResponse" ) };
      }

      WsdlValidator validator = new WsdlValidator( ( operation.getInterface() ).getWsdlContext() );
      return validator.assertResponse( new WsdlMockResponseMessageExchange( getModelItem() ), false );
    }
View Full Code Here

    }
    else
    {
      ExtendedHttpMethod httpMethod = ( ExtendedHttpMethod )context
          .getProperty( BaseHttpRequestTransport.HTTP_METHOD );
      WsdlOperation operation = ( ( WsdlRequest )wsdlRequest ).getOperation();
      // TODO check UsingAddressing for particular endpoint when running a
      // request
      // ((WsdlRequest)wsdlRequest).getEndpoint();
      SoapVersion soapVersion = operation.getInterface().getSoapVersion();
      String identifier = ( ( WsdlRequest )wsdlRequest ).getWsrmConfig().getSequenceIdentifier();
      long msgNumber = ( ( WsdlRequest )wsdlRequest ).getWsrmConfig().getLastMessageId();

      content = new WsrmUtils( content, soapVersion, context ).createNewWSReliableMessagingRequest(
          ( WsdlRequest )wsdlRequest, httpMethod, identifier, msgNumber, wsdlRequest.getEndpoint() );
View Full Code Here

  public SchemaTypeSystem getTypeSystem()
  {
    try
    {
      WsdlOperation operation = mockResponse.getMockOperation().getOperation();
      if( operation != null )
      {
        WsdlInterface iface = operation.getInterface();
        WsdlContext wsdlContext = iface.getWsdlContext();
        return wsdlContext.getSchemaTypeSystem();
      }
    }
    catch( Exception e1 )
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.