Author: jim.ma
Date: 2010-03-25 07:58:46 -0400 (Thu, 25 Mar 2010)
New Revision: 11859
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/EndpointInvocation.java
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/test-excludes-jboss510.txt
Log:
[JBPAPP-3984]:Check RPC/Literalparameters BP-R2211 violation
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java 2010-03-25
11:46:52 UTC (rev 11858)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java 2010-03-25
11:58:46 UTC (rev 11859)
@@ -38,6 +38,7 @@
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPException;
import javax.xml.ws.ProtocolException;
+import javax.xml.ws.WebServiceException;
import javax.xml.ws.addressing.AddressingProperties;
import javax.xml.ws.addressing.JAXWSAConstants;
import javax.xml.ws.handler.MessageContext;
@@ -255,10 +256,8 @@
{
if (opName.equals(operationName) == false)
setOperationName(opName);
-
OperationMetaData opMetaData = getOperationMetaData();
boolean oneway = forceOneway || opMetaData.isOneWay();
-
// Associate a message context with the current thread
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
msgContext.setOperationMetaData(opMetaData);
@@ -284,6 +283,19 @@
epInv = new EndpointInvocation(opMetaData);
epInv.initInputParams(inputParams);
+ if (opMetaData.getEndpointMetaData().getType() != Type.JAXRPC &&
opMetaData.isRPCLiteral()
+ && epInv.getRequestParamNames() != null)
+ {
+ for (QName qname : epInv.getRequestParamNames())
+ {
+ Object obj = epInv.getRequestParamValue(qname);
+ if (obj == null)
+ {
+ throw new WebServiceException("The RPC/Literal Operation [" +
opName + "] Parameter can not be null");
+ }
+ }
+ }
+
// Set the required outbound properties
setOutboundContextProperties();
@@ -388,6 +400,29 @@
binding.unbindResponseMessage(opMetaData, resMessage, epInv,
unboundHeaders);
}
+ if (opMetaData.getEndpointMetaData().getType() != Type.JAXRPC &&
opMetaData.isRPCLiteral())
+ {
+ if (epInv.getResponseParamNames() != null)
+ {
+ for (QName qname : epInv.getResponseParamNames())
+ {
+ Object obj = epInv.getResponsePayLoadParamValue(qname);
+ if (obj == null)
+ {
+ throw new WebServiceException("The RPC/Literal Operation
[" + opName
+ + "] response parameters can not be null");
+ }
+ }
+ //BP-2211. This should be uncommented to check the return value. Now it
breaks
+ //The AddressingTestCase
+ /*if (opMetaData.getReturnParameter() != null &&
epInv.getReturnValue() == null)
+ {
+ throw new WebServiceException("The RPC/Literal Operation
[" + opName
+ + "] return value can not be null");
+ }*/
+
+ }
+ }
retObj = syncOutputParams(inputParams, epInv);
}
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/EndpointInvocation.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2010-03-25
11:46:52 UTC (rev 11858)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2010-03-25
11:58:46 UTC (rev 11859)
@@ -172,6 +172,16 @@
}
return paramValue;
}
+
+ public Object getResponsePayLoadParamValue(QName xmlName) throws SOAPException
+ {
+ if (log.isDebugEnabled())
+ log.debug("getResponseParamValue: " + xmlName);
+ Object paramValue = resPayload.get(xmlName);
+ ParameterMetaData paramMetaData = opMetaData.getParameter(xmlName);
+ paramValue = transformPayloadValue(paramMetaData, paramValue);
+ return paramValue;
+ }
public void setReturnValue(Object value)
{
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2010-03-25
11:46:52 UTC (rev 11858)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2010-03-25
11:58:46 UTC (rev 11859)
@@ -35,6 +35,7 @@
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPHeader;
import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.http.HTTPBinding;
@@ -75,6 +76,7 @@
import org.jboss.wsf.spi.invocation.InvocationType;
import org.jboss.wsf.spi.invocation.WebServiceContextFactory;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
+import org.jboss.wsf.spi.serviceref.ServiceRefHandler.Type;
/** An implementation handles invocations on the endpoint
*
@@ -212,6 +214,20 @@
sepInv = binding.unbindRequestMessage(opMetaData, reqMessage);
}
+ if (opMetaData.getEndpointMetaData().getType() !=
EndpointMetaData.Type.JAXRPC
+ && opMetaData.isRPCLiteral() &&
sepInv.getRequestParamNames() != null)
+ {
+ for (QName qname : sepInv.getRequestParamNames())
+ {
+ Object obj = sepInv.getRequestParamValue(qname);
+ if (obj == null)
+ {
+ throw new WebServiceException("The RPC/Literal Operation
[" + opMetaData.getQName()
+ + "] parameters can not be null");
+ }
+ }
+ }
+
// Invoke an instance of the SEI implementation bean
Invocation inv = setupInvocation(endpoint, sepInv, invContext);
InvocationHandler invHandler = endpoint.getInvocationHandler();
@@ -219,6 +235,7 @@
try
{
invHandler.invoke(endpoint, inv);
+
}
catch (InvocationTargetException th)
{
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/test-excludes-jboss510.txt
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/test-excludes-jboss510.txt 2010-03-25
11:46:52 UTC (rev 11858)
+++
stack/native/branches/jbossws-native-3.1.2/modules/testsuite/test-excludes-jboss510.txt 2010-03-25
11:58:46 UTC (rev 11859)
@@ -6,3 +6,5 @@
# [JBWS-2217] Fix BPEL jaxrpc samples
org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/*TestCase.*
+# [JBWS-2969] remove the BP-2211 violation test. The input parameter is null
+org/jboss/test/ws/jaxws/jbws871/JBWS871TestCase.*
Show replies by date