Author: antelder
Date: Wed Nov 22 15:15:44 2006
New Revision: 478371

URL: http://svn.apache.org/viewvc?view=rev&rev=478371
Log:
Fix sample 8 response to not have envelope and body elements nested inside the 
soap body

Modified:
    
incubator/synapse/trunk/java/modules/samples/src/main/java/samples/common/StockQuoteHandler.java
    
incubator/synapse/trunk/java/modules/samples/src/main/java/samples/common/Util.java

Modified: 
incubator/synapse/trunk/java/modules/samples/src/main/java/samples/common/StockQuoteHandler.java
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/src/main/java/samples/common/StockQuoteHandler.java?view=diff&rev=478371&r1=478370&r2=478371
==============================================================================
--- 
incubator/synapse/trunk/java/modules/samples/src/main/java/samples/common/StockQuoteHandler.java
 (original)
+++ 
incubator/synapse/trunk/java/modules/samples/src/main/java/samples/common/StockQuoteHandler.java
 Wed Nov 22 15:15:44 2006
@@ -122,21 +122,16 @@
      * @return
      * @throws javax.xml.stream.XMLStreamException
      *
-     *  <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
-     *  <soap:Body>
      *      <CheckPriceResponse xmlns="http://ws.invesbot.com/"; >
      *          <Code>IBM</Code>
      *          <Price>82.90</Price>
      *      </CheckPriceResponse>
-     *  </soap:Body>
-     *  </soap:Envelope>
      */
     public static String parseCustomResponsePayload(OMElement result) throws 
Exception {
 
-        OMElement chkPResp = result.getFirstChildWithName(
-            new QName("http://www.apache-synapse.org/test";, 
"CheckPriceResponse"));
-        if (chkPResp != null) {
-            OMElement price = chkPResp.getFirstChildWithName(new 
QName("http://www.apache-synapse.org/test";, "Price"));
+        OMElement price = result.getFirstChildWithName(
+            new QName("http://www.apache-synapse.org/test";, "Price"));
+        if (price != null) {
             return price.getText();
         } else {
             throw new Exception("Unexpected response : " + result);

Modified: 
incubator/synapse/trunk/java/modules/samples/src/main/java/samples/common/Util.java
URL: 
http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/src/main/java/samples/common/Util.java?view=diff&rev=478371&r1=478370&r2=478371
==============================================================================
--- 
incubator/synapse/trunk/java/modules/samples/src/main/java/samples/common/Util.java
 (original)
+++ 
incubator/synapse/trunk/java/modules/samples/src/main/java/samples/common/Util.java
 Wed Nov 22 15:15:44 2006
@@ -91,7 +91,7 @@
             serviceClient.engageModule(new QName("addressing"));
             serviceClient.setOptions(options);
 
-            OMElement result = 
serviceClient.sendReceive(getQuote).getFirstElement();
+            OMElement result = serviceClient.sendReceive(getQuote);
             System.out.println("Custom :: Stock price = $" +
                 StockQuoteHandler.parseCustomResponsePayload(result));
 
@@ -126,7 +126,7 @@
 
             OMElement result = serviceClient.sendReceive(getQuote);
             System.out.println("Custom :: Stock price = $" +
-                
StockQuoteHandler.parseCustomResponsePayload(result.getFirstElement()));
+                StockQuoteHandler.parseCustomResponsePayload(result));
 
         } catch (Exception e) {
             e.printStackTrace();
@@ -159,7 +159,7 @@
 
             OMElement result = serviceClient.sendReceive(getQuote);
             System.out.println("Error :: Stock price = $" +
-                
StockQuoteHandler.parseCustomResponsePayload(result.getFirstElement()));
+                StockQuoteHandler.parseCustomResponsePayload(result));
 
         } catch (Exception e) {
             if (e instanceof AxisFault) {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to