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 sc...@apache.org on 2007/02/03 20:52:22 UTC
svn commit: r503294 - in /webservices/axis2/trunk/java/modules:
jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/
jaxws/src/org/apache/axis2/jaxws/message/impl/ jaxws/test-resources/wsdl/
jaxws/test/org/apache/axis2/jaxws/proxy/ jaxws/test/org/apac...
Author: scheu
Date: Sat Feb 3 11:52:21 2007
New Revision: 503294
URL: http://svn.apache.org/viewvc?view=rev&rev=503294
Log:
AXIS2-2103
Contributor: Rich Scheuerle
Miscellaneous RPC bug fixes
Modified:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartBase.java
webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/RPCLit.wsdl
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/RPCProxyTests.java
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/rpclit/META-INF/RPCLit.wsdl
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/rpclit/RPCLitImpl.java
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/rpclit/sei/RPCLit.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java?view=diff&rev=503294&r1=503293&r2=503294
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitBareMethodMarshaller.java Sat Feb 3 11:52:21 2007
@@ -84,7 +84,7 @@
}
// Unmarshall the ParamValues from the Message
- List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, message, packages, false, false);
+ List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, message, packages, false);
// Populate the response Holders
MethodMarshallerUtils.updateResponseSignatureArgs(pds, pvList, signatureArgs);
@@ -120,7 +120,7 @@
// Unmarshal the ParamValues from the message
- List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, message, packages, true, false);
+ List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, message, packages, true);
// Build the signature arguments
Object[] sigArguments = MethodMarshallerUtils.createRequestSignatureArgs(pds, pvList);
@@ -185,7 +185,7 @@
List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds,
signatureArgs,
false, // output
- false); // use name (element name) not wsd:part name
+ false, false);
// Put values onto the message
@@ -233,7 +233,7 @@
List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds,
signatureArguments,
true, // input
- false);// use name (element name) not wsd:part name
+ false, false);
// Put values onto the message
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java?view=diff&rev=503294&r1=503293&r2=503294
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedMethodMarshaller.java Sat Feb 3 11:52:21 2007
@@ -297,7 +297,7 @@
MethodMarshallerUtils.getPDElements(pds,
signatureArgs,
false, // output
- true); // use partNames (which are child names)
+ true, false);
// Now we want to create a single JAXB element that contains the
// ParameterValues. We will use the wrapper tool to do this.
@@ -392,7 +392,7 @@
List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds,
signatureArguments,
true, // input
- true); // use partName (which are the child element names)
+ true, false);
// Now we want to create a single JAXB element that contains the
// ParameterValues. We will use the wrapper tool to do this.
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java?view=diff&rev=503294&r1=503293&r2=503294
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/DocLitWrappedPlusMethodMarshaller.java Sat Feb 3 11:52:21 2007
@@ -395,7 +395,7 @@
MethodMarshallerUtils.getPDElements(pds,
signatureArgs,
false, // output
- true); // use partNames (which are child names)
+ true, false);
// Now we want to create a single JAXB element that contains the
// parameter values. We will use the wrapper tool to do this.
@@ -521,7 +521,7 @@
List<PDElement> pdeList = MethodMarshallerUtils.getPDElements(pds,
signatureArguments,
true, // input
- true); // use partName (which are the child element names)
+ true, false);
// Now we want to create a single JAXB element that contains the
// ParameterValues. We will use the wrapper tool to do this.
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java?view=diff&rev=503294&r1=503293&r2=503294
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java Sat Feb 3 11:52:21 2007
@@ -83,11 +83,11 @@
* @param params ParameterDescription for this operation
* @param sigArguments arguments
* @param isInput indicates if input or output params(input args on client, output args on server)
- * @param usePartName indicates whether to use the partName or name for the name of the xml element
- * partName is used for RPC and doc/lit wrapped, name is used for doc/lit bare
+ * @param isDocLitWrapped
+ * @param isRPC
* @return PDElements
*/
- static List<PDElement> getPDElements(ParameterDescription[] params, Object[] sigArguments, boolean isInput, boolean usePartName) {
+ static List<PDElement> getPDElements(ParameterDescription[] params, Object[] sigArguments, boolean isInput, boolean isDocLitWrapped, boolean isRPC) {
List<PDElement> pvList = new ArrayList<PDElement>();
int index = 0;
@@ -118,8 +118,27 @@
// If this value is element enabled, then we are okay
// Otherwise make an element enabled value
if (!XMLRootElementUtil.isElementEnabled(formalType)) {
- String localName = (usePartName) ? pd.getPartName() : pd.getParameterName();
- value = XMLRootElementUtil.getElementEnabledObject(pd.getTargetNamespace(), localName, formalType, value);
+
+ // The namespace and local name are obtained differently depending on the style/use and header
+ String localName = "";
+ String uri = "";
+ if (pd.isHeader()) {
+ // Headers (even rpc) are marshalled with the name defined by the element= attribute on the wsd:part
+ localName = pd.getParameterName();
+ uri = pd.getTargetNamespace();
+
+ } else if (isDocLitWrapped) {
+ // For doc/lit wrapped, the localName comes from the PartName
+ localName = pd.getPartName();
+ uri = pd.getTargetNamespace();
+ } else if (isRPC) {
+ localName = pd.getPartName();
+ uri = ""; // Per WSI-BP, the namespace uri is unqualified
+ } else {
+ localName = pd.getParameterName();
+ uri = pd.getTargetNamespace();
+ }
+ value = XMLRootElementUtil.getElementEnabledObject(uri, localName, formalType, value);
}
// The object is now ready for marshalling
@@ -138,14 +157,12 @@
* @param message Message
* @param packages set of packages needed to unmarshal objects for this operation
* @param isInput indicates if input or output params (input on server, output on client)
- * @param usePartName indicates whether to use the partName or name for the name of the xml element
* @return ParamValues
*/
static List<PDElement> getPDElements(ParameterDescription[] params,
Message message,
Set<String> packages,
- boolean isInput,
- boolean usePartName) throws XMLStreamException {
+ boolean isInput) throws XMLStreamException {
List<PDElement> pdeList = new ArrayList<PDElement>();
@@ -191,7 +208,8 @@
if (pd.isHeader()) {
// Get the Block from the header
- String localName = (usePartName) ? pd.getPartName() : pd.getParameterName();
+ // NOTE The parameter name is always used to get the header element...even if the style is RPC.
+ String localName = pd.getParameterName();
block = message.getHeaderBlock(pd.getTargetNamespace(), localName, context, factory);
} else {
if (totalBodyBlocks > 1) {
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java?view=diff&rev=503294&r1=503293&r2=503294
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/RPCLitMethodMarshaller.java Sat Feb 3 11:52:21 2007
@@ -66,7 +66,7 @@
// ..
// <soapenv:body>
// <m:op xmlns:m="urn://api">
- // <m:param xsi:type="data:foo" xmlns:data="urn://mydata" >...</m:param>
+ // <param xsi:type="data:foo" >...</param>
// </m:op>
// </soapenv:body>
//
@@ -75,8 +75,8 @@
// wsdl operation.
// 2) The data blocks are located underneath the operation element. (In doc/lit
// the data elements are underneath the body.
- // 3) The name of the data blocks (m:param) are defined by the wsdl:part not the
- // schema.
+ // 3) The name of the data blocks (param) are defined by the wsdl:part not the
+ // schema. Note that the param is unqualified...per WS-I BP.
// 4) The type of the data block (data:foo) is defined by schema (thus there is
// JAXB type rendering. Since we are using JAXB to marshal the data,
// we always generate an xsi:type attribute. This is an implemenation detail
@@ -87,17 +87,19 @@
ParameterDescription[] pds =operationDesc.getParameterDescriptions();
Set<String> packages = endpointDesc.getPackages();
+ // TODO This needs more work. We need to check inside holders of input params. We also
+ // may want to exclude header params from this check
//Validate input parameters for operation and make sure no input parameters are null.
//As per JAXWS Specification section 3.6.2.3 if a null value is passes as an argument
//to a method then an implementation MUST throw WebServiceException.
if(pds.length > 0){
if(signatureArguments == null){
- throw ExceptionFactory.makeWebServiceException(Messages.getMessage("RPCLitMethodMarshallerErr1"));
+ throw ExceptionFactory.makeWebServiceException(Messages.getMessage("RPCLitMethodMarshallerErr1", "Input"));
}
if(signatureArguments !=null){
for(Object argument:signatureArguments){
if(argument == null){
- throw ExceptionFactory.makeWebServiceException(Messages.getMessage("RPCLitMethodMarshallerErr1"));
+ throw ExceptionFactory.makeWebServiceException(Messages.getMessage("RPCLitMethodMarshallerErr1", "Input"));
}
}
}
@@ -110,7 +112,7 @@
// Indicate the style and operation element name. This triggers the message to
// put the data blocks underneath the operation element
m.setStyle(Style.RPC);
- m.setOperationElement(operationDesc.getName());
+ m.setOperationElement(getRPCOperationQName(operationDesc));
// The input object represent the signature arguments.
// Signature arguments are both holders and non-holders
@@ -119,7 +121,7 @@
MethodMarshallerUtils.getPDElements(pds,
signatureArguments,
true, // input
- true); // use partName since this is rpc/lit
+ false, true); // use partName since this is rpc/lit
// Put values onto the message
@@ -143,7 +145,7 @@
// ..
// <soapenv:body>
// <m:op xmlns:m="urn://api">
- // <m:param xsi:type="data:foo" xmlns:data="urn://mydata" >...</m:param>
+ // <param xsi:type="data:foo" >...</param>
// </m:op>
// </soapenv:body>
//
@@ -152,8 +154,8 @@
// wsdl operation.
// 2) The data blocks are located underneath the operation element. (In doc/lit
// the data elements are underneath the body.
- // 3) The name of the data blocks (m:param) are defined by the wsdl:part not the
- // schema.
+ // 3) The name of the data blocks (param) are defined by the wsdl:part not the
+ // schema. Note that it is unqualified per WSI-BP
// 4) The type of the data block (data:foo) is defined by schema (thus there is
// JAXB type rendering.
// 5) We always send an xsi:type, but other vendor's may not.
@@ -166,11 +168,24 @@
message.setStyle(Style.RPC);
// Unmarshal the ParamValues from the Message
- List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, message, packages, true, true);
+ List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, message, packages, true);
// Build the signature arguments
Object[] sigArguments = MethodMarshallerUtils.createRequestSignatureArgs(pds, pvList);
+
+ // TODO This needs more work. We need to check inside holders of input params. We also
+ // may want to exclude header params from this check
+ //Validate input parameters for operation and make sure no input parameters are null.
+ //As per JAXWS Specification section 3.6.2.3 if a null value is passes as an argument
+ //to a method then an implementation MUST throw WebServiceException.
+ if(sigArguments !=null){
+ for(Object argument:sigArguments){
+ if(argument == null){
+ throw ExceptionFactory.makeWebServiceException(Messages.getMessage("RPCLitMethodMarshallerErr1", "Input"));
+ }
+ }
+ }
return sigArguments;
} catch(Exception e) {
throw ExceptionFactory.makeWebServiceException(e);
@@ -183,6 +198,7 @@
OperationDescription operationDesc, Protocol protocol)
throws WebServiceException {
+
EndpointInterfaceDescription ed = operationDesc.getEndpointInterfaceDescription();
EndpointDescription endpointDesc = ed.getEndpointDescription();
// We want to respond with the same protocol as the request,
@@ -202,7 +218,7 @@
// ..
// <soapenv:body>
// <m:opResponse xmlns:m="urn://api">
- // <m:param xsi:type="data:foo" xmlns:data="urn://mydata" >...</m:param>
+ // <param xsi:type="data:foo" >...</param>
// </m:op>
// </soapenv:body>
//
@@ -211,8 +227,8 @@
// wsdl operation.
// 2) The data blocks are located underneath the operation element. (In doc/lit
// the data elements are underneath the body.
- // 3) The name of the data blocks (m:param) are defined by the wsdl:part not the
- // schema.
+ // 3) The name of the data blocks (param) are defined by the wsdl:part not the
+ // schema. Note that it is unqualified.
// 4) The type of the data block (data:foo) is defined by schema (thus there is
// JAXB type rendering. Since we are using JAXB to marshal the data,
// we always generate an xsi:type attribute. This is an implemenation detail
@@ -231,17 +247,37 @@
m.setStyle(Style.RPC);
// TODO Is there an annotation for the operation element response ?
- String localPart = operationDesc.getName().getLocalPart() + "Response";
- QName responseOp = new QName(operationDesc.getName().getNamespaceURI(), localPart);
+ QName rpcOpQName = getRPCOperationQName(operationDesc);
+ String localPart = rpcOpQName.getLocalPart() + "Response";
+ QName responseOp = new QName(rpcOpQName.getNamespaceURI(), localPart, rpcOpQName.getPrefix());
m.setOperationElement(responseOp);
// Put the return object onto the message
Class returnType = operationDesc.getResultActualType();
+ String returnNS = null;
+ String returnLocalPart = null;
+ if (operationDesc.isResultHeader()) {
+ returnNS = operationDesc.getResultTargetNamespace();
+ returnLocalPart = operationDesc.getResultName();
+ } else {
+ returnNS = ""; // According to WSI BP the body part is unqualified
+ returnLocalPart = operationDesc.getResultPartName();
+ }
+
if (returnType != void.class) {
+
+ // TODO should we allow null if the return is a header?
+ //Validate input parameters for operation and make sure no input parameters are null.
+ //As per JAXWS Specification section 3.6.2.3 if a null value is passes as an argument
+ //to a method then an implementation MUST throw WebServiceException.
+ if(returnObject == null){
+ throw ExceptionFactory.makeWebServiceException(Messages.getMessage("RPCLitMethodMarshallerErr1", "Return"));
+ }
+
MethodMarshallerUtils.toMessage(returnObject,
returnType,
- operationDesc.getResultTargetNamespace(),
- operationDesc.getResultPartName(),
+ returnNS,
+ returnLocalPart,
packages,
m,
true, // forceXSI since this is rpc/lit
@@ -253,8 +289,9 @@
MethodMarshallerUtils.getPDElements(pds,
signatureArgs,
false, // output
- true); // use partName since this is rpc/lit
+ false, true); // use partName since this is rpc/lit
+ // TODO Should we check for null output body values? Should we check for null output header values ?
// Put values onto the message
MethodMarshallerUtils.toMessage(pvList, m, packages, true);
@@ -277,7 +314,7 @@
// ..
// <soapenv:body>
// <m:opResponse xmlns:m="urn://api">
- // <m:param xsi:type="data:foo" xmlns:data="urn://mydata" >...</m:param>
+ // <param xsi:type="data:foo" >...</param>
// </m:op>
// </soapenv:body>
//
@@ -286,8 +323,8 @@
// wsdl operation.
// 2) The data blocks are located underneath the operation element. (In doc/lit
// the data elements are underneath the body.
- // 3) The name of the data blocks (m:param) are defined by the wsdl:part not the
- // schema.
+ // 3) The name of the data blocks (param) are defined by the wsdl:part not the
+ // schema. Note that it is unqualified per WSI-BP
// 4) The type of the data block (data:foo) is defined by schema (thus there is
// JAXB type rendering.
// 5) We always send an xsi:type, but other vendor's may not.
@@ -310,10 +347,19 @@
} else {
returnValue = MethodMarshallerUtils.getReturnValue(packages, message, returnType, false, null, null);
}
+ // TODO should we allow null if the return is a header?
+ //Validate input parameters for operation and make sure no input parameters are null.
+ //As per JAXWS Specification section 3.6.2.3 if a null value is passes as an argument
+ //to a method then an implementation MUST throw WebServiceException.
+ if (returnValue == null){
+ throw ExceptionFactory.makeWebServiceException(Messages.getMessage("RPCLitMethodMarshallerErr1", "Return"));
+ }
}
// Unmarshall the ParamValues from the Message
- List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, message, packages, false, true);
+ List<PDElement> pvList = MethodMarshallerUtils.getPDElements(pds, message, packages, false);
+
+ // TODO Should we check for null output body values? Should we check for null output header values ?
// Populate the response Holders
MethodMarshallerUtils.updateResponseSignatureArgs(pds, pvList, signatureArgs);
@@ -370,6 +416,25 @@
} catch(Exception e) {
throw ExceptionFactory.makeWebServiceException(e);
}
+ }
+
+ /**
+ * @param opDesc
+ * @return qualified qname to use in the rpc message to represent the operation
+ * (per WSI BP)
+ */
+ private static QName getRPCOperationQName(OperationDescription opDesc) {
+ QName qName = opDesc.getName();
+
+ String localPart = qName.getLocalPart();
+ String uri = (qName.getNamespaceURI().length() == 0) ?
+ opDesc.getEndpointInterfaceDescription().getTargetNamespace() :
+ qName.getNamespaceURI();
+ String prefix = "rpcOp"; // Prefer using an actual prefix
+
+
+ qName = new QName(uri, localPart, prefix);
+ return qName;
}
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartBase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartBase.java?view=diff&rev=503294&r1=503293&r2=503294
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartBase.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/XMLPartBase.java Sat Feb 3 11:52:21 2007
@@ -495,7 +495,9 @@
*/
public Block getHeaderBlock(String namespace, String localPart, Object context, BlockFactory blockFactory) throws WebServiceException {
Block block = getContentAsXMLSpine().getHeaderBlock(namespace, localPart, context, blockFactory);
- block.setParent(getParent());
+ if (block != null) {
+ block.setParent(getParent());
+ }
return block;
}
Modified: webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/RPCLit.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/RPCLit.wsdl?view=diff&rev=503294&r1=503293&r2=503294
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/RPCLit.wsdl (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/RPCLit.wsdl Sat Feb 3 11:52:21 2007
@@ -85,6 +85,9 @@
<xsd:element name="myEnumList2" type="impl:EnumList2"/>
</xsd:all>
</xsd:complexType>
+
+ <xsd:element name="headerParam" type="xsd:string" />
+ <xsd:element name="headerReturn" type="xsd:string" />
</schema>
</wsdl:types>
@@ -223,6 +226,19 @@
<wsdl:part name="simple2Out" type="xsd:string"/>
</wsdl:message>
+
+ <wsdl:message name="testHeaderRequest">
+
+ <wsdl:part name="bodyParam" type="xsd:string"/>
+ <wsdl:part name="headerParam" element="impl:headerParam"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="testHeaderResponse">
+
+ <wsdl:part name="headerReturn" element="impl:headerReturn"/>
+
+ </wsdl:message>
@@ -244,6 +260,14 @@
<wsdl:output message="impl:testSimple2Response" name="testSimple2Response"/>
</wsdl:operation>
+
+ <wsdl:operation name="testHeader" parameterOrder="bodyParam headerParam">
+
+ <wsdl:input message="impl:testHeaderRequest" name="testHeaderRequest"/>
+
+ <wsdl:output message="impl:testHeaderResponse" name="testHeaderResponse"/>
+
+ </wsdl:operation>
<wsdl:operation name="testLists" parameterOrder="arg_0_0 arg_1_0 arg_2_0 arg_3_0 arg_4_0 arg_5_0 arg_7_0 arg_6_0">
@@ -335,6 +359,19 @@
<wsdl:output name="testSimple2Response">
<wsdlsoap:body namespace="http://org/apache/axis2/jaxws/proxy/rpclit" use="literal"/>
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="testHeader">
+
+ <wsdl:input name="testHeaderRequest">
+ <wsdlsoap:body parts="bodyParam" use="literal"/>
+ <wsdlsoap:header message="impl:testHeaderRequest" part="headerParam" use="literal"/>
+ </wsdl:input>
+
+ <wsdl:output name="testHeaderResponse">
+ <wsdlsoap:header message="impl:testHeaderResponse" part="headerReturn" use="literal"/>
</wsdl:output>
</wsdl:operation>
Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/RPCProxyTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/RPCProxyTests.java?view=diff&rev=503294&r1=503293&r2=503294
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/RPCProxyTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/RPCProxyTests.java Sat Feb 3 11:52:21 2007
@@ -114,6 +114,21 @@
}
/**
+ * Simple test that ensures that we can echo a string to an rpc/lit web service.
+ * This test passes the information in headers
+ */
+ public void testHeader() throws Exception {
+ RPCLit proxy = getProxy();
+ String request1 = "hello";
+ String request2 = "world";
+
+ String response = proxy.testHeader(request1, request2);
+ assertTrue(response != null);
+ assertTrue(response.equals("helloworld"));
+
+ }
+
+ /**
* Simple test that ensures that we can echo a string to an rpc/lit web service
*/
public void testForNull() throws Exception {
@@ -129,13 +144,30 @@
}
}
+ /**
+ * Simple test that ensures that we can echo a string to an rpc/lit web service
+ */
+ public void testForNullReturn() throws Exception {
+ try{
+ RPCLit proxy = getProxy();
+
+ String response = proxy.testSimple("returnNull");
+ fail("RPC/LIT should throw webserviceException when operation is invoked with null out parameter");
+ }catch(Exception e){
+ assertTrue(e instanceof WebServiceException);
+ System.out.println(e.getMessage());
+ }
+ }
+
+
+
public void testSimple_Dispatch() throws Exception {
// Send a payload that simulates
// the rpc message
String request = "<tns:testSimple xmlns:tns='http://org/apache/axis2/jaxws/proxy/rpclit'>" +
- "<tns:simpleIn xsi:type='xsd:string' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" +
+ "<simpleIn xsi:type='xsd:string' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" +
"PAYLOAD WITH XSI:TYPE" +
- "</tns:simpleIn></tns:testSimple>";
+ "</simpleIn></tns:testSimple>";
Dispatch<String> dispatch = getDispatch();
String response = dispatch.invoke(request);
@@ -148,7 +180,8 @@
assertTrue(!response.contains("Body"));
assertTrue(!response.contains("Fault"));
assertTrue(response.contains("simpleOut"));
- assertTrue(response.contains("testSimpleResponse"));
+ assertTrue(!response.contains(":simpleOut")); // Make sure simple out is not namespace qualified
+ assertTrue(response.contains(":testSimpleResponse")); // Make sure response is namespace qualified
assertTrue(response.contains("PAYLOAD WITH XSI:TYPE"));
}
@@ -156,12 +189,12 @@
// Send a payload that simulates
// the rpc message
String request = "<tns:testSimple2 xmlns:tns='http://org/apache/axis2/jaxws/proxy/rpclit'>" +
- "<tns:simple2In1>" +
+ "<simple2In1>" +
"HELLO" +
- "</tns:simple2In1>" +
- "<tns:simple2In2>" +
+ "</simple2In1>" +
+ "<simple2In2>" +
"WORLD" +
- "</tns:simple2In2></tns:testSimple2>";
+ "</simple2In2></tns:testSimple2>";
Dispatch<String> dispatch = getDispatch();
String response = dispatch.invoke(request);
@@ -175,7 +208,8 @@
assertTrue(!response.contains("Body"));
assertTrue(!response.contains("Fault"));
assertTrue(response.contains("simple2Out"));
- assertTrue(response.contains("testSimple2Response"));
+ assertTrue(!response.contains(":simple2Out"));// Make sure simpleOut is not namespace qualified
+ assertTrue(response.contains(":testSimple2Response"));
assertTrue(response.contains("HELLOWORLD"));
}
@@ -183,9 +217,9 @@
// Send a payload that simulates
// the rpc message
String request = "<tns:testSimple xmlns:tns='http://org/apache/axis2/jaxws/proxy/rpclit'>" +
- "<tns:simpleIn>" +
+ "<simpleIn>" +
"PAYLOAD WITHOUT XSI:TYPE" +
- "</tns:simpleIn></tns:testSimple>";
+ "</simpleIn></tns:testSimple>";
Dispatch<String> dispatch = getDispatch();
String response = dispatch.invoke(request);
@@ -199,7 +233,8 @@
assertTrue(!response.contains("Body"));
assertTrue(!response.contains("Fault"));
assertTrue(response.contains("simpleOut"));
- assertTrue(response.contains("testSimpleResponse"));
+ assertTrue(!response.contains(":simpleOut")); // Make sure simpleOut is not namespace qualified
+ assertTrue(response.contains(":testSimpleResponse"));
assertTrue(response.contains("PAYLOAD WITHOUT XSI:TYPE"));
}
Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/rpclit/META-INF/RPCLit.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/rpclit/META-INF/RPCLit.wsdl?view=diff&rev=503294&r1=503293&r2=503294
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/rpclit/META-INF/RPCLit.wsdl (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/rpclit/META-INF/RPCLit.wsdl Sat Feb 3 11:52:21 2007
@@ -85,6 +85,9 @@
<xsd:element name="myEnumList2" type="impl:EnumList2"/>
</xsd:all>
</xsd:complexType>
+
+ <xsd:element name="headerParam" type="xsd:string" />
+ <xsd:element name="headerReturn" type="xsd:string" />
</schema>
</wsdl:types>
@@ -223,6 +226,19 @@
<wsdl:part name="simple2Out" type="xsd:string"/>
</wsdl:message>
+
+ <wsdl:message name="testHeaderRequest">
+
+ <wsdl:part name="bodyParam" type="xsd:string"/>
+ <wsdl:part name="headerParam" element="impl:headerParam"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="testHeaderResponse">
+
+ <wsdl:part name="headerReturn" element="impl:headerReturn"/>
+
+ </wsdl:message>
@@ -244,6 +260,14 @@
<wsdl:output message="impl:testSimple2Response" name="testSimple2Response"/>
</wsdl:operation>
+
+ <wsdl:operation name="testHeader" parameterOrder="bodyParam headerParam">
+
+ <wsdl:input message="impl:testHeaderRequest" name="testHeaderRequest"/>
+
+ <wsdl:output message="impl:testHeaderResponse" name="testHeaderResponse"/>
+
+ </wsdl:operation>
<wsdl:operation name="testLists" parameterOrder="arg_0_0 arg_1_0 arg_2_0 arg_3_0 arg_4_0 arg_5_0 arg_7_0 arg_6_0">
@@ -335,6 +359,19 @@
<wsdl:output name="testSimple2Response">
<wsdlsoap:body namespace="http://org/apache/axis2/jaxws/proxy/rpclit" use="literal"/>
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ <wsdl:operation name="testHeader">
+
+ <wsdl:input name="testHeaderRequest">
+ <wsdlsoap:body parts="bodyParam" use="literal"/>
+ <wsdlsoap:header message="impl:testHeaderRequest" part="headerParam" use="literal"/>
+ </wsdl:input>
+
+ <wsdl:output name="testHeaderResponse">
+ <wsdlsoap:header message="impl:testHeaderResponse" part="headerReturn" use="literal"/>
</wsdl:output>
</wsdl:operation>
Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/rpclit/RPCLitImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/rpclit/RPCLitImpl.java?view=diff&rev=503294&r1=503293&r2=503294
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/rpclit/RPCLitImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/rpclit/RPCLitImpl.java Sat Feb 3 11:52:21 2007
@@ -59,6 +59,12 @@
* Echo the input
*/
public String testSimple(String simpleIn) {
+ assert(simpleIn != null); // According to JAX-WS an RPC service should never receive a null
+
+ // Test to ensure that returning null causes the proper exception
+ if (simpleIn.contains("returnNull")) {
+ return null;
+ }
return simpleIn;
}
@@ -142,5 +148,9 @@
System.out.println("Test FAILURE=" +re);
throw re;
}
+ }
+
+ public String testHeader(String bodyParam, String headerParam) {
+ return bodyParam + headerParam;
}
}
Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/rpclit/sei/RPCLit.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/rpclit/sei/RPCLit.java?view=diff&rev=503294&r1=503293&r2=503294
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/rpclit/sei/RPCLit.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/proxy/rpclit/sei/RPCLit.java Sat Feb 3 11:52:21 2007
@@ -41,7 +41,8 @@
/**
*
- * @param simpleIn
+ * @param simple2In1
+ * @param simple2In2
* @return
* returns java.lang.String
*/
@@ -53,6 +54,21 @@
@WebParam(name = "simple2In2", partName = "simple2In2")
String simple2In2);
+ /**
+ *
+ * @param bodyParam
+ * @param headerParam
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod
+ @WebResult(name = "headerReturn", header=true)
+ public String testHeader(
+ @WebParam(partName = "bodyParam")
+ String bodyParam,
+ @WebParam(name = "headerParam", header=true)
+ String headerParam);
+
/**
*
* @param arg70
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java?view=diff&rev=503294&r1=503293&r2=503294
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java Sat Feb 3 11:52:21 2007
@@ -75,7 +75,7 @@
class OperationDescriptionImpl implements OperationDescription, OperationDescriptionJava, OperationDescriptionWSDL {
private EndpointInterfaceDescription parentEndpointInterfaceDescription;
private AxisOperation axisOperation;
- private QName operationName;
+ private QName operationQName;
private Method seiMethod;
private MethodDescriptionComposite methodComposite;
private ParameterDescription[] parameterDescriptions;
@@ -151,14 +151,16 @@
parentEndpointInterfaceDescription = parent;
setSEIMethod(method);
-
- this.operationName = new QName(getOperationName());
+ // The operationQName is intentionally unqualified to be consistent with the remaining parts of the system.
+ // Using a qualified name will cause breakage.
+ // Don't do --> this.operationQName = new QName(parent.getTargetNamespace(), getOperationName());
+ this.operationQName = new QName("", getOperationName());
}
OperationDescriptionImpl(AxisOperation operation, EndpointInterfaceDescription parent) {
parentEndpointInterfaceDescription = parent;
axisOperation = operation;
- this.operationName = axisOperation.getName();
+ this.operationQName = axisOperation.getName();
}
OperationDescriptionImpl( MethodDescriptionComposite mdc,
@@ -167,7 +169,11 @@
parentEndpointInterfaceDescription = parent;
methodComposite = mdc;
- this.operationName = new QName(getOperationName());
+ // The operationQName is intentionally unqualified to be consistent with the remaining parts of the system.
+ // Using a qualified name will cause breakage.
+ // Don't do --> this.operationQName = new QName(parent.getTargetNamespace(), getOperationName());
+ this.operationQName = new QName("", getOperationName());
+
webMethodAnnotation = methodComposite.getWebMethodAnnot();
this.axisOperation = axisOperation;
@@ -268,7 +274,7 @@
}
public QName getName() {
- return operationName;
+ return operationQName;
}
// Java-related getters
@@ -556,7 +562,7 @@
&& !DescriptionUtils.isEmpty(getAnnoRequestWrapper().localName())) {
requestWrapperLocalName = getAnnoRequestWrapper().localName();
} else {
- // The default value of localName is the value of operationName as
+ // The default value of localName is the value of operationQName as
// defined in the WebMethod annotation. [JAX-WS Sec. 7.3, p. 80]
requestWrapperLocalName = getAnnoWebMethodOperationName();
}
@@ -660,7 +666,7 @@
responseWrapperLocalName = getAnnoResponseWrapper().localName();
}
else {
- // The default value of localName is the value of operationName as
+ // The default value of localName is the value of operationQName as
// defined in the WebMethod annotation appended with "Response". [JAX-WS Sec. 7.4, p. 81]
responseWrapperLocalName = getAnnoWebMethodOperationName() + "Response";
}
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties?view=diff&rev=503294&r1=503293&r2=503294
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/i18n/resource.properties Sat Feb 3 11:52:21 2007
@@ -143,7 +143,6 @@
dispatchBadDOMSource=An invalid DOMSource was encountered during Dispatch. Please use a DOMSource that contains a Node.
convertProblem=An internal error occurred during JAX-WS marshalling. An object of type {0} cannot be converted into the destination type of {1}
invalidPropValue=The value of property {0} was invalid. {1} does not match expected type {2}.
-RPCLitMethodMarshallerErr1=Input argument for Operation cannot be null for RPC/LIT messages.
-RPCLitMethodMarshallerErr1=Input argument for Operation cannot be null for RPC/LIT messages.
+RPCLitMethodMarshallerErr1={0} argument for Operation cannot be null for RPC/LIT messages.
unknownHost=The host specified by the URL is unknown.
connectionRefused=An attempt to connect to the URL was refused.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org