You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by sn...@apache.org on 2002/12/03 22:16:52 UTC

cvs commit: xml-soap/java/samples/multiref GetCircularBean.java

snichol     2002/12/03 13:16:52

  Modified:    java/samples/multiref GetCircularBean.java
  Log:
  Add use of request/response copy buffers.
  
  Revision  Changes    Path
  1.2       +15 -0     xml-soap/java/samples/multiref/GetCircularBean.java
  
  Index: GetCircularBean.java
  ===================================================================
  RCS file: /home/cvs/xml-soap/java/samples/multiref/GetCircularBean.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- GetCircularBean.java	28 Jun 2002 02:33:16 -0000	1.1
  +++ GetCircularBean.java	3 Dec 2002 21:16:52 -0000	1.2
  @@ -65,6 +65,7 @@
   import org.apache.soap.encoding.*;
   import org.apache.soap.encoding.soapenc.*;
   import org.apache.soap.rpc.*;
  +import org.apache.soap.transport.http.SOAPHTTPConnection;
   
   /**
    * See \samples\multiref\readme for info.
  @@ -84,6 +85,13 @@
       SOAPMappingRegistry smr = new SOAPMappingRegistry();
       BeanMultiRefSerializer beanSer = new BeanMultiRefSerializer();
   
  +    // Set up debug buffers
  +    StringBuffer requestBuffer = new StringBuffer(1024);
  +    StringBuffer responseBuffer = new StringBuffer(1024);
  +    SOAPHTTPConnection shc = new SOAPHTTPConnection();
  +    shc.setRequestCopy(requestBuffer);
  +    shc.setResponseCopy(responseBuffer);
  +
       // Map the types.
       smr.mapTypes(Constants.NS_URI_SOAP_ENC,
                    new QName("urn:xml-soap-multiref-sample", "circularbean"),
  @@ -96,6 +104,7 @@
       call.setTargetObjectURI("urn:MultiRefSample");
       call.setMethodName("getCircularBean");
       call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
  +    call.setSOAPTransport(shc);
   
       Vector params = new Vector();
       call.setParams(params);
  @@ -123,5 +132,11 @@
   
         System.err.println("Generated fault: " + fault);
       }
  +
  +    // Display the request and response
  +    System.out.println("********** Request *********");
  +    System.out.println(shc.getRequestCopy().toString());
  +    System.out.println("********** Response *********");
  +    System.out.println(shc.getResponseCopy().toString());
     }
   }
  
  
  

--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>