Author: darran.lofthouse(a)jboss.com
Date: 2007-01-12 09:57:54 -0500 (Fri, 12 Jan 2007)
New Revision: 1946
Added:
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/Person.java
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/PhoneBook_PortType.java
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/TelephoneNumber.java
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/Wrapped.wsdl
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/wrapped-mapping.xml
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/wstools-config.xml
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/WSDLToJava.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/helpers/ReturnTypeUnwrapper.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/tools/jbws1260/JBWS1260TestCase.java
Log:
JBWS-1260 - Added JAX-RPC spec section numbers to exceptions thrown.
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/WSDLToJava.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2007-01-12
13:49:58 UTC (rev 1945)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2007-01-12
14:57:54 UTC (rev 1946)
@@ -412,13 +412,13 @@
{
int inputs = in.getWsdlOperation().getInputs().length;
if (inputs > 1)
- throw new WSException("Can not unwrap parameters for operation with
mutliple inputs. inputs=" + inputs);
+ throw new WSException("[JAX-RPC - 2.3.1.2] Can not unwrap parameters for
operation with mutliple inputs. inputs=" + inputs);
String operationName = in.getWsdlOperation().getName().toString();
String elementName = in.getElement().getLocalPart();
if (elementName.equals(operationName) == false)
- throw new WSException("Unable to unwrap parameters, wrapper element name
must match operation name. operationName=" + operationName + "
elementName="
+ throw new WSException("[JAX-RPC - 2.3.1.2] Unable to unwrap parameters,
wrapper element name must match operation name. operationName=" + operationName +
" elementName="
+ elementName);
wrapped = unwrapElementParameters(buf, containingElement, xt);
@@ -446,7 +446,7 @@
boolean hasAttributes = wrapper.getAttributeUses().getLength() > 0;
if (hasAttributes)
- throw new WSException("Can not unwrap, complex type contains
attributes.");
+ throw new WSException("[JAX-RPC 2.3.1.2] Can not unwrap, complex type
contains attributes.");
boolean unwrappedElement = false;
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/helpers/ReturnTypeUnwrapper.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/helpers/ReturnTypeUnwrapper.java 2007-01-12
13:49:58 UTC (rev 1945)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/helpers/ReturnTypeUnwrapper.java 2007-01-12
14:57:54 UTC (rev 1946)
@@ -63,13 +63,13 @@
XSTypeDefinition xt = xsmodel.getTypeDefinition(xmlType.getLocalPart(),
xmlType.getNamespaceURI());
if (xt instanceof XSComplexTypeDefinition == false)
- throw new WSException("Tried to unwrap a non-complex type.");
+ throw new WSException("[JAX-RPC 2.3.1.2] Tried to unwrap a non-complex
type.");
XSComplexTypeDefinition wrapper = (XSComplexTypeDefinition)xt;
boolean hasAttributes = wrapper.getAttributeUses().getLength() > 0;
if (hasAttributes)
- throw new WSException("Can not unwrap, complex type contains
attributes.");
+ throw new WSException("[JAX-RPC 2.3.1.2] Can not unwrap, complex type
contains attributes.");
boolean unwrapped = false;
@@ -79,7 +79,7 @@
XSTerm term = particle.getTerm();
if (term instanceof XSModelGroup == false)
- throw new WSException("Expected model group, could not unwrap");
+ throw new WSException("[JAX-RPC 2.3.1.2] Expected model group, could not
unwrap");
XSModelGroup group = (XSModelGroup)term;
@@ -115,7 +115,7 @@
}
else
{
- throw new WSException("Unable to unwrap model group with multiple
particles.");
+ throw new WSException("[JAX-RPC 2.3.1.2] Unable to unwrap model group with
multiple particles.");
}
return unwrappedElement != null;
Modified:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/tools/jbws1260/JBWS1260TestCase.java
===================================================================
---
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/tools/jbws1260/JBWS1260TestCase.java 2007-01-12
13:49:58 UTC (rev 1945)
+++
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/tools/jbws1260/JBWS1260TestCase.java 2007-01-12
14:57:54 UTC (rev 1946)
@@ -841,6 +841,33 @@
{
}
}
+
+ /**
+ * Test scenario where unwrapping should not occur as thre are
+ * multiple parts in each message.
+ *
+ * <message name='PhoneBook_lookup'>
+ * <part element='ns1:lookup' name='parameters'/>
+ * <part element='ns1:anotherPerson' name='anotherPerson'/>
+ * </message>
+ *
+ * <message name='PhoneBook_lookupResponse'>
+ * <part element='ns1:lookupResponse' name='result'/>
+ * <part element='ns1:anotherResponse'
name='anotherTelephoneNumber'/>
+ * </message>
+ *
+ */
+ public void testScenario_AH() throws Exception
+ {
+ try
+ {
+ generateScenario("AH");
+ fail("Expected exception not thrown.");
+ }
+ catch (WSException e)
+ {
+ }
+ }
protected void generateScenario(final String scenario) throws Exception
{
Added: trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/Person.java
===================================================================
---
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/Person.java 2007-01-12
13:49:58 UTC (rev 1945)
+++
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/Person.java 2007-01-12
14:57:54 UTC (rev 1946)
@@ -0,0 +1,26 @@
+// This class was generated by the JAXRPC SI, do not edit.
+// Contents subject to change without notice.
+// JAX-RPC Standard Implementation (1.1.3, build R1)
+// Generated source version: 1.1.3
+
+package org.jboss.test.ws.jbws1260;
+
+
+public class Person {
+ protected java.lang.String surname;
+
+ public Person() {
+ }
+
+ public Person(java.lang.String surname) {
+ this.surname = surname;
+ }
+
+ public java.lang.String getSurname() {
+ return surname;
+ }
+
+ public void setSurname(java.lang.String surname) {
+ this.surname = surname;
+ }
+}
Property changes on:
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/Person.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/PhoneBook_PortType.java
===================================================================
---
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/PhoneBook_PortType.java 2007-01-12
13:49:58 UTC (rev 1945)
+++
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/PhoneBook_PortType.java 2007-01-12
14:57:54 UTC (rev 1946)
@@ -0,0 +1,11 @@
+// This class was generated by the JAXRPC SI, do not edit.
+// Contents subject to change without notice.
+// JAX-RPC Standard Implementation (1.1.3, build R1)
+// Generated source version: 1.1.3
+
+package org.jboss.test.ws.jbws1260;
+
+public interface PhoneBook_PortType extends java.rmi.Remote {
+ public void lookup(org.jboss.test.ws.jbws1260.Person parameters,
org.jboss.test.ws.jbws1260.Person anotherPerson,
org.jboss.test.ws.jbws1260.holders.TelephoneNumberHolder result,
org.jboss.test.ws.jbws1260.holders.TelephoneNumberHolder anotherTelephoneNumber) throws
+ java.rmi.RemoteException;
+}
Property changes on:
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/PhoneBook_PortType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/TelephoneNumber.java
===================================================================
---
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/TelephoneNumber.java 2007-01-12
13:49:58 UTC (rev 1945)
+++
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/TelephoneNumber.java 2007-01-12
14:57:54 UTC (rev 1946)
@@ -0,0 +1,26 @@
+// This class was generated by the JAXRPC SI, do not edit.
+// Contents subject to change without notice.
+// JAX-RPC Standard Implementation (1.1.3, build R1)
+// Generated source version: 1.1.3
+
+package org.jboss.test.ws.jbws1260;
+
+
+public class TelephoneNumber {
+ protected java.lang.String number;
+
+ public TelephoneNumber() {
+ }
+
+ public TelephoneNumber(java.lang.String number) {
+ this.number = number;
+ }
+
+ public java.lang.String getNumber() {
+ return number;
+ }
+
+ public void setNumber(java.lang.String number) {
+ this.number = number;
+ }
+}
Property changes on:
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/TelephoneNumber.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/Wrapped.wsdl
===================================================================
---
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/Wrapped.wsdl 2007-01-12
13:49:58 UTC (rev 1945)
+++
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/Wrapped.wsdl 2007-01-12
14:57:54 UTC (rev 1946)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='PhoneBook'
targetNamespace='http://test.jboss.org/ws/jbws1260'
xmlns='http://schemas.xmlsoap.org/wsdl/'
xmlns:ns1='http://test.jboss.org/ws/jbws1260/types'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:tns='http://test.jboss.org/ws/jbws1260'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types>
+ <schema
targetNamespace='http://test.jboss.org/ws/jbws1260/types'
xmlns='http://www.w3.org/2001/XMLSchema'
xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:tns='http://test.jboss.org/ws/jbws1260/types'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+
+ <complexType name='Person'>
+ <sequence>
+ <element name='surname' nillable='true'
type='string'/>
+ </sequence>
+ </complexType>
+
+ <complexType name='TelephoneNumber'>
+ <sequence>
+ <element name='number' nillable='true'
type='string'/>
+ </sequence>
+ </complexType>
+
+ <element name='lookupPerson' type='tns:Person'/>
+ <element name='anotherPerson' type='tns:Person'/>
+ <element name='lookupResponse' type='tns:TelephoneNumber'/>
+ <element name='anotherResponse' type='tns:TelephoneNumber'/>
+ </schema>
+ </types>
+ <message name='PhoneBook_lookup'>
+ <part element='ns1:lookupPerson' name='parameters'/>
+ <part element='ns1:anotherPerson' name='anotherPerson'/>
+ </message>
+ <message name='PhoneBook_lookupResponse'>
+ <part element='ns1:lookupResponse' name='result'/>
+ <part element='ns1:anotherResponse'
name='anotherTelephoneNumber'/>
+ </message>
+ <portType name='PhoneBook'>
+ <operation name='lookup'>
+ <input message='tns:PhoneBook_lookup'/>
+ <output message='tns:PhoneBook_lookupResponse'/>
+ </operation>
+ </portType>
+ <binding name='PhoneBookBinding' type='tns:PhoneBook'>
+ <soap:binding style='document'
transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='lookup'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='PhoneBook'>
+ <port binding='tns:PhoneBookBinding' name='PhoneBookPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on:
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/Wrapped.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/wrapped-mapping.xml
===================================================================
---
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/wrapped-mapping.xml 2007-01-12
13:49:58 UTC (rev 1945)
+++
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/wrapped-mapping.xml 2007-01-12
14:57:54 UTC (rev 1946)
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<java-wsdl-mapping
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1"
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.jbws1260</package-type>
+ <
namespaceURI>http://test.jboss.org/ws/jbws1260</namespaceURI>
+ </package-mapping>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbws1260</package-type>
+ <
namespaceURI>http://test.jboss.org/ws/jbws1260/types</namespaceURI>
+ </package-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1260.TelephoneNumber</java-type>
+ <root-type-qname
xmlns:typeNS="http://test.jboss.org/ws/jbws1260/types">typeN...
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>number</java-variable-name>
+ <xml-element-name>number</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1260.Person</java-type>
+ <root-type-qname
xmlns:typeNS="http://test.jboss.org/ws/jbws1260/types">typeN...
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>surname</java-variable-name>
+ <xml-element-name>surname</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <service-interface-mapping>
+
<service-interface>org.jboss.test.ws.jbws1260.PhoneBook_Service</service-interface>
+ <wsdl-service-name
xmlns:serviceNS="http://test.jboss.org/ws/jbws1260">serviceN...
+ <port-mapping>
+ <port-name>PhoneBookPort</port-name>
+ <java-port-name>PhoneBookPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+
<service-endpoint-interface>org.jboss.test.ws.jbws1260.PhoneBook_PortType</service-endpoint-interface>
+ <wsdl-port-type
xmlns:portTypeNS="http://test.jboss.org/ws/jbws1260">portTyp...
+ <wsdl-binding
xmlns:bindingNS="http://test.jboss.org/ws/jbws1260">bindingN...
+ <service-endpoint-method-mapping>
+ <java-method-name>lookup</java-method-name>
+ <wsdl-operation>lookup</wsdl-operation>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>org.jboss.test.ws.jbws1260.Person</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message
xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws1260">wsdlMsgN...
+ <wsdl-message-part-name>parameters</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>org.jboss.test.ws.jbws1260.Person</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message
xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws1260">wsdlMsgN...
+ <wsdl-message-part-name>anotherPerson</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <method-param-parts-mapping>
+ <param-position>2</param-position>
+ <param-type>org.jboss.test.ws.jbws1260.TelephoneNumber</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message
xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws1260">wsdlMsgN...
+ <wsdl-message-part-name>result</wsdl-message-part-name>
+ <parameter-mode>OUT</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <method-param-parts-mapping>
+ <param-position>3</param-position>
+ <param-type>org.jboss.test.ws.jbws1260.TelephoneNumber</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message
xmlns:wsdlMsgNS="http://test.jboss.org/ws/jbws1260">wsdlMsgN...
+
<wsdl-message-part-name>anotherTelephoneNumber</wsdl-message-part-name>
+ <parameter-mode>OUT</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
Property changes on:
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/wrapped-mapping.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/wstools-config.xml
===================================================================
---
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/wstools-config.xml 2007-01-12
13:49:58 UTC (rev 1945)
+++
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/wstools-config.xml 2007-01-12
14:57:54 UTC (rev 1946)
@@ -0,0 +1,5 @@
+<configuration>
+ <wsdl-java location="resources/tools/jbws1260/scenario_AH/Wrapped.wsdl"
parameter-style="wrapped">
+ <mapping file="wrapped-mapping.xml"/>
+ </wsdl-java>
+</configuration>
Property changes on:
trunk/jbossws-tests/src/main/resources/tools/jbws1260/scenario_AH/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF