Package org.apache.soap.transport

Examples of org.apache.soap.transport.SOAPTransport


      if (this.getHeaderManager() != null){
        this.getHeaderManager().setSOAPHeader(spconn);
      }

            SOAPTransport st = msg.getSOAPTransport();
            BufferedReader br = st.receive();
            RESULT.setDataType(SampleResult.TEXT);
            if (this.getPropertyAsBoolean(READ_RESPONSE))
            {
                StringBuffer buf = new StringBuffer();
                String line;
                while ((line = br.readLine()) != null)
                {
                    buf.append(line);
                }
                RESULT.sampleEnd();
                // set the response
                RESULT.setResponseData(buf.toString().getBytes());
            }
            else
            {
                // by not reading the response
                // for real, it improves the
                // performance on slow clients
                br.read();
        RESULT.sampleEnd();
                RESULT.setResponseData(
                    JMeterUtils
                        .getResString("read_response_message")
                        .getBytes());
            }
            RESULT.setSuccessful(true);
            // 1-22-04 updated the sampler so that when read
            // response is set, it also sets SamplerData with
            // the XML message, so users can see what was
            // sent. if read response is not checked, it will
            // not set sampler data with the request message.
            // peter lin.
            RESULT.setSamplerData(
                getUrl().getProtocol()
                    + "://"
                    + getUrl().getHost()
                    + "/"
                    + getUrl().getFile()
                    + "\n"
                    + FILE_CONTENTS);
            RESULT.setDataEncoding(
                st.getResponseSOAPContext().getContentType());
            // setting this is just a formality, since
            // soap will return a descriptive error
            // message, soap errors within the response
            // are preferred.
            RESULT.setResponseCode("200");
View Full Code Here


        Call call = portInstance.getCall();

        call.setEncodingStyleURI(getInputEncodingStyle());

        SOAPTransport st = getTransport();
        if (st != null) {
            call.setSOAPTransport(st);
            if (st instanceof SOAPJMSConnection) {
              SOAPJMSConnection sjt = (SOAPJMSConnection) st;
              sjt.setSyncTimeout(WSIFProperties.getSyncTimeout());
View Full Code Here

        URL url = portInstance.getEndPoint();
        Envelope env = null;
        msgBody.setBodyEntries(vect);
        msgEnv.setBody(msgBody);

        SOAPTransport st = getTransport();

        if (st instanceof SOAPJMSConnection) {
           SOAPJMSConnection sjt = (SOAPJMSConnection) st;
           sjt.setSyncTimeout(WSIFProperties.getSyncTimeout());
           sjt.setAsyncTimeout(WSIFProperties.getAsyncTimeout());
View Full Code Here

     * Gets the transport being used by this operation
     * @return the current transport
     */
    public SOAPTransport getTransport() {
        Trc.entry(this);
        SOAPTransport t = portInstance.getSOAPTransport();
        Trc.exit(t);
        return t;
    }
View Full Code Here

     * Sets the HTTP header value if the underlying transport
     * is the SOAP HTTP transport. The only support HTTP headers
     * are the basic authentication user id and password.
     */
    private void addHTTPHeader(Call call, String name, String value) {
        SOAPTransport st = call.getSOAPTransport();
        if (st instanceof SOAPHTTPConnection) {
            SOAPHTTPConnection httpTransport = (SOAPHTTPConnection) st;
            if (name.equals(WSIFConstants.CONTEXT_HTTP_USER)) {
                httpTransport.setUserName(value);
            } else if (name.equals(WSIFConstants.CONTEXT_HTTP_PSWD)) {
View Full Code Here

      if (this.getHeaderManager() != null) {
        this.getHeaderManager().setSOAPHeader(spconn);
      }

      SOAPTransport st = msg.getSOAPTransport();
      result.setDataType(SampleResult.TEXT);
      BufferedReader br = null;
      // check to see if SOAPTransport is not nul and receive is
      // also not null. hopefully this will improve the error
      // reporting. 5/13/05 peter lin
      if (st != null && st.receive() != null) {
        br = st.receive();
        if (getReadResponse()) {
          StringWriter sw = new StringWriter();
          IOUtils.copy(br, sw);
          result.sampleEnd();
          // set the response
          result.setResponseData(sw.toString().getBytes());
        } else {
          // by not reading the response
          // for real, it improves the
          // performance on slow clients
          br.read();
          result.sampleEnd();
          result.setResponseData(JMeterUtils.getResString("read_response_message").getBytes()); //$NON-NLS-1$
        }
        result.setSuccessful(true);
        result.setResponseCodeOK();
        result.setResponseHeaders(this.convertSoapHeaders(st.getHeaders()));
      } else {
        result.sampleEnd();
        result.setSuccessful(false);
        if (st != null){
            result.setResponseData(st.getResponseSOAPContext().getContentType().getBytes());
        }
        result.setResponseHeaders("error");
      }
      // 1-22-04 updated the sampler so that when read
      // response is set, it also sets SamplerData with
      // the XML message, so users can see what was
      // sent. if read response is not checked, it will
      // not set sampler data with the request message.
      // peter lin.
            // Removed URL, as that is already stored elsewere
      result.setSamplerData(fileContents);// WARNING - could be large
      if (st!= null){
          result.setEncodingAndType(st.getResponseSOAPContext().getContentType());
      }
      // setting this is just a formality, since
      // soap will return a descriptive error
      // message, soap errors within the response
      // are preferred.
View Full Code Here

      if (this.getHeaderManager() != null) {
        this.getHeaderManager().setSOAPHeader(spconn);
      }

      SOAPTransport st = msg.getSOAPTransport();
      RESULT.setDataType(SampleResult.TEXT);
      BufferedReader br = null;
      // check to see if SOAPTransport is not nul and receive is
      // also not null. hopefully this will improve the error
      // reporting. 5/13/05 peter lin
      if (st != null && st.receive() != null) {
        br = st.receive();
        if (this.getPropertyAsBoolean(READ_RESPONSE)) {
          StringBuffer buf = new StringBuffer();
          String line;
          while ((line = br.readLine()) != null) {
            buf.append(line);
          }
          RESULT.sampleEnd();
          // set the response
          RESULT.setResponseData(buf.toString().getBytes());
        } else {
          // by not reading the response
          // for real, it improves the
          // performance on slow clients
          br.read();
          RESULT.sampleEnd();
          RESULT.setResponseData(JMeterUtils.getResString("read_response_message").getBytes());
        }
        RESULT.setSuccessful(true);
        RESULT.setResponseCode("200");
        RESULT.setResponseHeaders(this.convertSoapHeaders(st.getHeaders()));
      } else {
        RESULT.setSuccessful(false);
        RESULT.setResponseData(st.getResponseSOAPContext().getContentType().getBytes());
        RESULT.setResponseCode("000");
        RESULT.setResponseHeaders("error");
      }
      // 1-22-04 updated the sampler so that when read
      // response is set, it also sets SamplerData with
      // the XML message, so users can see what was
      // sent. if read response is not checked, it will
      // not set sampler data with the request message.
      // peter lin.
      RESULT.setSamplerData(getUrl().getProtocol() + "://" + getUrl().getHost() + "/" + getUrl().getFile() + "\n"
          + FILE_CONTENTS);
      RESULT.setDataEncoding(st.getResponseSOAPContext().getContentType());
      // setting this is just a formality, since
      // soap will return a descriptive error
      // message, soap errors within the response
      // are preferred.
      if (br != null) {
View Full Code Here

      if (this.getHeaderManager() != null) {
        this.getHeaderManager().setSOAPHeader(spconn);
      }

      SOAPTransport st = msg.getSOAPTransport();
      result.setDataType(SampleResult.TEXT);
      BufferedReader br = null;
      // check to see if SOAPTransport is not nul and receive is
      // also not null. hopefully this will improve the error
      // reporting. 5/13/05 peter lin
      if (st != null && st.receive() != null) {
        br = st.receive();
        if (getReadResponse()) {
          StringBuffer buf = new StringBuffer();
          String line;
          while ((line = br.readLine()) != null) {
            buf.append(line);
          }
          result.sampleEnd();
          // set the response
          result.setResponseData(buf.toString().getBytes());
        } else {
          // by not reading the response
          // for real, it improves the
          // performance on slow clients
          br.read();
          result.sampleEnd();
          result.setResponseData(JMeterUtils.getResString("read_response_message").getBytes()); //$NON-NLS-1$
        }
        result.setSuccessful(true);
        result.setResponseCodeOK();
        result.setResponseHeaders(this.convertSoapHeaders(st.getHeaders()));
      } else {
        result.sampleEnd();
        result.setSuccessful(false);
        if (st != null){
            result.setResponseData(st.getResponseSOAPContext().getContentType().getBytes());
        }
        result.setResponseHeaders("error");
      }
      // 1-22-04 updated the sampler so that when read
      // response is set, it also sets SamplerData with
      // the XML message, so users can see what was
      // sent. if read response is not checked, it will
      // not set sampler data with the request message.
      // peter lin.
            // Removed URL, as that is already stored elsewere
      result.setSamplerData(fileContents);// WARNING - could be large
      result.setEncodingAndType(st.getResponseSOAPContext().getContentType());
      // setting this is just a formality, since
      // soap will return a descriptive error
      // message, soap errors within the response
      // are preferred.
      if (br != null) {
View Full Code Here

      if (this.getHeaderManager() != null) {
        this.getHeaderManager().setSOAPHeader(spconn);
      }

      SOAPTransport st = msg.getSOAPTransport();
      result.setDataType(SampleResult.TEXT);
      BufferedReader br = null;
      // check to see if SOAPTransport is not nul and receive is
      // also not null. hopefully this will improve the error
      // reporting. 5/13/05 peter lin
      if (st != null && st.receive() != null) {
        br = st.receive();
        if (getReadResponse()) {
          StringBuffer buf = new StringBuffer();
          String line;
          while ((line = br.readLine()) != null) {
            buf.append(line);
          }
          result.sampleEnd();
          // set the response
          result.setResponseData(buf.toString().getBytes());
        } else {
          // by not reading the response
          // for real, it improves the
          // performance on slow clients
          br.read();
          result.sampleEnd();
          result.setResponseData(JMeterUtils.getResString("read_response_message").getBytes()); //$NON-NLS-1$
        }
        result.setSuccessful(true);
        result.setResponseCodeOK();
        result.setResponseHeaders(this.convertSoapHeaders(st.getHeaders()));
      } else {
        result.sampleEnd();
        result.setSuccessful(false);
        if (st != null){
            result.setResponseData(st.getResponseSOAPContext().getContentType().getBytes());
        }
        result.setResponseHeaders("error");
      }
      // 1-22-04 updated the sampler so that when read
      // response is set, it also sets SamplerData with
      // the XML message, so users can see what was
      // sent. if read response is not checked, it will
      // not set sampler data with the request message.
      // peter lin.
            // Removed URL, as that is already stored elsewere
      result.setSamplerData(fileContents);// WARNING - could be large
      result.setEncodingAndType(st.getResponseSOAPContext().getContentType());
      // setting this is just a formality, since
      // soap will return a descriptive error
      // message, soap errors within the response
      // are preferred.
      if (br != null) {
View Full Code Here

      if (this.getHeaderManager() != null) {
        this.getHeaderManager().setSOAPHeader(spconn);
      }

      SOAPTransport st = msg.getSOAPTransport();
      RESULT.setDataType(SampleResult.TEXT);
      BufferedReader br = null;
      // check to see if SOAPTransport is not nul and receive is
      // also not null. hopefully this will improve the error
      // reporting. 5/13/05 peter lin
      if (st != null && st.receive() != null) {
        br = st.receive();
        if (this.getPropertyAsBoolean(READ_RESPONSE)) {
          StringBuffer buf = new StringBuffer();
          String line;
          while ((line = br.readLine()) != null) {
            buf.append(line);
          }
          RESULT.sampleEnd();
          // set the response
          RESULT.setResponseData(buf.toString().getBytes());
        } else {
          // by not reading the response
          // for real, it improves the
          // performance on slow clients
          br.read();
          RESULT.sampleEnd();
          RESULT.setResponseData(JMeterUtils.getResString("read_response_message").getBytes());
        }
        RESULT.setSuccessful(true);
        RESULT.setResponseCode("200");
        RESULT.setResponseHeaders(this.convertSoapHeaders(st.getHeaders()));
      } else {
        RESULT.setSuccessful(false);
        RESULT.setResponseData(st.getResponseSOAPContext().getContentType().getBytes());
        RESULT.setResponseCode("000");
        RESULT.setResponseHeaders("error");
      }
      // 1-22-04 updated the sampler so that when read
      // response is set, it also sets SamplerData with
      // the XML message, so users can see what was
      // sent. if read response is not checked, it will
      // not set sampler data with the request message.
      // peter lin.
      RESULT.setSamplerData(getUrl().getProtocol() + "://" + getUrl().getHost() + "/" + getUrl().getFile() + "\n"
          + FILE_CONTENTS);
      RESULT.setDataEncoding(st.getResponseSOAPContext().getContentType());
      // setting this is just a formality, since
      // soap will return a descriptive error
      // message, soap errors within the response
      // are preferred.
      if (br != null) {
View Full Code Here

TOP

Related Classes of org.apache.soap.transport.SOAPTransport

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.