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

Examples of com.eviware.soapui.impl.wsdl.support.soap.SoapVersion


    this.isXOP = isXOP;
  }

  public String getContentType()
  {
    SoapVersion soapVersion = wsdlRequest.getOperation().getInterface().getSoapVersion();

    if( isXOP )
    {
      return AttachmentUtils.buildRootPartContentType( wsdlRequest.getOperation().getName(), soapVersion );
    }
    else
    {
      return soapVersion.getContentType() + "; charset=UTF-8";
    }
  }
View Full Code Here


  public String getContentType()
  {
    try
    {
      SoapVersion soapVersion = wsdlRequest.getOperation().getInterface().getSoapVersion();

      if( isXOP )
      {
        String header = message.getHeader( "Content-Type" )[0];

        return AttachmentUtils.buildMTOMContentType( header, wsdlRequest.getAction(), soapVersion );
      }
      else
      {
        String header = message.getHeader( "Content-Type" )[0];
        int ix = header.indexOf( "boundary" );

        return "multipart/related; type=\"" + soapVersion.getContentType() + "\"; " + "start=\""
            + AttachmentUtils.ROOTPART_SOAPUI_ORG + "\"; " + header.substring( ix );
      }
    }
    catch( MessagingException e )
    {
View Full Code Here

    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
    if( isMtomEnabled() || isInlineFilesEnabled() || getAttachmentCount() > 0 )
    {
      try
      {
        mp = new MimeMultipart();

        MessageXmlObject requestXmlObject = new MessageXmlObject( operation, responseContent, false );
        MessageXmlPart[] requestParts = requestXmlObject.getMessageParts();
        for( MessageXmlPart requestPart : requestParts )
        {
          if( AttachmentUtils.prepareMessagePart( this, mp, requestPart, contentIds ) )
            isXOP = true;
        }
        responseContent = requestXmlObject.getMessageContent();
      }
      catch( Exception e )
      {
        e.printStackTrace();
      }
    }

    if( isRemoveEmptyContent() )
    {
      responseContent = RemoveEmptyContentRequestFilter.removeEmptyContent( responseContent, getSoapVersion()
          .getEnvelopeNamespace(), true );
    }

    if( isStripWhitespaces() )
    {
      responseContent = XmlUtils.stripWhitespaces( responseContent );
    }

    String status = getResponseHttpStatus();
    WsdlMockRequest request = response.getMockRequest();

    if( status == null || status.trim().length() == 0 )
    {
      if( SoapUtils.isSoapFault( responseContent, request.getSoapVersion() ) )
      {
        request.getHttpResponse().setStatus( HttpServletResponse.SC_INTERNAL_SERVER_ERROR );
        response.setResponseStatus( HttpServletResponse.SC_INTERNAL_SERVER_ERROR );
      }
      else
      {
        request.getHttpResponse().setStatus( HttpServletResponse.SC_OK );
        response.setResponseStatus( HttpServletResponse.SC_OK );
      }
    }
    else
    {
      try
      {
        int statusCode = Integer.parseInt( status );
        request.getHttpResponse().setStatus( statusCode );
        response.setResponseStatus( statusCode );
      }
      catch( RuntimeException e )
      {
        SoapUI.logError( e );
      }
    }

    ByteArrayOutputStream outData = new ByteArrayOutputStream();

    // non-multipart request?
    String responseCompression = getResponseCompression();
    if( !isXOP && ( mp == null || mp.getCount() == 0 ) && getAttachmentCount() == 0 )
    {
      String encoding = getEncoding();
      if( responseContent == null )
        responseContent = "";

      byte[] content = encoding == null ? responseContent.getBytes() : responseContent.getBytes( encoding );

      if( !response.getResponseHeaders().containsKeyIgnoreCase( "Content-Type" ) )
        response.setContentType( soapVersion.getContentTypeHttpHeader( encoding, null ) );

      String acceptEncoding = response.getMockRequest().getRequestHeaders().get( "Accept-Encoding", "" );
      if( AUTO_RESPONSE_COMPRESSION.equals( responseCompression ) && acceptEncoding != null
          && acceptEncoding.toUpperCase().contains( "GZIP" ) )
      {
View Full Code Here

                    .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).createNewWSReliableMessagingRequest(
                    (WsdlRequest) wsdlRequest, identifier, msgNumber, wsdlRequest.getEndpoint());
View Full Code Here

        WsdlInterface wsdlInterface = (WsdlInterface) wsdlRequest.getOperation().getInterface();

        // init content-type and encoding
        String encoding = System.getProperty("soapui.request.encoding", wsdlRequest.getEncoding());

        SoapVersion soapVersion = wsdlInterface.getSoapVersion();
        String soapAction = wsdlRequest.isSkipSoapAction() ? null : wsdlRequest.getAction();

        postMethod.setHeader("Content-Type", soapVersion.getContentTypeHttpHeader(encoding, soapAction));

        if (!wsdlRequest.isSkipSoapAction()) {
            String soapActionHeader = soapVersion.getSoapActionHeader(soapAction);
            if (soapActionHeader != null) {
                postMethod.setHeader("SOAPAction", soapActionHeader);
            }
        }
    }
View Full Code Here

                    .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

    String content;
    SoapVersion soapVersion;

    public static String removeWSSOutgoing(String content, WsaContainer wsaContainer) {
        try {
            SoapVersion soapVersion = wsaContainer.getOperation().getInterface().getSoapVersion();
//      XmlObject xmlContentObject = XmlObject.Factory.parse( content );
            XmlObject xmlContentObject = XmlUtils.createXmlObject(content);
            Element header = (Element) SoapUtils.getHeaderElement(xmlContentObject, soapVersion, true).getDomNode();

            NodeList headerProps = XmlUtils.getChildElements(header);
View Full Code Here

        String requestMessageId = null;
        try {
            // XmlObject xmlObject = XmlObject.Factory.parse(
            // messageExchange.getRequestContent() );
            XmlObject xmlObject = XmlUtils.createXmlObject(messageExchange.getRequestContent());
            SoapVersion soapVersion = messageExchange.getOperation().getInterface().getSoapVersion();

            Element header = (Element) SoapUtils.getHeaderElement(xmlObject, soapVersion, true).getDomNode();
            Element msgNode = XmlUtils.getFirstChildElementNS(header, wsaVersionNameSpace, "MessageID");
            if (msgNode != null) {
                requestMessageId = XmlUtils.getElementText(msgNode);
View Full Code Here

    public static NodeList getRequestReplyToRefProps(WsdlMessageExchange messageExchange, String wsaVersionNameSpace) {
        try {
            // XmlObject xmlObject = XmlObject.Factory.parse(
            // messageExchange.getRequestContent() );
            XmlObject xmlObject = XmlUtils.createXmlObject(messageExchange.getRequestContent());
            SoapVersion soapVersion = messageExchange.getOperation().getInterface().getSoapVersion();

            Element header = (Element) SoapUtils.getHeaderElement(xmlObject, soapVersion, true).getDomNode();
            Element replyToNode = XmlUtils.getFirstChildElementNS(header, wsaVersionNameSpace, "ReplyTo");
            Element replyRefParamsNode = XmlUtils.getFirstChildElementNS(replyToNode, wsaVersionNameSpace,
                    "ReferenceParameters");
View Full Code Here

    }

    public static NodeList getRequestFaultToRefProps(WsdlMessageExchange messageExchange, String wsaVersionNameSpace) {
        try {
            XmlObject xmlObject = XmlUtils.createXmlObject(messageExchange.getRequestContent());
            SoapVersion soapVersion = messageExchange.getOperation().getInterface().getSoapVersion();

            Element header = (Element) SoapUtils.getHeaderElement(xmlObject, soapVersion, true).getDomNode();
            Element faultToNode = XmlUtils.getFirstChildElementNS(header, wsaVersionNameSpace, "FaultTo");
            Element faultRefParamsNode = XmlUtils.getFirstChildElementNS(faultToNode, wsaVersionNameSpace,
                    "ReferenceParameters");
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.wsdl.support.soap.SoapVersion

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.