You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2006/01/09 19:48:11 UTC
svn commit: r367360 - in /webservices/axis2/trunk/java/modules/core:
test-resources/wsdl/echo.wsdl test-resources/wsdl/test1.wsdl
test-resources/wsdl/test2.wsdl
test/org/apache/axis2/deployment/AxisServiceBuilderTest.java
Author: sanka
Date: Mon Jan 9 10:48:02 2006
New Revision: 367360
URL: http://svn.apache.org/viewcvs?rev=367360&view=rev
Log:
Few improvements in AxisServiceBuilderTest
Added:
webservices/axis2/trunk/java/modules/core/test-resources/wsdl/test1.wsdl
Removed:
webservices/axis2/trunk/java/modules/core/test-resources/wsdl/echo.wsdl
Modified:
webservices/axis2/trunk/java/modules/core/test-resources/wsdl/test2.wsdl
webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/deployment/AxisServiceBuilderTest.java
Added: webservices/axis2/trunk/java/modules/core/test-resources/wsdl/test1.wsdl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/test-resources/wsdl/test1.wsdl?rev=367360&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test-resources/wsdl/test1.wsdl (added)
+++ webservices/axis2/trunk/java/modules/core/test-resources/wsdl/test1.wsdl Mon Jan 9 10:48:02 2006
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- WSDL description of the WSS Ping interop scenarios -->
+
+<definitions name="Echo"
+ targetNamespace="http://ws.apache.org/axis2/tests"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+ xmlns:tns="http://ws.apache.org/axis2/tests"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+ xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
+ xmlns:intf="http://ws-policy.tests">
+
+ <types>
+ <schema targetNamespace="http://xmlsoap.org/Echo"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+ <complexType name="echo">
+ <sequence>
+ <element name="text" type="xsd:string" nillable="true"/>
+ </sequence>
+ </complexType>
+ <complexType name="echoResponse">
+ <sequence>
+ <element name="text" type="xsd:string" nillable="true"/>
+ </sequence>
+ </complexType>
+ <element name="Echo" type="tns:echo"/>
+ <element name="EchoResponse" type="tns:echoResponse"/>
+ </schema>
+ </types>
+
+ <message name="EchoRequest">
+ <part name="echo" element="tns:Echo"/>
+ </message>
+
+ <message name="EchoResponse">
+ <part name="echoResponse" element="tns:EchoResponse"/>
+ </message>
+
+ <portType name="EchoPort">
+ <operation name="Echo">
+ <input message="tns:EchoRequest" wsa:Action="http://tests.org/echo/in" />
+ <output message="tns:EchoResponse" wsa:Action="http://tests.org/echo/out" />
+ </operation>
+ </portType>
+
+ <binding name="EchoBinding" type="tns:EchoPort">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
+style="document"/>
+ <operation name="Echo">
+ <soap:operation soapAction="http://ws.apache.org/axis2/tests/echo"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="EchoService">
+ <port name="EchoPort" binding="tns:EchoBinding">
+ <soap:address location="http://localhost:8080/axis2/services/EchoService"/>
+ </port>
+ </service>
+
+</definitions>
Modified: webservices/axis2/trunk/java/modules/core/test-resources/wsdl/test2.wsdl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/test-resources/wsdl/test2.wsdl?rev=367360&r1=367359&r2=367360&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test-resources/wsdl/test2.wsdl (original)
+++ webservices/axis2/trunk/java/modules/core/test-resources/wsdl/test2.wsdl Mon Jan 9 10:48:02 2006
@@ -1,193 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--
+<!-- WSDL description of the WSS Ping interop scenarios -->
-The original wsdl document was taken from: "http://wsi.alphaworks.ibm.com:8080/wspolicy/interop2.jsp"
-
--->
-<wsdl:definitions
- targetNamespace="http://ws-policy.tests"
+<definitions name="Echo"
+ targetNamespace="http://ws.apache.org/axis2/tests"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
- xmlns:intf="http://ws-policy.tests"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:apachesoap="http://xml.apache.org/xml-soap"
- xmlns="http://schemas.xmlsoap.org/wsdl"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <wsp:UsingPolicy wsdl:Required="true" />
- <!--
- Dummy Assertion scattered throughout as a "spoiler", i.e. the marker value of 9
- should NEVER appear in any of the Effective Policies calculated.
- -->
- <wsp:Policy wsu:Id="Dummy1-9">
- <intf:PolicyTestAssertion1 marker="9" />
- </wsp:Policy>
-
- <!--
- Message level assertions.
- -->
- <wsp:Policy wsu:Id="Message1-6">
- <intf:MessagePolicyTestAssertion1 marker="6" />
- </wsp:Policy>
- <wsp:Policy wsu:Id="Message2-7">
- <intf:MessagePolicyTestAssertion2 marker="7" />
- </wsp:Policy>
- <wsp:Policy wsu:Id="Message2-Aggregate">
- <intf:MessagePolicyTestAssertion2 marker="8" />
- <wsp:PolicyReference URI="#Message2-7" />
- </wsp:Policy>
-
- <!--
- Operation level assertions.
- -->
- <wsp:Policy wsu:Id="Operation1-6">
- <intf:OperationPolicyTestAssertion1 marker="6" />
- </wsp:Policy>
-
- <wsp:Policy wsu:Id="Operation2-7">
- <intf:OperationPolicyTestAssertion2 marker="7" />
- </wsp:Policy>
- <wsp:Policy wsu:Id="Operation2-Aggregate">
- <intf:OperationPolicyTestAssertion2 marker="8" />
- <wsp:PolicyReference URI="#Operation2-7" />
- </wsp:Policy>
-
- <!--
- Endpoint level assertions.
- -->
- <wsp:Policy wsu:Id="Endpoint2-7">
- <intf:EndpointPolicyTestAssertion2 marker="7" />
- </wsp:Policy>
-
- <wsp:Policy wsu:Id="Endpoint2-Aggregate">
- <intf:EndpointPolicyTestAssertion2 marker="8" />
- <wsp:PolicyReference URI="#Endpoint2-7" />
- </wsp:Policy>
-
- <!--
- Service level assertions.
- -->
- <wsp:Policy wsu:Id="Service1-6">
- <intf:ServicePolicyTestAssertion1 marker="6" />
- </wsp:Policy>
- <wsp:Policy wsu:Id="Service2-7">
- <intf:ServicePolicyTestAssertion2 marker="7" />
- </wsp:Policy>
- <wsp:Policy wsu:Id="Service2-Aggregate">
- <intf:ServicePolicyTestAssertion2 marker="8" />
- <wsp:PolicyReference URI="#Service2-7" />
- </wsp:Policy>
-
- <wsdl:types>
- <schema elementFormDefault="qualified" targetNamespace="http://ws-policy.tests" xmlns="http://www.w3.org/2001/XMLSchema">
- <element name="SimpleRequest">
- <complexType>
- <sequence>
- <element name="request" nillable="true" type="xsd:string" />
- </sequence>
- </complexType>
- </element>
- <element name="SimpleResponse">
- <complexType>
- <sequence>
- <element name="response" nillable="true" type="xsd:string" />
- </sequence>
- </complexType>
- </element>
- </schema>
- </wsdl:types>
-
- <wsdl:message name="MyRequestMessage">
- <wsp:PolicyReference URI="#Message2-Aggregate" />
- <wsdl:part name="parameters" element="intf:SimpleRequest" />
- </wsdl:message>
+ xmlns:tns="http://ws.apache.org/axis2/tests"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+ xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
+ xmlns:intf="http://ws-policy.tests">
+
+ <wsp:Policy wsu:Id="Message1-2">
+ <intf:MessagePolicyTestAssertion2 marker="6" />
+ </wsp:Policy>
+
+ <wsp:Policy wsu:Id="Operation1-2">
+ <intf:OperationPolicyTestAssertion2 marker="6" />
+ </wsp:Policy>
- <wsdl:message name="MyResponseMessage">
- <wsp:PolicyReference URI="#Message2-Aggregate" />
- <wsdl:part name="parameters" element="intf:SimpleResponse" />
- </wsdl:message>
-
- <wsdl:message name="MyFaultMessage">
- <wsp:PolicyReference URI="#Message2-Aggregate"/>
- <wsdl:part name="parameters" element="intf:SimpleFault" />
- </wsdl:message>
- <wsdl:portType name="MyPortType" wsp:PolicyURIs="#Endpoint2-Aggregate">
- <wsdl:operation name="MyOperation">
- <wsp:Policy>
- <wsp:PolicyReference URI="Operation2-Aggregate"/>
- <wsp:PolicyReference URI="#Operation1-6"/>
- </wsp:Policy>
- <wsdl:input name="MyInput" message="intf:MyRequestMessage" wsp:PolicyURIs="#Message1-6" />
- <wsdl:output name="MyOutput" message="intf:MyResponseMessage" wsp:PolicyURIs="#Message1-6" />
- <wsdl:fault name="MyFault" message="intf:MyFaultMessage" wsp:PolicyURIs="#Message1-6" />
- </wsdl:operation>
- </wsdl:portType>
-
- <wsdl:binding name="MyBinding" type="intf:MyPortType">
- <wsp:Policy wsu:Id="Endpoint1-6">
- <intf:EndpointPolicyTestAssertion1 marker="6" />
+ <wsp:Policy wsu:Id="Endpoint1-2">
+ <intf:EndpointPolicyTestAssertion2 marker="7" />
+ </wsp:Policy>
+
+ <types>
+ <schema targetNamespace="http://xmlsoap.org/Echo"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+ <complexType name="echo">
+ <sequence>
+ <element name="text" type="xsd:string" nillable="true"/>
+ </sequence>
+ </complexType>
+ <complexType name="echoResponse">
+ <sequence>
+ <element name="text" type="xsd:string" nillable="true"/>
+ </sequence>
+ </complexType>
+ <element name="Echo" type="tns:echo"/>
+ <element name="EchoResponse" type="tns:echoResponse"/>
+ </schema>
+ </types>
+
+ <message name="EchoRequest">
+ <part name="echo" element="tns:Echo"/>
+ </message>
+
+ <message name="EchoResponse">
+ <part name="echoResponse" element="tns:EchoResponse"/>
+ </message>
+
+ <portType name="EchoPort" wsp:PolicyURIs="#Endpoint1-2">
+ <operation name="Echo">
+ <wsp:PolicyReference URI="#Operation1-2"/>
+ <input message="tns:EchoRequest" wsp:PolicyURIs="#Message1-2" wsa:Action="http://tests.org/echo/in"/>
+ <output message="tns:EchoResponse" wsp:PolicyURIs="#Message1-2" wsa:Action="http://tests.org/echo/out" />
+ </operation>
+ </portType>
+
+ <binding name="EchoBinding" type="tns:EchoPort">
+ <wsp:Policy wsu:Id="Endpoint2">
+ <intf:EndpointPolicyTestAssertion1 marker="6" />
+ </wsp:Policy>
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
+style="document"/>
+ <operation name="Echo">
+ <wsp:Policy>
+ <intf:OperationPolicyTestAssertion2 marker="3" />
+ </wsp:Policy>
+ <soap:operation soapAction="http://ws.apache.org/axis2/tests/echo"/>
+ <input>
+ <wsp:Policy>
+ <intf:MessagePolicyTestAssertion1 marker="2" />
</wsp:Policy>
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="MyOperation">
- <wsp:Policy>
- <wsp:ExactlyOne>
- <intf:OperationPolicyTestAssertion1 marker="3" />
- <intf:OperationPolicyTestAssertion2 marker="3" />
- </wsp:ExactlyOne>
- </wsp:Policy>
-
- <wsdlsoap:operation soapAction="" />
- <wsdl:input name="MyInput">
- <wsp:Policy>
- <wsp:ExactlyOne>
- <intf:MessagePolicyTestAssertion1 marker="2" />
- <intf:MessagePolicyTestAssertion2 marker="2" />
- </wsp:ExactlyOne>
- </wsp:Policy>
- <wsdlsoap:body use="literal" />
- </wsdl:input>
- <wsdl:output name="MyOutput">
- <wsp:Policy>
- <wsp:ExactlyOne>
- <intf:MessagePolicyTestAssertion1 marker="1" />
- <intf:MessagePolicyTestAssertion2 marker="1" />
- </wsp:ExactlyOne>
- </wsp:Policy>
- <wsdlsoap:body use="literal" />
- </wsdl:output>
- <wsdl:fault name="MyFault">
- <wsp:Policy>
- <wsp:ExactlyOne>
- <intf:MessagePolicyTestAssertion1 marker="0" />
- <intf:MessagePolicyTestAssertion2 marker="0" />
- </wsp:ExactlyOne>
- </wsp:Policy>
- <wsdlsoap:body use="literal" />
- </wsdl:fault>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="MyService">
- <wsp:Policy>
- <wsp:ExactlyOne>
- <intf:ServicePolicyTestAssertion1 marker="5" />
- <intf:ServicePolicyTestAssertion2 marker="5" />
- </wsp:ExactlyOne>
- <wsp:PolicyReference URI="#Service1-6" />
- <wsp:PolicyReference URI="#Service2-Aggregate" />
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ <wsp:Policy>
+ <intf:MessagePolicyTestAssertion1 marker="1" />
</wsp:Policy>
+ </output>
+ </operation>
+ </binding>
+
+ <service name="EchoService">
+ <wsp:Policy>
+ <intf:ServicePolicyTestAssertion1 marker="5" />
+ </wsp:Policy>
+ <port name="EchoPort" binding="tns:EchoBinding">
+ <wsp:Policy>
+ <intf:EndpointPolicyTestAssertion1 marker="4" />
+ </wsp:Policy>
+ <soap:address location="http://localhost:8080/axis2/services/EchoService"/>
+ </port>
+ </service>
- <wsdl:port name="MyPort" binding="intf:MyBinding">
- <wsp:Policy>
- <wsp:ExactlyOne>
- <intf:EndpointPolicyTestAssertion1 marker="4" />
- <intf:EndpointPolicyTestAssertion2 marker="4" />
- </wsp:ExactlyOne>
- </wsp:Policy>
- <wsdlsoap:address location="http://localhost:9080/services/MyServiceMyPort" />
- </wsdl:port>
-
- </wsdl:service>
-
-</wsdl:definitions>
+</definitions>
Modified: webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/deployment/AxisServiceBuilderTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/deployment/AxisServiceBuilderTest.java?rev=367360&r1=367359&r2=367360&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/deployment/AxisServiceBuilderTest.java (original)
+++ webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/deployment/AxisServiceBuilderTest.java Mon Jan 9 10:48:02 2006
@@ -45,7 +45,36 @@
public void test1() throws Exception {
AxisService service = builder.getAxisService(new FileInputStream(
- "./test-resources/wsdl/echo.wsdl"));
+ "./test-resources/wsdl/test1.wsdl"));
+
+ assertNotNull(service);
+ assertEquals("EchoService", service.getName());
+
+ AxisOperation axisOperation = service.getOperation(new QName("Echo"));
+ assertNotNull(axisOperation);
+
+ assertEquals(WSDLConstants.MEP_URI_IN_OUT, axisOperation
+ .getMessageExchangePattern());
+
+ AxisMessage input = axisOperation
+ .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+ assertNotNull(input);
+ assertEquals(input.getParent(), axisOperation);
+ assertEquals(input.getElementQName(), new QName(
+ "http://ws.apache.org/axis2/tests", "Echo"));
+
+ AxisMessage output = axisOperation
+ .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
+ assertNotNull(output);
+ assertEquals(output.getParent(), axisOperation);
+ assertEquals(output.getElementQName(), new QName(
+ "http://ws.apache.org/axis2/tests", "EchoResponse"));
+ }
+
+ public void test2() throws Exception {
+
+ AxisService service = builder.getAxisService(new FileInputStream(
+ "./test-resources/wsdl/test2.wsdl"));
assertNotNull(service);
assertEquals("EchoService", service.getName());