You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2012/10/10 20:09:50 UTC

svn commit: r1396717 - in /axis/axis1/java/trunk: interop-mock/src/main/resources/whitemesa/soap12/test-doc/ interop/src/test/java/test/wsdl/soap12/assertion/

Author: veithen
Date: Wed Oct 10 18:09:50 2012
New Revision: 1396717

URL: http://svn.apache.org/viewvc?rev=1396717&view=rev
Log:
Fixed the T1, T2, T3 and T4 tests:
* They were assuming that Stub#getHeader returns a response header, but this is no longer true (response headers are not put back into the Stub instance).
* Instead of sending an empty body (as shown in the W3C spec), they were sending a body with an empty child element.
* T3 and T4 were not sending the role as described in the W3C spec (but they were expecting the right result).

Modified:
    axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T1-request.xml
    axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T2-request.xml
    axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T3-request.xml
    axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T3-response.xml
    axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T4-request.xml
    axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T4-response.xml
    axis/axis1/java/trunk/interop/src/test/java/test/wsdl/soap12/assertion/WhiteMesaSoap12TestSvcTestCase.java

Modified: axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T1-request.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T1-request.xml?rev=1396717&r1=1396716&r2=1396717&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T1-request.xml (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T1-request.xml Wed Oct 10 18:09:50 2012
@@ -3,7 +3,5 @@
    <soapenv:Header>
       <ns1:echoOk soapenv:role="http://www.w3.org/2003/05/soap-envelope/role/next" soapenv:mustUnderstand="false" xmlns:ns1="http://example.org/ts-tests">this is a test</ns1:echoOk>
    </soapenv:Header>
-   <soapenv:Body>
-      <emptyBody xmlns=""/>
-   </soapenv:Body>
+   <soapenv:Body/>
 </soapenv:Envelope>
\ No newline at end of file

Modified: axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T2-request.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T2-request.xml?rev=1396717&r1=1396716&r2=1396717&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T2-request.xml (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T2-request.xml Wed Oct 10 18:09:50 2012
@@ -3,7 +3,5 @@
    <soapenv:Header>
       <ns1:echoOk soapenv:role="http://example.org/ts-tests/C" soapenv:mustUnderstand="false" xmlns:ns1="http://example.org/ts-tests">this is a test</ns1:echoOk>
    </soapenv:Header>
-   <soapenv:Body>
-      <emptyBody xmlns=""/>
-   </soapenv:Body>
+   <soapenv:Body/>
 </soapenv:Envelope>
\ No newline at end of file

Modified: axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T3-request.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T3-request.xml?rev=1396717&r1=1396716&r2=1396717&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T3-request.xml (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T3-request.xml Wed Oct 10 18:09:50 2012
@@ -1,9 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
-      <ns1:echoOk soapenv:role="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="false" xmlns:ns1="http://example.org/ts-tests">this is a test</ns1:echoOk>
+      <ns1:echoOk soapenv:mustUnderstand="false" xmlns:ns1="http://example.org/ts-tests">this is a test</ns1:echoOk>
    </soapenv:Header>
-   <soapenv:Body>
-      <emptyBody xmlns=""/>
-   </soapenv:Body>
+   <soapenv:Body/>
 </soapenv:Envelope>
\ No newline at end of file

Modified: axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T3-response.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T3-response.xml?rev=1396717&r1=1396716&r2=1396717&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T3-response.xml (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T3-response.xml Wed Oct 10 18:09:50 2012
@@ -1,4 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope">
+   <SOAP-ENV:Header>
+      <test:responseOk xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:test="http://example.org/ts-tests">this is a test</test:responseOk>
+   </SOAP-ENV:Header>
    <SOAP-ENV:Body />
 </SOAP-ENV:Envelope>
\ No newline at end of file

Modified: axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T4-request.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T4-request.xml?rev=1396717&r1=1396716&r2=1396717&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T4-request.xml (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T4-request.xml Wed Oct 10 18:09:50 2012
@@ -1,9 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
-      <ns1:echoOk soapenv:role="" soapenv:mustUnderstand="false" xmlns:ns1="http://example.org/ts-tests">this is a test</ns1:echoOk>
+      <ns1:echoOk soapenv:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver" soapenv:mustUnderstand="false" xmlns:ns1="http://example.org/ts-tests">this is a test</ns1:echoOk>
    </soapenv:Header>
-   <soapenv:Body>
-      <emptyBody xmlns=""/>
-   </soapenv:Body>
+   <soapenv:Body/>
 </soapenv:Envelope>
\ No newline at end of file

Modified: axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T4-response.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T4-response.xml?rev=1396717&r1=1396716&r2=1396717&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T4-response.xml (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/soap12/test-doc/T4-response.xml Wed Oct 10 18:09:50 2012
@@ -1,4 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope">
+   <SOAP-ENV:Header>
+      <test:responseOk xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:test="http://example.org/ts-tests">this is a test</test:responseOk>
+   </SOAP-ENV:Header>
    <SOAP-ENV:Body />
 </SOAP-ENV:Envelope>
\ No newline at end of file

Modified: axis/axis1/java/trunk/interop/src/test/java/test/wsdl/soap12/assertion/WhiteMesaSoap12TestSvcTestCase.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop/src/test/java/test/wsdl/soap12/assertion/WhiteMesaSoap12TestSvcTestCase.java?rev=1396717&r1=1396716&r2=1396717&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop/src/test/java/test/wsdl/soap12/assertion/WhiteMesaSoap12TestSvcTestCase.java (original)
+++ axis/axis1/java/trunk/interop/src/test/java/test/wsdl/soap12/assertion/WhiteMesaSoap12TestSvcTestCase.java Wed Oct 10 18:09:50 2012
@@ -9,13 +9,12 @@ package test.wsdl.soap12.assertion;
 
 import org.apache.axis.message.SOAPHeaderElement;
 import org.apache.axis.message.SOAPEnvelope;
+import org.apache.axis.message.Text;
 import org.apache.axis.Constants;
-import org.apache.axis.MessageContext;
 import org.apache.axis.AxisFault;
 import org.apache.axis.soap.SOAPConstants;
 import org.apache.axis.constants.Style;
 import org.apache.axis.client.Call;
-import org.apache.axis.client.Service;
 
 import java.net.URL;
 import java.util.Arrays;
@@ -549,33 +548,20 @@ public class WhiteMesaSoap12TestSvcTestC
      * @throws Exception
      */ 
     protected void testEchoOkHeaderWithEmptyBody(String role) throws Exception {
-        Soap12TestDocBindingStub binding;
-        try {
-            binding = (Soap12TestDocBindingStub)
-                          new WhiteMesaSoap12TestSvcLocator().getSoap12TestDocPort(new URL(DOC_ENDPOINT));
-        }
-        catch (javax.xml.rpc.ServiceException jre) {
-            if(jre.getLinkedCause()!=null)
-                jre.getLinkedCause().printStackTrace();
-            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
-        }
-        assertNotNull("binding is null", binding);
-
-        // Time out after a minute
-        binding.setTimeout(60000);
-
         // Test operation
+        Call call = new Call(DOC_ENDPOINT);
+        call.setOperationStyle(Style.DOCUMENT);
+        call.setSOAPVersion(SOAPConstants.SOAP12_CONSTANTS);
+        SOAPEnvelope reqEnv = new SOAPEnvelope(SOAPConstants.SOAP12_CONSTANTS);
         SOAPHeaderElement header = 
                 new SOAPHeaderElement(TEST_NS, "echoOk");
-        if (role != null)
-            header.setRole(role);
-        header.setObjectValue("this is a test");
-        binding.setHeader(header);
-        binding.emptyBody();
+        header.setRole(role);
+        header.appendChild(new Text("this is a test"));
+        reqEnv.addHeader(header);
+        SOAPEnvelope respEnv = call.invoke(reqEnv);
+        
         // Get the response header
-        SOAPHeaderElement respHeader = 
-                binding.getHeader(TEST_NS,
-                                    "responseOk");
+        SOAPHeaderElement respHeader = respEnv.getHeaderByName(TEST_NS, "responseOk");
         assertNotNull("Missing response header", respHeader);
         assertEquals("this is a test", respHeader.getValue());
     }
@@ -608,12 +594,13 @@ public class WhiteMesaSoap12TestSvcTestC
     }
 
     /**
-     * Test T4 - echoOk header with empty body using role ""
+     * Test T4 - echoOk header with empty body using role
+     * "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver"
      * 
      * @throws Exception
      */ 
     public void testT4() throws Exception {
-        testEchoOkHeaderWithEmptyBody("");
+        testEchoOkHeaderWithEmptyBody(Constants.URI_SOAP12_ULTIMATE_ROLE);
     }
     
     /**