axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r353972 [2/2] - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/transport/http/ core/webapp/ integration/itest/org/apache/axis2/rest/ integration/itest/test/interop/mtom/ integration/src/test/interop/sun/round4/complex/ ...
Date Mon, 05 Dec 2005 03:51:19 GMT
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/processingModel/SoapProcessingModelTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/processingModel/SoapProcessingModelTest.java?rev=353972&r1=353971&r2=353972&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/processingModel/SoapProcessingModelTest.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/processingModel/SoapProcessingModelTest.java
Sun Dec  4 19:49:59 2005
@@ -88,7 +88,8 @@
             Options options = new Options();
             inOutMC.setClientOptions(options);
             options.setTo(targetEPR);
-            options.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP,
false);
+            options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+            options.setUseSeparateListener(false);
 
             MessageContext result =
                     inOutMC.invokeBlocking(

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java?rev=353972&r1=353971&r2=353972&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/MultirefTest.java
Sun Dec  4 19:49:59 2005
@@ -130,7 +130,8 @@
         Options options = new Options();
         call.setClientOptions(options);
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         SOAPEnvelope env = call.invokeBlocking("echoString", envelope);
         assertEquals(env.getBody().getFirstElement().getFirstElement().getText(), "hello
Axis2");
@@ -171,9 +172,8 @@
         Options options = new Options();
         call.setClientOptions(options);
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
         SOAPEnvelope env = call.invokeBlocking("add", envelope);
         assertEquals(env.getBody().getFirstElement().getFirstElement().getText(), "20");
     }
@@ -206,9 +206,8 @@
         Options options = new Options();
         call.setClientOptions(options);
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         SOAPEnvelope env = call.invokeBlocking("add", envelope);
         assertEquals(env.getBody().getFirstElement().getFirstElement().getText(), "20");
@@ -250,9 +249,8 @@
             Options options = new Options();
             call.setClientOptions(options);
             options.setTo(targetEPR);
-            options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                    Constants.TRANSPORT_HTTP,
-                    false);
+            options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+            options.setUseSeparateListener(false);
             call.invokeBlocking("add", envelope);
             fail("This should fail with : " + "org.apache.axis2.AxisFault: Invalid reference
:2");
         } catch (AxisFault axisFault) {
@@ -303,9 +301,8 @@
         Options options = new Options();
         call.setClientOptions(options);
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
         SOAPEnvelope env = call.invokeBlocking("editBean", envelope);
         OMElement response = env.getBody().getFirstElement();
         MyBean resBean = (MyBean) BeanSerializerUtil.deserialize(MyBean.class, response.getFirstElement());
@@ -353,9 +350,8 @@
         Options options = new Options();
         call.setClientOptions(options);
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         SOAPEnvelope env = call.invokeBlocking("beanOM", envelope);
         OMElement response = env.getBody().getFirstElement();
@@ -406,7 +402,8 @@
         Options options = new Options();
         call.setClientOptions(options);
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
         SOAPEnvelope env = call.invokeBlocking("omrefs", envelope);
         OMElement response = env.getBody().getFirstElement();
 
@@ -469,9 +466,8 @@
         Options options = new Options();
         call.setClientOptions(options);
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
         SOAPEnvelope env = call.invokeBlocking("echoEmployee", envelope);
         Employee emp = (Employee) BeanSerializerUtil.deserialize(Employee.class, env.getBody().getFirstElement().getFirstElement());
         assertNotNull(emp);
@@ -523,9 +519,8 @@
         Options options = new Options();
         call.setClientOptions(options);
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         SOAPEnvelope env = call.invokeBlocking("handleArrayList", envelope);
         assertEquals(env.getBody().getFirstElement().getFirstElement().getText(), "abcdefghiklm10");

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java?rev=353972&r1=353971&r2=353972&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/rpc/RPCCallTest.java
Sun Dec  4 19:49:59 2005
@@ -101,9 +101,8 @@
 
         Options options = new Options();
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         RPCCall call = new RPCCall(clientHome);
         call.setClientOptions(options);
@@ -154,9 +153,8 @@
 
         Options options = new Options();
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         RPCCall call =
                 new RPCCall("target/test-resources/integrationRepo");
@@ -189,9 +187,8 @@
 
         Options options = new Options();
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         RPCCall call =
                 new RPCCall("target/test-resources/integrationRepo");
@@ -209,9 +206,8 @@
 
         Options options = new Options();
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         RPCCall call =
                 new RPCCall("target/test-resources/integrationRepo");
@@ -232,9 +228,8 @@
 
         Options options = new Options();
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
         call.setClientOptions(options);
         ArrayList args = new ArrayList();
         args.add("100");
@@ -253,9 +248,8 @@
         Options options = new Options();
         call.setClientOptions(options);
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         ArrayList args = new ArrayList();
         args.add("10");
@@ -272,10 +266,8 @@
 
         Options options = new Options();
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
-
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
         call.setClientOptions(options);
 
         ArrayList args = new ArrayList();
@@ -292,9 +284,8 @@
         Options options = new Options();
 
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         RPCCall call =
                 new RPCCall("target/test-resources/integrationRepo");
@@ -312,9 +303,8 @@
 
         Options options = new Options();
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         RPCCall call =
                 new RPCCall("target/test-resources/integrationRepo");
@@ -352,9 +342,8 @@
 
         Options options = new Options();
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         RPCCall call =
                 new RPCCall("target/test-resources/integrationRepo");
@@ -373,9 +362,8 @@
 
         Options options = new Options();
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         RPCCall call =
                 new RPCCall("target/test-resources/integrationRepo");
@@ -396,9 +384,8 @@
 
         Options options = new Options();
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         RPCCall call =
                 new RPCCall("target/test-resources/integrationRepo");
@@ -431,9 +418,8 @@
 
         Options options = new Options();
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         RPCCall call =
                 new RPCCall("target/test-resources/integrationRepo");
@@ -455,9 +441,8 @@
 
         Options options = new Options();
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         RPCCall call =
                 new RPCCall("target/test-resources/integrationRepo");
@@ -482,9 +467,8 @@
 
         Options options = new Options();
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         RPCCall call =
                 new RPCCall("target/test-resources/integrationRepo");
@@ -505,9 +489,8 @@
 
         Options options = new Options();
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         RPCCall call =
                 new RPCCall("target/test-resources/integrationRepo");

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/tcp/TCPEchoRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/tcp/TCPEchoRawXMLTest.java?rev=353972&r1=353971&r2=353972&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/tcp/TCPEchoRawXMLTest.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/tcp/TCPEchoRawXMLTest.java
Sun Dec  4 19:49:59 2005
@@ -117,9 +117,8 @@
         call.setClientOptions(options);
         options.setTo(targetEPR);
         call.engageModule(new QName(Constants.MODULE_ADDRESSING));
-        options.setTransportInfo(Constants.TRANSPORT_TCP,
-                Constants.TRANSPORT_TCP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_TCP);
+        options.setUseSeparateListener(false);
 
         Callback callback = new Callback() {
             public void onComplete(AsyncResult result) {
@@ -166,9 +165,8 @@
         call.setClientOptions(options);
         options.setTo(targetEPR);
         call.engageModule(new QName(Constants.MODULE_ADDRESSING));
-        options.setTransportInfo(Constants.TRANSPORT_TCP,
-                Constants.TRANSPORT_TCP,
-                false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_TCP);
+        options.setUseSeparateListener(false);
 
         OMElement result =
                 call.invokeBlocking(operationName.getLocalPart(),
@@ -199,9 +197,8 @@
         options.setTo(targetEPR);
         call.engageModule(new QName(Constants.MODULE_ADDRESSING));
         options.setAction(operationName.getLocalPart());
-        options.setTransportInfo(Constants.TRANSPORT_TCP,
-                Constants.TRANSPORT_TCP,
-                true);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_TCP);
+        options.setUseSeparateListener(true);
 
         OMElement result = call.invokeBlocking(
                 operationName.getLocalPart(), payloadElement);
@@ -221,7 +218,8 @@
         call.setClientOptions(options);
         options.setTo(targetEPR);
         options.setAction(operationName.getLocalPart());
-        options.setTransportInfo(Constants.TRANSPORT_TCP, Constants.TRANSPORT_TCP, false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_TCP);
+        options.setUseSeparateListener(false);
 
         OMFactory fac = OMAbstractFactory.getOMFactory();
 

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/tcp/TCPTwoChannelEchoRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/tcp/TCPTwoChannelEchoRawXMLTest.java?rev=353972&r1=353971&r2=353972&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/tcp/TCPTwoChannelEchoRawXMLTest.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/tcp/TCPTwoChannelEchoRawXMLTest.java
Sun Dec  4 19:49:59 2005
@@ -46,8 +46,8 @@
 public class TCPTwoChannelEchoRawXMLTest extends TestCase {
     private EndpointReference targetEPR =
             new EndpointReference("tcp://127.0.0.1:"
-            + (UtilServer.TESTING_PORT)
-            + "/axis/services/EchoXMLService/echoOMElement");
+                    + (UtilServer.TESTING_PORT)
+                    + "/axis/services/EchoXMLService/echoOMElement");
     private QName serviceName = new QName("EchoXMLService");
     private QName operationName = new QName("echoOMElement");
     private QName transportName = new QName("http://localhost/my",
@@ -73,7 +73,6 @@
     protected void setUp() throws Exception {
         UtilsTCPServer.start();
 
-        
         //create and deploy the service
         service =
                 Utils.createSimpleService(serviceName,
@@ -127,9 +126,8 @@
             Options options = new Options();
             call.setClientOptions(options);
             options.setTo(targetEPR);
-            options.setTransportInfo(Constants.TRANSPORT_TCP,
-                    Constants.TRANSPORT_TCP,
-                    true);
+            options.setListenerTransportProtocol(Constants.TRANSPORT_TCP);
+            options.setUseSeparateListener(true);
             options.setAction(operationName.getLocalPart());
             Callback callback = new Callback() {
                 public void onComplete(AsyncResult result) {

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java?rev=353972&r1=353971&r2=353972&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
Sun Dec  4 19:49:59 2005
@@ -49,7 +49,7 @@
         try {
             OMElement envelope = ((SOAPEnvelopeImpl) request.getSOAPPart()
                     .getEnvelope()).getOMEnvelope();
-            
+
             //parse the omEnvelope element and stuff it with the attachment
             //specific omText nodes
             insertAttachmentNodes(envelope, request);
@@ -59,20 +59,19 @@
 
             Options options = new Options();
             options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
-            options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                    Constants.TRANSPORT_HTTP,
-                    false);
+            options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+            options.setUseSeparateListener(false);
             options.setTo(
                     new EndpointReference(url.toString()));
             call.setClientOptions(options);
 
             String axisOp = request.getSOAPBody().getFirstChild().getNodeName();
-            NodeImpl bodyContentNode = (NodeImpl)request.getSOAPBody().getFirstChild();
-            OMElement bodyContent = (OMElement)bodyContentNode.getOMNode();
+            NodeImpl bodyContentNode = (NodeImpl) request.getSOAPBody().getFirstChild();
+            OMElement bodyContent = (OMElement) bodyContentNode.getOMNode();
             OMElement result = call.invokeBlocking(axisOp, bodyContent);
-            org.apache.axis2.soap.SOAPEnvelope responseEnv = (org.apache.axis2.soap.SOAPEnvelope)
((OMElement)result.getParent()).getParent(); 
+            org.apache.axis2.soap.SOAPEnvelope responseEnv = (org.apache.axis2.soap.SOAPEnvelope)
((OMElement) result.getParent()).getParent();
             SOAPEnvelopeImpl response = new SOAPEnvelopeImpl(responseEnv);
-            
+
             SOAPMessageImpl sMsg = new SOAPMessageImpl(response);
             extractAttachmentNodes(responseEnv, sMsg);
             return sMsg;
@@ -92,67 +91,70 @@
         // TODO Auto-generated method stub
 
     }
-    
+
     /**
      * This method recursively stuffs the OMElement with appropriate OMText nodes
      * that are prepared out of attachment contents whereever those attachments are referenced
+     *
      * @param element
      * @param soapMsg
      */
     private void insertAttachmentNodes(OMElement element, SOAPMessage soapMsg) throws SOAPException
{
-    	Iterator childIter = element.getChildElements();
-    	while(childIter.hasNext()) {
-    		OMElement child = (OMElement)childIter.next();
-    		//check if there is an href attribute
-    		OMAttribute hrefAttr = (OMAttribute)child.getFirstAttribute(new QName("href"));
-    		String hrefContentId = validateHref(hrefAttr);
-    		
-    		if (hrefContentId!=null) {//This is an element referencing an attachment!
-    			OMText omText = getOMTextForReferencedAttachment(hrefContentId, soapMsg);
-    			child.build();
-    			child.removeAttribute(hrefAttr);
-    			child.addChild(omText);
-    			
-    		} else { //possibly there can be references in the children of this element
-    				 //so recurse through.
-    			insertAttachmentNodes(child, soapMsg);
-    		}
-    	}
+        Iterator childIter = element.getChildElements();
+        while (childIter.hasNext()) {
+            OMElement child = (OMElement) childIter.next();
+            //check if there is an href attribute
+            OMAttribute hrefAttr = (OMAttribute) child.getFirstAttribute(new QName("href"));
+            String hrefContentId = validateHref(hrefAttr);
+
+            if (hrefContentId != null) {//This is an element referencing an attachment!
+                OMText omText = getOMTextForReferencedAttachment(hrefContentId, soapMsg);
+                child.build();
+                child.removeAttribute(hrefAttr);
+                child.addChild(omText);
+
+            } else { //possibly there can be references in the children of this element
+                //so recurse through.
+                insertAttachmentNodes(child, soapMsg);
+            }
+        }
     }
-    
+
     /**
      * The method recursively looks for the binary text nodes and adds them as attachment
      * to soapMessage at the same time removing them from soapEnv and putting appropriate
      * contentId
+     *
      * @param element
      * @param soapMsg
      */
-    private void extractAttachmentNodes(OMElement element, SOAPMessage soapMsg){
-    	Iterator childIter = element.getChildren();
-    	while(childIter.hasNext()) {
-    		OMNode child = (OMNode)childIter.next();
-    		if(child instanceof OMText){
-    			OMText binaryNode = (OMText)child;
-    			DataHandler actualDH = (DataHandler)binaryNode.getDataHandler();
-    			if(actualDH != null){
-    				AttachmentPart ap = soapMsg.createAttachmentPart(actualDH);
-    				String contentId = SessionUtils.generateSessionId();
-    				ap.setContentId(contentId);
-    				ap.setContentType(actualDH.getContentType());
-    				OMElement parent = (OMElement)child.getParent();
-    				OMAttribute attr = org.apache.axis2.om.OMAbstractFactory.getOMFactory().createOMAttribute("href",
null,"cid:"+contentId);
-    				parent.addAttribute(attr);
-    				binaryNode.detach();
-    				soapMsg.addAttachmentPart(ap);
-    			}
-    		} else{
-				if(child instanceof OMElement) {
-					OMElement childElement = (OMElement)child;
-					extractAttachmentNodes(childElement, soapMsg);
-				}
-    		}
-    	}
+    private void extractAttachmentNodes(OMElement element, SOAPMessage soapMsg) {
+        Iterator childIter = element.getChildren();
+        while (childIter.hasNext()) {
+            OMNode child = (OMNode) childIter.next();
+            if (child instanceof OMText) {
+                OMText binaryNode = (OMText) child;
+                DataHandler actualDH = (DataHandler) binaryNode.getDataHandler();
+                if (actualDH != null) {
+                    AttachmentPart ap = soapMsg.createAttachmentPart(actualDH);
+                    String contentId = SessionUtils.generateSessionId();
+                    ap.setContentId(contentId);
+                    ap.setContentType(actualDH.getContentType());
+                    OMElement parent = (OMElement) child.getParent();
+                    OMAttribute attr = org.apache.axis2.om.OMAbstractFactory.getOMFactory().createOMAttribute("href",
null, "cid:" + contentId);
+                    parent.addAttribute(attr);
+                    binaryNode.detach();
+                    soapMsg.addAttachmentPart(ap);
+                }
+            } else {
+                if (child instanceof OMElement) {
+                    OMElement childElement = (OMElement) child;
+                    extractAttachmentNodes(childElement, soapMsg);
+                }
+            }
+        }
     }
+
     /**
      * This method checks the value of attribute and if it is a valid CID then
      * returns the contentID (with cid: prefix stripped off) or else returns null.
@@ -160,39 +162,40 @@
      * referencing attribute
      */
     private String validateHref(OMAttribute attr) {
-    	String contentId;
-    	if(attr!=null) {
-    		contentId = attr.getAttributeValue();
-    	} else {
-    		return null;
-    	}
-    	
-    	if (contentId.startsWith("cid:")) {
-    		contentId = contentId.substring(4);
-    		return contentId;
-    	}
-    	return null;
+        String contentId;
+        if (attr != null) {
+            contentId = attr.getAttributeValue();
+        } else {
+            return null;
+        }
+
+        if (contentId.startsWith("cid:")) {
+            contentId = contentId.substring(4);
+            return contentId;
+        }
+        return null;
     }
-    
+
     /**
      * This method looks up the attachment part corresponding to the given contentId and
      * returns the OMText node thta has the content of the attachment.
+     *
      * @param contentId
      * @param soapMsg
      * @return
      */
-    private OMText getOMTextForReferencedAttachment(String contentId, SOAPMessage soapMsg)
throws SOAPException{
-    	Iterator attachIter = soapMsg.getAttachments();
-		while(attachIter.hasNext()) {
-			AttachmentPart attachment = (AttachmentPart)attachIter.next();
-			if(attachment.getContentId().equals(contentId)) {
-				try {
-					return ((AttachmentPartImpl)attachment).getOMText();
-				} catch (Exception e) {
-					throw new SOAPException(e);
-				}
-			}
-		}
-    	throw new SOAPException("No attachment found with the given contentID");
+    private OMText getOMTextForReferencedAttachment(String contentId, SOAPMessage soapMsg)
throws SOAPException {
+        Iterator attachIter = soapMsg.getAttachments();
+        while (attachIter.hasNext()) {
+            AttachmentPart attachment = (AttachmentPart) attachIter.next();
+            if (attachment.getContentId().equals(contentId)) {
+                try {
+                    return ((AttachmentPartImpl) attachment).getOMText();
+                } catch (Exception e) {
+                    throw new SOAPException(e);
+                }
+            }
+        }
+        throw new SOAPException("No attachment found with the given contentID");
     }
 }

Modified: webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java?rev=353972&r1=353971&r2=353972&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java
(original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableCreateQueue.java
Sun Dec  4 19:49:59 2005
@@ -76,9 +76,8 @@
             Options options = new Options();
             options.setTo(new EndpointReference(url));
             options.setSoapAction("http://soap.amazon.com");
-            options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                    Constants.TRANSPORT_HTTP,
-                    false);
+            options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+            options.setUseSeparateListener(false);
             call.setClientOptions(options);
             call.invokeNonBlocking(operation, element, specificCallbackObject);
         } catch (AxisFault axisFault) {

Modified: webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableDeleteQueue.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableDeleteQueue.java?rev=353972&r1=353971&r2=353972&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableDeleteQueue.java
(original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableDeleteQueue.java
Sun Dec  4 19:49:59 2005
@@ -66,9 +66,8 @@
             call.setClientOptions(options);
             options.setSoapAction("http://soap.amazon.com");
             options.setTo(new EndpointReference(url));
-            options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                    Constants.TRANSPORT_HTTP,
-                    false);
+            options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+            options.setUseSeparateListener(false);
             call.invokeNonBlocking(operation, element, specificCallbackObject);
         } catch (AxisFault axisFault) {
             axisFault.printStackTrace();

Modified: webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableListMyQueues.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableListMyQueues.java?rev=353972&r1=353971&r2=353972&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableListMyQueues.java
(original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableListMyQueues.java
Sun Dec  4 19:49:59 2005
@@ -66,10 +66,9 @@
             call.setClientOptions(options);
             options.setSoapAction("http://soap.amazon.com");
             options.setTo(new EndpointReference(url));
-            options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                    Constants.TRANSPORT_HTTP,
-                    false);
-            
+            options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+            options.setUseSeparateListener(false);
+
             call.invokeNonBlocking(operation, element, specificCallbackObject);
         } catch (AxisFault axisFault) {
             axisFault.printStackTrace();

Modified: webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableReadQueue.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableReadQueue.java?rev=353972&r1=353971&r2=353972&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableReadQueue.java
(original)
+++ webservices/axis2/trunk/java/modules/samples/src/sample/amazon/amazonSimpleQueueService/util/RunnableReadQueue.java
Sun Dec  4 19:49:59 2005
@@ -61,7 +61,8 @@
             Options options = new Options();
             options.setSoapAction("http://soap.amazon.com");
             options.setTo(new EndpointReference(url));
-            options.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP,
false);
+            options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+            options.setUseSeparateListener(false);
 
             Call call = new Call();
             call.setClientOptions(options);

Modified: webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingWsaBasedClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingWsaBasedClient.java?rev=353972&r1=353971&r2=353972&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingWsaBasedClient.java
(original)
+++ webservices/axis2/trunk/java/modules/samples/src/userguide/clients/EchoBlockingWsaBasedClient.java
Sun Dec  4 19:49:59 2005
@@ -49,8 +49,8 @@
         Options options = new Options();
         call.setClientOptions(options);
         options.setTo(targetEPR);
-        options.setTransportInfo(Constants.TRANSPORT_HTTP,
-                Constants.TRANSPORT_HTTP, false);
+        options.setListenerTransportProtocol(Constants.TRANSPORT_HTTP);
+        options.setUseSeparateListener(false);
 
         //Blocking invocation via wsa mapping
         options.setAction("urn:sample/echo");



Mime
View raw message