Author: darran.lofthouse(a)jboss.com
Date: 2008-07-17 11:45:20 -0400 (Thu, 17 Jul 2008)
New Revision: 7844
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/tools/jbpapp921/jaxrpc-mapping.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/tools/jbpapp921/webservices.xml
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/WSDLToJava.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/jbpapp921/JBPAPP921TestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/validation/JaxrpcMappingValidator.java
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/tools/jbpapp921/wstools-config.xml
Log:
[JBWS-2260] WSDL to Java, hyphen in PortType not being mapped correctly in generated
descriptors.
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/WSDLToJava.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2008-07-17
14:33:28 UTC (rev 7843)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2008-07-17
15:45:20 UTC (rev 7844)
@@ -655,7 +655,7 @@
private void createSEIFile(WSDLInterface intf, File loc) throws IOException
{
- String seiName =
ToolsUtils.convertInvalidCharacters(getServiceEndpointInterfaceName(intf));
+ String seiName = getServiceEndpointInterfaceName(intf);
StringBuilder buf = new StringBuilder();
utils.writeJbossHeader(buf);
@@ -680,6 +680,7 @@
seiName += "_PortType";
seiName = JavaUtils.capitalize(seiName);
+ seiName = ToolsUtils.convertInvalidCharacters(seiName);
return seiName;
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2008-07-17
14:33:28 UTC (rev 7843)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2008-07-17
15:45:20 UTC (rev 7844)
@@ -200,6 +200,7 @@
String javaPortName = utils.chopPortType(portName);
if (wsdlDefinitions.getService(javaPortName) != null)
javaPortName += "_PortType";
+ javaPortName = ToolsUtils.convertInvalidCharacters(javaPortName);
ServiceEndpointInterfaceMapping seim = new
ServiceEndpointInterfaceMapping(jwm);
String className = ToolsUtils.firstLetterUpperCase(javaPortName);
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/jbpapp921/JBPAPP921TestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/jbpapp921/JBPAPP921TestCase.java 2008-07-17
14:33:28 UTC (rev 7843)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/jbpapp921/JBPAPP921TestCase.java 2008-07-17
15:45:20 UTC (rev 7844)
@@ -22,12 +22,13 @@
package org.jboss.test.ws.tools.jbpapp921;
import java.io.File;
-import java.util.Arrays;
import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
import org.jboss.ws.tools.WSTools;
+import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.test.JBossWSTest;
+import org.w3c.dom.Element;
public class JBPAPP921TestCase extends JBossWSTest
{
@@ -36,11 +37,19 @@
public void testGenerate() throws Exception
{
- String realResourceDir =
getResourceFile("tools/jbpapp921").getAbsolutePath();
+ String realResourceDir =
getResourceFile("tools/jbpapp921").getAbsolutePath();
String[] args = new String[] { "-dest", toolsDir, "-config",
realResourceDir + "/wstools-config.xml" };
new WSTools().generate(args);
compareSource("Models_ServiceIM_ServiceProxyService.java");
compareSource("ValidationEvent_test.java");
+
+ JaxrpcMappingValidator mappingValidator = new JaxrpcMappingValidator();
+ File jaxrpcMapping = getResourceFile(resourceDir +
"/jaxrpc-mapping.xml");
+ mappingValidator.validate(jaxrpcMapping.getAbsolutePath(), toolsDir +
"/jaxrpc-mapping.xml");
+
+ Element exp = DOMUtils.parse(getResourceFile(resourceDir +
"/webservices.xml").toURL().openStream());
+ Element act = DOMUtils.parse(new File(toolsDir +
"/webservices.xml").toURL().openStream());
+ assertEquals(exp, act);
}
private void compareSource(final String fileName) throws Exception
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/validation/JaxrpcMappingValidator.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/validation/JaxrpcMappingValidator.java 2008-07-17
14:33:28 UTC (rev 7843)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/validation/JaxrpcMappingValidator.java 2008-07-17
15:45:20 UTC (rev 7844)
@@ -41,7 +41,6 @@
import org.jboss.ws.metadata.jaxrpcmapping.WsdlMessageMapping;
import org.jboss.ws.metadata.jaxrpcmapping.WsdlReturnValueMapping;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
-import org.jboss.wsf.test.JBossWSTest;
/**
* Validates a JAXRPC Mapping File against another
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/tools/jbpapp921/jaxrpc-mapping.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/tools/jbpapp921/jaxrpc-mapping.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/tools/jbpapp921/jaxrpc-mapping.xml 2008-07-17
15:45:20 UTC (rev 7844)
@@ -0,0 +1,46 @@
+<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping
version='1.1'
xmlns='http://java.sun.com/xml/ns/j2ee'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee
http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbpapp921</package-type>
+ <namespaceURI>http://org.jboss.test.ws.jbpapp921</namespaceURI>
+ </package-mapping>
+ <service-interface-mapping>
+
<service-interface>org.jboss.test.ws.jbpapp921.Models_ServiceIM_ServiceProxy</service-interface>
+ <wsdl-service-name
xmlns:serviceNS='http://org.jboss.test.ws.jbpapp921'>serviceNS:models_ServiceIM_ServiceProxy</wsdl-service-name>
+ <port-mapping>
+ <port-name>validationEventPort</port-name>
+ <java-port-name>validationEventPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+
<service-endpoint-interface>org.jboss.test.ws.jbpapp921.ValidationEvent_test</service-endpoint-interface>
+ <wsdl-port-type
xmlns:portTypeNS='http://org.jboss.test.ws.jbpapp921'>portTypeNS:validationEvent-test</wsdl-port-type>
+ <wsdl-binding
xmlns:bindingNS='http://org.jboss.test.ws.jbpapp921'>bindingNS:validationEventBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>validateClaim</java-method-name>
+ <wsdl-operation>validateClaim</wsdl-operation>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>java.lang.String</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message
xmlns:wsdlMsgNS='http://org.jboss.test.ws.jbpapp921'>wsdlMsgNS:ValidationEvent_validateClaim</wsdl-message>
+ <wsdl-message-part-name>lifecycleId</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <method-param-parts-mapping>
+ <param-position>1</param-position>
+ <param-type>java.lang.String</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message
xmlns:wsdlMsgNS='http://org.jboss.test.ws.jbpapp921'>wsdlMsgNS:ValidationEvent_validateClaim</wsdl-message>
+ <wsdl-message-part-name>claim</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <wsdl-return-value-mapping>
+ <method-return-value>int</method-return-value>
+ <wsdl-message
xmlns:wsdlMsgNS='http://org.jboss.test.ws.jbpapp921'>wsdlMsgNS:ValidationEvent_validateClaimResponse</wsdl-message>
+ <wsdl-message-part-name>result</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
\ No newline at end of file
Property changes on:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/tools/jbpapp921/jaxrpc-mapping.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/tools/jbpapp921/webservices.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/tools/jbpapp921/webservices.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/tools/jbpapp921/webservices.xml 2008-07-17
15:45:20 UTC (rev 7844)
@@ -0,0 +1,15 @@
+<webservices version='1.1'
xmlns='http://java.sun.com/xml/ns/j2ee'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee
http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'>
+ <webservice-description>
+
<webservice-description-name>models_ServiceIM_ServiceProxy</webservice-description-name>
+ <wsdl-file>WEB-INF/wsdl/test.wsdl</wsdl-file>
+ <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
+ <port-component>
+ <port-component-name>validationEventPort</port-component-name>
+ <wsdl-port
xmlns:portNS='http://org.jboss.test.ws.jbpapp921'>portNS:validationEventPort</wsdl-port>
+
<service-endpoint-interface>org.jboss.test.ws.jbpapp921.ValidationEvent_test</service-endpoint-interface>
+ <service-impl-bean>
+ <servlet-link>TestEndpoint</servlet-link>
+ </service-impl-bean>
+ </port-component>
+ </webservice-description>
+</webservices>
\ No newline at end of file
Property changes on:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/tools/jbpapp921/webservices.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/tools/jbpapp921/wstools-config.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/tools/jbpapp921/wstools-config.xml 2008-07-17
14:33:28 UTC (rev 7843)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/tools/jbpapp921/wstools-config.xml 2008-07-17
15:45:20 UTC (rev 7844)
@@ -1,4 +1,6 @@
<configuration>
<wsdl-java
location="@test.resources.directory(a)/tools/jbpapp921/test.wsdl">
+ <mapping file="jaxrpc-mapping.xml"/>
+ <webservices servlet-link="TestEndpoint" />
</wsdl-java>
</configuration>
\ No newline at end of file