Dims, FYI - there are some hard-coded strings in this submit in SymbolTable.java....
-- Tom Jordahl Macromedia Server Development -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, January 03, 2003 9:23 AM To: [EMAIL PROTECTED] Subject: cvs commit: xml-axis/java/src/org/apache/axis/i18n resource.properties dims 2003/01/03 06:23:10 Modified: java/src/org/apache/axis/client AdminClient.java java/test/wsdl/types ComprehensiveTypes.wsdl java/test/wsdl/getPort getPort.wsdl GetPortTestCase.java java/src/org/apache/axis/wsdl/symbolTable SymbolTable.java java/src/org/apache/axis/i18n resource.properties Added: java/test/badWSDL Error-FaultInOperationWithMissingMessageAttribute-MultipleFaults.wsdl Error-FaultInOperationWithMissingMessageAttribute.wsdl Error-FaultInOperationWithUndefinedMessage-MultipleFaults.wsdl Error-FaultInOperationWithUndefinedMessage.wsdl Error-InputInOperationWithMissingMessageAttribute.wsdl Error-InputInOperationWithUndefinedMessage.wsdl Error-OutputInOperationWithMissingMessageAttribute.wsdl Error-OutputInOperationWithUndefinedMessage.wsdl java/src/org/apache/axis/wsdl/symbolTable PortEntry.java Log: Fixes for Bug 15699 - WSDL2java - missing checks for <operation message="..."> element from [EMAIL PROTECTED] (Karl Guggisberg) Revision Changes Path 1.73 +35 -2 xml-axis/java/src/org/apache/axis/client/AdminClient.java Index: AdminClient.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/AdminClient.java,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- AdminClient.java 11 Dec 2002 22:38:09 -0000 1.72 +++ AdminClient.java 3 Jan 2003 14:23:09 -0000 1.73 @@ -101,6 +101,37 @@ defaultConfiguration.set(config); } + private static String getUsageInfo() + { + return "Processes a set of administration commands.\n" + + "\n" + + "The following Options are available:\n" + + "\n" + + "\t-l<url> sets the AxisServlet URL\n" + + "\t-h<hostName sets the AxisServlet host\n" + + "\t-p<portNumber> sets the AxisServlet port\n" + + "\t-s<servletPath> sets the path to the AxisServlet\n" + + "\t-f<fileName> specifies that a simple file protocol should be used\n" + + "\t-u<username> sets the username\n" + + "\t-w<password> sets the password\n" + + "\t-d sets the debug flag (for instance, -ddd would set it to 3)\n" + + "\t-t<name> sets the transport chain touse\n" + + "\n" + + "Commands:\n" + + "\tlist will list the currently deployed services\n" + + "\tquit will quit (???)\n" + + "\tpasswd value changes the admin password\n" + + "\n" + + "Deployment Descriptor files:\n" + + "\n" + + "<deployment-descriptor-files> deploys or undeploys Axis components and\n" + + " web services described in these files\n" + + "\n" + + "If -l or -h -p -s are not set, the AdminClient will invoke\n" + + "http://localhost:8080/axis/servlet/AxisServlet\n"; + } + + protected Call call; /** @@ -223,8 +254,10 @@ args = opts.getRemainingArgs(); - if ( args == null ) { - log.info(Messages.getMessage("usage00","AdminClient xml-files | list")); + if ( args == null || opts.isFlagSet('h') > 0) { + log.info(Messages.getMessage("usage00","AdminClient [Options] [list | <deployment-descriptor-files>]")); + log.info(""); + log.info(getUsageInfo()); return null; } 1.47 +8 -2 xml-axis/java/test/wsdl/types/ComprehensiveTypes.wsdl Index: ComprehensiveTypes.wsdl =================================================================== RCS file: /home/cvs/xml-axis/java/test/wsdl/types/ComprehensiveTypes.wsdl,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- ComprehensiveTypes.wsdl 8 Oct 2002 03:31:35 -0000 1.46 +++ ComprehensiveTypes.wsdl 3 Jan 2003 14:23:09 -0000 1.47 @@ -961,11 +961,17 @@ <output message="tns:arrayM"/> </operation> <operation name="arrayMOut" parameterOrder="arrayM"> - <input message="tns:emptyM"/> + <!-- BUG: type emptyM not defined ! Replacing by type empty + for the time being. + --> + <input message="tns:empty"/> <output message="tns:arrayM"/> </operation> <operation name="arrayMReturn"> - <input message="tns:emptyM"/> + <!-- BUG: type emptyM not defined ! Replacing by type empty + for the time being. + --> + <input message="tns:empty"/> <output message="tns:arrayM"/> </operation> 1.1 xml-axis/java/test/badWSDL/Error-FaultInOperationWithMissingMessageAttribute-MultipleFaults.wsdl Index: Error-FaultInOperationWithMissingMessageAttribute-MultipleFaults.wsdl =================================================================== <?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://wdls.error/OperationWithUndefinedMessage" xmlns:tns="http://wdls.error/OperationWithUndefinedMessage" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" > <message name="CityTemperatureForecastRequest"> <part name="body" type="xsd:string" /> </message> <message name="CityTemperatureForecastResponse"> <part name="body" type="xsd:float" /> </message> <message name="NoSuchCity"> <part name="body" type="xsd:string" /> </message> <portType name="CityTemperatureForecast"> <operation name="GetCityTemperatureForecast"> <input message="tns:CityTemperatureForecastRequest" /> <output message="tns:CityTemperatureForecastResponse" /> <fault message="tns:NoSuchCity" /> <!-- missing message attribute --> <fault /> </operation> </portType> <binding name="CityTemperatureForecastBinding" type="tns:CityTemperatureForecast"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="GetCityTemperatureForecast"> <soap:operation/> <input> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation>> </binding> <service name="WeatherForecastService"> <port name="CityTemperatureForecast" binding="tns:CityTemperatureForecastBinding"> <soap:address location="http://localhost:9090/axis/services/WeatherForecastService"/> </port> </service> </definitions> 1.1 xml-axis/java/test/badWSDL/Error-FaultInOperationWithMissingMessageAttribute.wsdl Index: Error-FaultInOperationWithMissingMessageAttribute.wsdl =================================================================== <?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://wdls.error/OperationWithUndefinedMessage" xmlns:tns="http://wdls.error/OperationWithUndefinedMessage" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" > <message name="CityTemperatureForecastRequest"> <part name="body" type="xsd:string" /> </message> <message name="CityTemperatureForecastResponse"> <part name="body" type="xsd:float" /> </message> <portType name="CityTemperatureForecast"> <operation name="GetCityTemperatureForecast"> <input message="tns:CityTemperatureForecastRequest" /> <output message="tns:CityTemperatureForecastResponse" /> <!-- missing message attribute --> <fault /> </operation> </portType> <binding name="CityTemperatureForecastBinding" type="tns:CityTemperatureForecast"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="GetCityTemperatureForecast"> <soap:operation/> <input> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation>> </binding> <service name="WeatherForecastService"> <port name="CityTemperatureForecast" binding="tns:CityTemperatureForecastBinding"> <soap:address location="http://localhost:9090/axis/services/WeatherForecastService"/> </port> </service> </definitions> 1.1 xml-axis/java/test/badWSDL/Error-FaultInOperationWithUndefinedMessage-MultipleFaults.wsdl Index: Error-FaultInOperationWithUndefinedMessage-MultipleFaults.wsdl =================================================================== <?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://wdls.error/OperationWithUndefinedMessage" xmlns:tns="http://wdls.error/OperationWithUndefinedMessage" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" > <message name="CityTemperatureForecastRequest"> <part name="body" type="xsd:string" /> </message> <message name="CityTemperatureForecastResponse"> <part name="body" type="xsd:float" /> </message> <message name="NoSuchCity"> <part name="body" type="xsd:string" /> </message> <portType name="CityTemperatureForecast"> <operation name="GetCityTemperatureForecast"> <input message="tns:CityTemperatureForecastRequest" /> <output message="tns:CityTemperatureForecastResponse" /> <fault message="tns:NoSuchCity" /> <!-- there is no message with name "UndefinedFaultMessage" --> <fault message="UndefinedFaultMessage" /> </operation> </portType> <binding name="CityTemperatureForecastBinding" type="tns:CityTemperatureForecast"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="GetCityTemperatureForecast"> <soap:operation/> <input> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation>> </binding> <service name="WeatherForecastService"> <port name="CityTemperatureForecast" binding="tns:CityTemperatureForecastBinding"> <soap:address location="http://localhost:9090/axis/services/WeatherForecastService"/> </port> </service> </definitions> 1.1 xml-axis/java/test/badWSDL/Error-FaultInOperationWithUndefinedMessage.wsdl Index: Error-FaultInOperationWithUndefinedMessage.wsdl =================================================================== <?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://wdls.error/OperationWithUndefinedMessage" xmlns:tns="http://wdls.error/OperationWithUndefinedMessage" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" > <message name="CityTemperatureForecastRequest"> <part name="body" type="xsd:string" /> </message> <message name="CityTemperatureForecastResponse"> <part name="body" type="xsd:float" /> </message> <portType name="CityTemperatureForecast"> <operation name="GetCityTemperatureForecast"> <input message="tns:CityTemperatureForecastRequest" /> <output message="tns:CityTemperatureForecastResponse" /> <!-- there is no message with name "UndefinedFaultMessage" --> <fault message="UndefinedFaultMessage" /> </operation> </portType> <binding name="CityTemperatureForecastBinding" type="tns:CityTemperatureForecast"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="GetCityTemperatureForecast"> <soap:operation/> <input> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation>> </binding> <service name="WeatherForecastService"> <port name="CityTemperatureForecast" binding="tns:CityTemperatureForecastBinding"> <soap:address location="http://localhost:9090/axis/services/WeatherForecastService"/> </port> </service> </definitions> 1.1 xml-axis/java/test/badWSDL/Error-InputInOperationWithMissingMessageAttribute.wsdl Index: Error-InputInOperationWithMissingMessageAttribute.wsdl =================================================================== <?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://wdls.error/OperationWithUndefinedMessage" xmlns:tns="http://wdls.error/OperationWithUndefinedMessage" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" > <message name="CityTemperatureForecastRequest"> <part name="body" type="xsd:string" /> </message> <message name="CityTemperatureForecastResponse"> <part name="body" type="xsd:float" /> </message> <portType name="CityTemperatureForecast"> <operation name="GetCityTemperatureForecast"> <!-- missing message attribute --> <input /> </operation> </portType> <binding name="CityTemperatureForecastBinding" type="tns:CityTemperatureForecast"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="GetCityTemperatureForecast"> <soap:operation/> <input> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation>> </binding> <service name="WeatherForecastService"> <port name="CityTemperatureForecast" binding="tns:CityTemperatureForecastBinding"> <soap:address location="http://localhost:9090/axis/services/WeatherForecastService"/> </port> </service> </definitions> 1.1 xml-axis/java/test/badWSDL/Error-InputInOperationWithUndefinedMessage.wsdl Index: Error-InputInOperationWithUndefinedMessage.wsdl =================================================================== <?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://wdls.error/OperationWithUndefinedMessage" xmlns:tns="http://wdls.error/OperationWithUndefinedMessage" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" > <message name="CityTemperatureForecastRequest"> <part name="body" type="xsd:string" /> </message> <message name="CityTemperatureForecastResponse"> <part name="body" type="xsd:float" /> </message> <portType name="CityTemperatureForecast"> <operation name="GetCityTemperatureForecast"> <!-- there is no message with name "UndefinedInputMessage" --> <input message="UndefindedInputMessage" /> </operation> </portType> <binding name="CityTemperatureForecastBinding" type="tns:CityTemperatureForecast"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="GetCityTemperatureForecast"> <soap:operation/> <input> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation>> </binding> <service name="WeatherForecastService"> <port name="CityTemperatureForecast" binding="tns:CityTemperatureForecastBinding"> <soap:address location="http://localhost:9090/axis/services/WeatherForecastService"/> </port> </service> </definitions> 1.1 xml-axis/java/test/badWSDL/Error-OutputInOperationWithMissingMessageAttribute.wsdl Index: Error-OutputInOperationWithMissingMessageAttribute.wsdl =================================================================== <?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://wdls.error/OperationWithUndefinedMessage" xmlns:tns="http://wdls.error/OperationWithUndefinedMessage" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" > <message name="CityTemperatureForecastRequest"> <part name="body" type="xsd:string" /> </message> <message name="CityTemperatureForecastResponse"> <part name="body" type="xsd:float" /> </message> <portType name="CityTemperatureForecast"> <operation name="GetCityTemperatureForecast"> <input message="tns:CityTemperatureForecastRequest" /> <!-- missing message attribute --> <output /> </operation> </portType> <binding name="CityTemperatureForecastBinding" type="tns:CityTemperatureForecast"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="GetCityTemperatureForecast"> <soap:operation/> <input> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation>> </binding> <service name="WeatherForecastService"> <port name="CityTemperatureForecast" binding="tns:CityTemperatureForecastBinding"> <soap:address location="http://localhost:9090/axis/services/WeatherForecastService"/> </port> </service> </definitions> 1.1 xml-axis/java/test/badWSDL/Error-OutputInOperationWithUndefinedMessage.wsdl Index: Error-OutputInOperationWithUndefinedMessage.wsdl =================================================================== <?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://wdls.error/OperationWithUndefinedMessage" xmlns:tns="http://wdls.error/OperationWithUndefinedMessage" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" > <message name="CityTemperatureForecastRequest"> <part name="body" type="xsd:string" /> </message> <message name="CityTemperatureForecastResponse"> <part name="body" type="xsd:float" /> </message> <portType name="CityTemperatureForecast"> <operation name="GetCityTemperatureForecast"> <input message="tns:CityTemperatureForecastRequest" /> <!-- there is no message with name "UndefinedOutputMessage" --> <output message="UndefinedOutputMessage" /> </operation> </portType> <binding name="CityTemperatureForecastBinding" type="tns:CityTemperatureForecast"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="GetCityTemperatureForecast"> <soap:operation/> <input> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation>> </binding> <service name="WeatherForecastService"> <port name="CityTemperatureForecast" binding="tns:CityTemperatureForecastBinding"> <soap:address location="http://localhost:9090/axis/services/WeatherForecastService"/> </port> </service> </definitions> 1.4 +28 -21 xml-axis/java/test/wsdl/getPort/getPort.wsdl Index: getPort.wsdl =================================================================== RCS file: /home/cvs/xml-axis/java/test/wsdl/getPort/getPort.wsdl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- getPort.wsdl 24 Oct 2002 16:05:48 -0000 1.3 +++ getPort.wsdl 3 Jan 2003 14:23:10 -0000 1.4 @@ -30,46 +30,53 @@ </binding> <service name="empty"/> + + <!-- + all services names unique in the enclosing WSDL document - Test + Bug 15686 + --> <service name="serviceA"> <documentation> Service with all ports unique. /* Test Bug 13407 - embedded comments */ </documentation> - <port name="portOne" binding="tns:bindingOne"> - <soap:address location="http://localhost:8080/axis/services/portOne"/> + <port name="portAOne" binding="tns:bindingOne"> + <soap:address location="http://localhost:8080/axis/services/portAOne"/> </port> - <port name="portTwo" binding="tns:bindingTwo"> - <soap:address location="http://localhost:8080/axis/services/portTwo"/> + <port name="portATwo" binding="tns:bindingTwo"> + <soap:address location="http://localhost:8080/axis/services/portATwo"/> </port> - <port name="portThree" binding="tns:bindingThree"> - <soap:address location="http://localhost:8080/axis/services/portThree"/> + <port name="portAThree" binding="tns:bindingThree"> + <soap:address location="http://localhost:8080/axis/services/portAThree"/> </port> </service> + <service name="serviceB"> <documentation> - Service with two ports (portTwo, portTwoA) that share the same portType via the same binding. + Service with two ports (portBTwo, portBTwoA) that share the same portType via the same binding. </documentation> - <port name="portOne" binding="tns:bindingOne"> - <soap:address location="http://localhost:8080/axis/services/portOne"/> + <port name="portBOne" binding="tns:bindingOne"> + <soap:address location="http://localhost:8080/axis/services/portBOne"/> </port> - <port name="portTwo" binding="tns:bindingTwo"> - <soap:address location="http://localhost:8080/axis/services/portTwo"/> + <port name="portBTwo" binding="tns:bindingTwo"> + <soap:address location="http://localhost:8080/axis/services/portBTwo"/> </port> - <port name="portTwoA" binding="tns:bindingTwo"> - <soap:address location="http://localhost:8080/axis/services/portTwoA"/> + <port name="portBTwoA" binding="tns:bindingTwo"> + <soap:address location="http://localhost:8080/axis/services/portBTwoA"/> </port> </service> - <service name="serviceC"> + + <service name="serviceC"> <documentation> - Service with two ports (portTwo, portThree) that share the same portType via different bindings. + Service with two ports (portCTwo, portCThree) that share the same portType via different bindings. </documentation> - <port name="portOne" binding="tns:bindingOne"> - <soap:address location="http://localhost:8080/axis/services/portOne"/> + <port name="portCOne" binding="tns:bindingOne"> + <soap:address location="http://localhost:8080/axis/services/portCOne"/> </port> - <port name="portTwo" binding="tns:bindingTwo"> - <soap:address location="http://localhost:8080/axis/services/portTwo"/> + <port name="portCTwo" binding="tns:bindingTwo"> + <soap:address location="http://localhost:8080/axis/services/portCTwo"/> </port> - <port name="portThree" binding="tns:bindingAnotherOne"> - <soap:address location="http://localhost:8080/axis/services/portFour"/> + <port name="portCThree" binding="tns:bindingAnotherOne"> + <soap:address location="http://localhost:8080/axis/services/portCThree"/> </port> </service> 1.5 +128 -31 xml-axis/java/test/wsdl/getPort/GetPortTestCase.java Index: GetPortTestCase.java =================================================================== RCS file: /home/cvs/xml-axis/java/test/wsdl/getPort/GetPortTestCase.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- GetPortTestCase.java 11 Dec 2002 22:40:20 -0000 1.4 +++ GetPortTestCase.java 3 Jan 2003 14:23:10 -0000 1.5 @@ -10,10 +10,22 @@ public class GetPortTestCase extends junit.framework.TestCase { - private static final QName portOne = new QName("portOne"); - private static final QName portTwo = new QName("portTwo"); - private static final QName portTwoA = new QName("portTwoA"); - private static final QName portThree = new QName("portThree"); + private static final QName portAOne = new QName("portAOne"); + private static final QName portATwo = new QName("portATwo"); + private static final QName portAThree = new QName("portAThree"); + + private static final QName portBOne = new QName("portBOne"); + private static final QName portBTwo = new QName("portBTwo"); + private static final QName portBTwoA = new QName("portBTwoA"); + + private static final QName portCOne = new QName("portCOne"); + private static final QName portCTwo = new QName("portCTwo"); + private static final QName portCThree = new QName("portCThree"); + + private static final String ADR_PORTAONE = "http://localhost:8080/axis/services/portAOne"; + private static final String ADR_PORTATWO = "http://localhost:8080/axis/services/portATwo"; + private static final String ADR_PORTATHREE = "http://localhost:8080/axis/services/portAThree"; + public GetPortTestCase(String name) { super(name); @@ -31,6 +43,25 @@ } } // testEmptyService + +/* + + <service name="serviceA"> + <documentation> + Service with all ports unique. /-- Test Bug 13407 - embedded comments --/ + </documentation> + <port name="portAOne" binding="tns:bindingOne"> + <soap:address location="http://localhost:8080/axis/services/portAOne"/> + </port> + <port name="portATwo" binding="tns:bindingTwo"> + <soap:address location="http://localhost:8080/axis/services/portATwo"/> + </port> + <port name="portAThree" binding="tns:bindingThree"> + <soap:address location="http://localhost:8080/axis/services/portAThree"/> + </port> + </service> + + */ public void testNormalService() { ServiceA service = new ServiceALocator(); try { @@ -52,21 +83,45 @@ // Make sure we get the proper ports try { - Stub one = (Stub) service.getPort(portOne, One.class); - Stub two = (Stub) service.getPort(portTwo, Two.class); - Stub three = (Stub) service.getPort(portThree, Three.class); - assertTrue("getPort(portOne) should be of type One, instead it is " + one.getClass().getName(), one instanceof One); - assertTrue("getPort(portOne) should have address http://localhost:8080/axis/services/portOne, instead it has " + one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), "http://localhost:8080/axis/services/portOne".equals(one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); - assertTrue("getPort(portTwo) should be of type Two, instead it is " + two.getClass().getName(), two instanceof Two); - assertTrue("getPort(portTwo) should have address http://localhost:8080/axis/services/portTwo, instead it has " + two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), "http://localhost:8080/axis/services/portTwo".equals(two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); - assertTrue("getPort(portThree) should be of type Three, instead it is " + three.getClass().getName(), three instanceof Three); - assertTrue("getPort(portThree) should have address http://localhost:8080/axis/services/portThree, instead it has " + three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), "http://localhost:8080/axis/services/portThree".equals(three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); + Stub one = (Stub) service.getPort(portAOne, One.class); + Stub two = (Stub) service.getPort(portATwo, Two.class); + Stub three = (Stub) service.getPort(portAThree, Three.class); + assertTrue("getPort(portAOne) should be of type One, instead it is " + one.getClass().getName(), one instanceof One); + assertTrue("getPort(portAOne) should have " + ADR_PORTAONE + ", instead it has " + one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), + ADR_PORTAONE.equals(one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); + + assertTrue("getPort(portATwo) should be of type Two, instead it is " + two.getClass().getName(), two instanceof Two); + assertTrue("getPort(portATwo) should have address " + ADR_PORTATWO + ", instead it has " + two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), + ADR_PORTATWO.equals(two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); + + assertTrue("getPort(portAThree) should be of type Three, instead it is " + three.getClass().getName(), three instanceof Three); + assertTrue("getPort(portAThree) should have address " + + ADR_PORTATHREE + ", instead it has " + + three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), + ADR_PORTATHREE.equals(three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); } catch (ServiceException se) { fail("unexpected failure: " + se); } } // testNormalService +/* + + <service name="serviceB"> + <documentation> + Service with two ports (portBTwo, portBTwoA) that share the same portType via the same binding. + </documentation> + <port name="portBOne" binding="tns:bindingOne"> + <soap:address location="http://localhost:8080/axis/services/portOne"/> + </port> + <port name="portBTwo" binding="tns:bindingTwo"> + <soap:address location="http://localhost:8080/axis/services/portBTwo"/> + </port> + <port name="portBTwoA" binding="tns:bindingTwo"> + <soap:address location="http://localhost:8080/axis/services/portBTwoA"/> + </port> + </service> +*/ public void testDoublePortService1() { ServiceB service = new ServiceBLocator(); try { @@ -87,21 +142,50 @@ // Make sure we get the proper ports try { - Stub one = (Stub) service.getPort(portOne, One.class); - Stub two = (Stub) service.getPort(portTwo, Two.class); - Stub three = (Stub) service.getPort(portTwoA, Three.class); - assertTrue("getPort(portOne) should be of type One, instead it is " + one.getClass().getName(), one instanceof One); - assertTrue("getPort(portOne) should have address http://localhost:8080/axis/services/portOne, instead it has " + one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), "http://localhost:8080/axis/services/portOne".equals(one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); - assertTrue("getPort(portTwo) should be of type Two, instead it is " + two.getClass().getName(), two instanceof Two); - assertTrue("getPort(portTwo) should have address http://localhost:8080/axis/services/portTwo, instead it has " + two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), "http://localhost:8080/axis/services/portTwo".equals(two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); - assertTrue("getPort(portTwoA) should be of type Two, instead it is " + three.getClass().getName(), three instanceof Two); - assertTrue("getPort(portThree) should have address http://localhost:8080/axis/services/portTwoA, instead it has " + three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), "http://localhost:8080/axis/services/portTwoA".equals(three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); + Stub one = (Stub) service.getPort(portBOne, One.class); + Stub two = (Stub) service.getPort(portBTwo, Two.class); + Stub three = (Stub) service.getPort(portBTwoA, Two.class); + assertTrue("getPort(portBOne) should be of type One, instead it is " + one.getClass().getName(), one instanceof One); + assertTrue("getPort(portBOne) should have address http://localhost:8080/axis/services/portBOne," + + " instead it has " + one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), + "http://localhost:8080/axis/services/portBOne".equals(one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); + + assertTrue("getPort(portBTwo) should be of type Two, instead it is " + two.getClass().getName(), two instanceof Two); + assertTrue("getPort(portBTwo) should have address" + + "http://localhost:8080/axis/services/portBTwo," + + "instead it has " + two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY) + + ", port is " + two.toString(), + "http://localhost:8080/axis/services/portBTwo".equals(two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); + + assertTrue("getPort(portBTwoA) should be of type Two, instead it is " + three.getClass().getName(), three instanceof Two); + assertTrue("getPort(portBTwoA) should have address " + + "http://localhost:8080/axis/services/portBTwoA, " + + "instead it has " + three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), + "http://localhost:8080/axis/services/portBTwoA".equals(three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); } catch (ServiceException se) { fail("unexpected failure: " + se); } } // testDoublePortService1 + +/* + * <service name="serviceC"> + <documentation> + Service with two ports (portCTwo, portCThree) that share the same portType via different bindings. + </documentation> + <port name="portCOne" binding="tns:bindingOne"> + <soap:address location="http://localhost:8080/axis/services/portCOne"/> + </port> + <port name="portCTwo" binding="tns:bindingTwo"> + <soap:address location="http://localhost:8080/axis/services/portCTwo"/> + </port> + <port name="portCThree" binding="tns:bindingAnotherOne"> + <soap:address location="http://localhost:8080/axis/services/portCThree"/> + </port> + </service> + +*/ public void testDoublePortService2() { ServiceC service = new ServiceCLocator(); try { @@ -122,15 +206,28 @@ // Make sure we get the proper ports try { - Stub one = (Stub) service.getPort(portOne, One.class); - Stub two = (Stub) service.getPort(portTwo, Two.class); - Stub three = (Stub) service.getPort(portThree, Three.class); - assertTrue("getPort(portOne) should be of type One, instead it is " + one.getClass().getName(), one instanceof One); - assertTrue("getPort(portOne) should have address http://localhost:8080/axis/services/portOne, instead it has " + one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), "http://localhost:8080/axis/services/portOne".equals(one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); - assertTrue("getPort(portTwo) should be of type Two, instead it is " + two.getClass().getName(), two instanceof Two); - assertTrue("getPort(portTwo) should have address http://localhost:8080/axis/services/portTwo, instead it has " + two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), "http://localhost:8080/axis/services/portTwo".equals(two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); - assertTrue("getPort(portThree) should be of type One, instead it is " + three.getClass().getName(), three instanceof One); - assertTrue("getPort(portThree) should have address http://localhost:8080/axis/services/portFour, instead it has " + three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), "http://localhost:8080/axis/services/portFour".equals(three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); + Stub one = (Stub) service.getPort(portCOne, One.class); + Stub two = (Stub) service.getPort(portCTwo, Two.class); + Stub three = (Stub) service.getPort(portCThree, Three.class); + assertTrue("getPort(portCOne) should be of type One, instead it is " + one.getClass().getName(), one instanceof One); + assertTrue("getPort(portCOne) should have address " + + "http://localhost:8080/axis/services/portCOne, " + + "instead it has " + one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), + "http://localhost:8080/axis/services/portCOne".equals(one._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); + + + assertTrue("getPort(portCTwo) should be of type Two, instead it is " + two.getClass().getName(), two instanceof Two); + assertTrue("getPort(portCTwo) should have address " + + "http://localhost:8080/axis/services/portCTwo, " + + "instead it has " + two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), + "http://localhost:8080/axis/services/portCTwo".equals(two._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); + + + assertTrue("getPort(portCThree) should be of type One, instead it is " + three.getClass().getName(), three instanceof One); + assertTrue("getPort(portCThree) should have address " + + "http://localhost:8080/axis/services/portCThree," + + " instead it has " + three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY), + "http://localhost:8080/axis/services/portCThree".equals(three._getProperty(Stub.ENDPOINT_ADDRESS_PROPERTY))); } catch (ServiceException se) { fail("unexpected failure: " + se); 1.68 +213 -2 xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java Index: SymbolTable.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java,v retrieving revision 1.67 retrieving revision 1.68 diff -u -r1.67 -r1.68 --- SymbolTable.java 3 Jan 2003 13:56:08 -0000 1.67 +++ SymbolTable.java 3 Jan 2003 14:23:10 -0000 1.68 @@ -1026,6 +1026,122 @@ } } // populateMessages + /** + * ensures that a message in a <code><input></code>, <code><output></code>, + * or <code><fault></fault> element in an <code><operation></code> + * element is valid. In particular, ensures that + * <ol> + * <li>an attribute <code>message</code> is present (according to the + * XML Schema for WSDL 1.1 <code>message</code> is <strong>required</strong> + * + * <li>the value of attribute <code>message</code> (a QName) refers to + * an already defined message + * </ol> + * + * <strong>Note</strong>: this method should throw a <code>javax.wsdl.WSDLException</code> rather than + * a <code>java.io.IOException</code> + * + * @param message the message object + * + * @exception IOException thrown, if the message is not valid + * + */ + protected void ensureOperationMessageValid(Message message) throws IOException { + + // make sure the message is not null (i.e. there is an + // attribute 'message ') + // + if (message == null) { + throw new IOException( + "<input>,<output>, or <fault> in <operation ..> without attribute 'message' found. Attribute 'message' is required." + ); + } + + // make sure the value of the attribute refers to an + // already defined message + // + if (message.isUndefined()) { + throw new IOException( + "<input ..>, <output ..> or <fault ..> in <portType> with undefined message found. message name is '" + + message.getQName().toString() + + "'" + ); + } + } + + + /** + * ensures that an an element <code><operation></code> within + * an element <code><portType><code> is valid. Throws an exception + * if the operation is not valid. + * + * <strong>Note</strong>: this method should throw a <code>javax.wsdl.WSDLException</code> + * rather than a <code>java.io.IOException</code> + * + * @param operation the operation element + * + * @exception IOException thrown, if the element is not valid. + * @exception IllegalArgumentException thrown, if operation is null + */ + protected void ensureOperationValid(Operation operation) throws IOException { + + if (operation == null) { + throw new IllegalArgumentException("parameter 'operation' must not be null"); + } + + Input input = operation.getInput(); + if (input != null) { + ensureOperationMessageValid(input.getMessage()); + } + + Output output = operation.getOutput(); + if (output != null) { + ensureOperationMessageValid(output.getMessage()); + } + + Map faults = operation.getFaults(); + if (faults != null) { + Iterator it = faults.values().iterator(); + while(it.hasNext()) { + ensureOperationMessageValid( + ((Fault)it.next()).getMessage() + ); + } + } + } + + /** + * ensures that an an element <code><portType></code> + * is valid. Throws an exception if the portType is not valid. + * + * <strong>Note</strong>: this method should throw a <code>javax.wsdl.WSDLException</code> + * rather than a <code>java.io.IOException</code> + * + * @param portType the portType element + * + * @exception IOException thrown, if the element is not valid. + * @exception IllegalArgumentException thrown, if operation is null + */ + + protected void ensureOperationsOfPortTypeValid(PortType portType) throws IOException { + if (portType == null) + throw new IllegalArgumentException("parameter 'portType' must not be null"); + + List operations = portType.getOperations(); + + // no operations defined ? -> valid according to the WSDL 1.1 schema + // + if (operations == null || operations.size() == 0) return; + + // check operations defined in this portType + // + Iterator it = operations.iterator(); + while(it.hasNext()) { + Operation operation = (Operation)it.next(); + ensureOperationValid(operation); + } + } + /** * Populate the symbol table with all of the PortTypeEntry's from the Definition. */ @@ -1034,15 +1150,18 @@ while (i.hasNext()) { PortType portType = (PortType) i.next(); + // If the portType is undefined, then we're parsing a Definition // that didn't contain a portType, merely a binding that referred // to a non-existent port type. Don't bother with it. if (!portType.isUndefined()) { + ensureOperationsOfPortTypeValid(portType); PortTypeEntry ptEntry = new PortTypeEntry(portType); symbolTablePut(ptEntry); - } + } } } // populatePortTypes + /** * Create the parameters and store them in the bindingEntry. @@ -1947,9 +2066,76 @@ } ServiceEntry sEntry = new ServiceEntry(service); - symbolTablePut(sEntry); + symbolTablePut(sEntry); + populatePorts(service.getPorts()); } } // populateServices + + + /** + * populates the symbol table with port elements defined within a <service> + * element. + * + * @param ports a map of name->port pairs (i.e. what is returned by service.getPorts() + * + * @exception IOException thrown, if an IO or WSDL error is detected + * @see javax.wsdl.Service#getPorts() + * @see javax.wsdl.Port + */ + private void populatePorts(Map ports) throws IOException { + if (ports == null) return; + Iterator it = ports.values().iterator(); + while(it.hasNext()) { + + Port port = (Port)it.next(); + String portName = port.getName(); + Binding portBinding = port.getBinding(); + + // make sure there is a port name. The 'name' attribute for WSDL ports is + // mandatory + // + if (portName == null){ + //REMIND: should rather be a javax.wsdl.WSDLException ? + throw new IOException( + Messages.getMessage("missingPortNameException") + ); + } + + // make sure there is a binding for the port. The 'binding' attribute for + // WSDL ports is mandatory + // + if (portBinding == null) { + //REMIND: should rather be a javax.wsdl.WSDLException ? + throw new IOException( + Messages.getMessage("missingBindingException") + ); + } + + // make sure the port name is unique among all port names defined in this + // WSDL document. + // + // NOTE: there's a flaw in com.ibm.wsdl.xml.WSDLReaderImpl#parsePort() and + // com.ibm.wsdl.xml.WSDLReaderImpl#addPort(). These methods do not enforce + // the port name exists and is unique. Actually, if two port definitions with + // the same name exist within the same service element, only *one* port + // element is present after parsing and the following exception is not thrown. + // + // If two ports with the same name exist in different service elements, + // the exception below is thrown. This is conformant to the WSDL 1.1 spec (sec 2.6) + // , which states: "The name attribute provides a unique name among all ports + // defined within in the enclosing WSDL document." + // + // + if (existsPortWithName(new QName(portName))) { + //REMIND: should rather be a javax.wsdl.WSDLException ? + throw new IOException( + Messages.getMessage("twoPortsWithSameName", portName) + ); + } + PortEntry portEntry = new PortEntry(port); + symbolTablePut(portEntry); + } + } /** * Set each SymTabEntry's isReferenced flag. The default is false. If no other symbol @@ -2356,6 +2542,30 @@ } } // symbolTablePut + + /** + * checks whether there exists a WSDL port with a given name in the current + * symbol table + * + * @param name the QName of the port. Note: only the local part of the qname is relevant, + * since port names are not qualified with a namespace. They are of type nmtoken in WSDL 1.1 + * and of type ncname in WSDL 1.2 + * + * @return true, if there is a port element with the specified name; false, otherwise + */ + protected boolean existsPortWithName(QName name) { + Vector v = (Vector)symbolTable.get(name); + if (v == null) return false; + Iterator it = v.iterator(); + while(it.hasNext()) { + Object o = it.next(); + if (o instanceof PortEntry) return true; + } + return false; + } + + + private static QName getInnerCollectionComponentQName(Node node) { if (node == null) { return null; @@ -2394,4 +2604,5 @@ } return null; } + } // class SymbolTable 1.1 xml-axis/java/src/org/apache/axis/wsdl/symbolTable/PortEntry.java Index: PortEntry.java =================================================================== /* * The Apache Software License, Version 1.1 * * * Copyright (c) 2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Axis" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ package org.apache.axis.wsdl.symbolTable; import javax.wsdl.Port; import javax.xml.namespace.QName; /** * This class represents the symbol table entry for a WSDL port. * * @author <a href="mailto:[EMAIL PROTECTED]">Karl Guggisberg</a> * */ public class PortEntry extends SymTabEntry { /** the WSDL port element represented by this symbol table entry */ private Port port = null; /** * constructor * * @param port the WSDL port element */ public PortEntry(Port port) { super(new QName(port.getName())); this.port = port; } /** * replies the WSDL port element represented by this symbol table entry * * @return the WSDL port element represented by this symbol table entry */ public Port getPort() { return port; } } 1.40 +3 -0 xml-axis/java/src/org/apache/axis/i18n/resource.properties Index: resource.properties =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/i18n/resource.properties,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- resource.properties 30 Dec 2002 18:05:42 -0000 1.39 +++ resource.properties 3 Jan 2003 14:23:10 -0000 1.40 @@ -1087,3 +1087,6 @@ nsToPkgFileLoaded00=INFO: Loaded namespace-to-package mapping file "{0}". nsToPkgDefaultFileLoaded00=INFO: Loaded default namespace-to-package mapping file "{0}" as java resource. nsToPkgDefaultFileNotFound00=WARNING: Unable to open default namespace-to-package mapping file "{0}". Using default mappings. +missingPortNameException=No name defined for <port> element. Hint: add an attribute "name" to the port definition, i.e. <port name="..."> +missingBindingException=No binding defined for <port> element. Hint: add an attribute "binding" to he port definition, i.e. <port binding="..."> +twoPortsWithSameName=Two <port> elements with the same name "{0}" found. Hint: choose unique names among all port elements in a WSDL document. \ No newline at end of file