Author: darran.lofthouse(a)jboss.com
Date: 2008-08-12 15:52:17 -0400 (Tue, 12 Aug 2008)
New Revision: 8075
Modified:
stack/native/branches/dlofthouse/JBWS-1862/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
stack/native/branches/dlofthouse/JBWS-1862/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java
stack/native/branches/dlofthouse/JBWS-1862/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1862/JBWS1862TestCase.java
Log:
Added fix and further test case updates.
Modified:
stack/native/branches/dlofthouse/JBWS-1862/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1862/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2008-08-12
16:01:13 UTC (rev 8074)
+++
stack/native/branches/dlofthouse/JBWS-1862/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2008-08-12
19:52:17 UTC (rev 8075)
@@ -150,7 +150,8 @@
// Disable MTOM for rpc/encoded
if (opMetaData.isRPCEncoded())
XOPContext.setMTOMEnabled(false);
- else XOPContext.setMTOMEnabled(isMTOMEnabled());
+ else
+ XOPContext.setMTOMEnabled(isMTOMEnabled());
// Associate current message with message context
SOAPMessageImpl reqMessage = (SOAPMessageImpl)createMessage(opMetaData);
@@ -168,7 +169,7 @@
if (style == Style.RPC)
{
boolean serialize = true;
-
+
if (opMetaData.getEndpointMetaData().getConfig().getRMMetaData() != null)
{
// RM hack to JAX-RPC serialization
@@ -177,7 +178,7 @@
serialize = false;
}
}
-
+
if (serialize)
{
QName opQName = opMetaData.getQName();
@@ -244,10 +245,10 @@
log.debug("Add unboundHeader element: " + soapName);
SOAPContentElement contentElement = new
SOAPHeaderElementImpl(soapName);
contentElement.setParamMetaData(unboundHeader.toParameterMetaData(opMetaData));
-
+
if (soapHeader == null)
soapHeader = soapEnvelope.addHeader();
-
+
soapHeader.addChildElement(contentElement);
contentElement.setObjectValue(value);
}
@@ -316,7 +317,7 @@
payloadParent = (SOAPElement)childNode;
}
}
-
+
if (RMHelper.isRMOperation(opMetaData.getQName()) == false) // RM hack
{
if (payloadParent == null)
@@ -414,7 +415,8 @@
// Disable MTOM for rpc/encoded
if (opMetaData.isRPCEncoded())
XOPContext.setMTOMEnabled(false);
- else XOPContext.setMTOMEnabled(isMTOMEnabled());
+ else
+ XOPContext.setMTOMEnabled(isMTOMEnabled());
// Associate current message with message context
SOAPMessageImpl resMessage = (SOAPMessageImpl)createMessage(opMetaData);
@@ -848,7 +850,7 @@
SOAPContentElement aux = (SOAPContentElement)childElement;
Name elName = aux.getElementName();
- if (xmlName.equals(elName))
+ if (xmlName.getLocalName().equals("") || xmlName.equals(elName))
{
soapContentElement = aux;
soapContentElement.setParamMetaData(paramMetaData);
Modified:
stack/native/branches/dlofthouse/JBWS-1862/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1862/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java 2008-08-12
16:01:13 UTC (rev 8074)
+++
stack/native/branches/dlofthouse/JBWS-1862/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java 2008-08-12
19:52:17 UTC (rev 8075)
@@ -212,7 +212,14 @@
ParameterMetaData paramMetaData = new ParameterMetaData(opMetaData, xmlName,
xmlType, javaType.getName());
paramMetaData.setMode(mode);
paramMetaData.setInHeader(inHeader);
- paramMetaData.setIndex(opMetaData.getParameters().size());
+ if (mode == ParameterMode.IN || mode == ParameterMode.INOUT)
+ {
+ paramMetaData.setIndex(opMetaData.getInputParameters().size());
+ }
+ else
+ {
+ paramMetaData.setIndex(-1);
+ }
opMetaData.addParameter(paramMetaData);
registerParameterType(xmlType, javaType);
@@ -245,7 +252,7 @@
throw new IllegalArgumentException("Invalid null parameter");
OperationMetaData opMetaData = getOperationMetaData();
- QName xmlName = new QName(Constants.DEFAULT_RPC_RETURN_NAME);
+ QName xmlName = new QName("");
String javaTypeName = javaType.getName();
ParameterMetaData retMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType,
javaTypeName);
opMetaData.setReturnParameter(retMetaData);
@@ -473,7 +480,8 @@
ParameterMetaData paramMetaData = opMetaData.getParameter(new QName(paramName));
if (paramMetaData != null)
return paramMetaData.getXmlType();
- else return null;
+ else
+ return null;
}
protected CommonBindingProvider getCommonBindingProvider()
Modified:
stack/native/branches/dlofthouse/JBWS-1862/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1862/JBWS1862TestCase.java
===================================================================
---
stack/native/branches/dlofthouse/JBWS-1862/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1862/JBWS1862TestCase.java 2008-08-12
16:01:13 UTC (rev 8074)
+++
stack/native/branches/dlofthouse/JBWS-1862/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1862/JBWS1862TestCase.java 2008-08-12
19:52:17 UTC (rev 8075)
@@ -21,7 +21,6 @@
*/
package org.jboss.test.ws.jaxrpc.jbws1862;
-import java.io.File;
import java.net.URL;
import javax.xml.namespace.QName;
@@ -54,7 +53,7 @@
return new JBossWSTestSetup(JBWS1862TestCase.class,
"jaxrpc-jbws1862.war");
}
- public void testUnconfiguredCall() throws Exception
+ public void testUnconfiguredCall_SetReturnType() throws Exception
{
QName serviceName = new QName(NAMESPACE, "TestService");
QName operationName = new QName(NAMESPACE, "echo");
@@ -73,7 +72,7 @@
assertEquals(message, response);
}
- public void testUnconfiguredCall_2() throws Exception
+ public void testUnconfiguredCall_AddOutParam() throws Exception
{
QName serviceName = new QName(NAMESPACE, "TestService");
QName operationName = new QName(NAMESPACE, "echo");
@@ -86,7 +85,6 @@
call.addParameter("String_1", Constants.TYPE_LITERAL_STRING,
ParameterMode.IN);
call.addParameter("String_2", Constants.TYPE_LITERAL_STRING,
ParameterMode.OUT);
call.setTargetEndpointAddress(TARGET_ENDPOINT_ADDRESS);
- call.setReturnType(Constants.TYPE_LITERAL_STRING, String.class);
String message = "Hello World!!";
String response = (String)call.invoke(new Object[] { message });
@@ -106,7 +104,6 @@
Call call = (Call)service.createCall();
call.setOperationName(operationName);
call.setTargetEndpointAddress(TARGET_ENDPOINT_ADDRESS);
- call.setReturnType(Constants.TYPE_LITERAL_STRING, String.class);
String message = "Hello World!!";
String response = (String)call.invoke(new Object[] { message });
@@ -126,7 +123,6 @@
Call call = (Call)service.createCall();
call.setOperationName(operationName);
call.setTargetEndpointAddress(TARGET_ENDPOINT_ADDRESS);
- call.setReturnType(Constants.TYPE_LITERAL_STRING, String.class);
String message = "Hello World!!";
String response = (String)call.invoke(new Object[] { message });