gdaniels 02/03/27 11:27:47
Modified: java/src/org/apache/axis/client Call.java
java/src/org/apache/axis/deployment/wsdd WSDDService.java
java/src/org/apache/axis/encoding
SerializationContextImpl.java
Log:
Don't send xsi:types/multirefs for wrapped services.
This brought to light a problem in Call where the returnType wasn't getting
propagated to the Operation if it was set before other parameters were
added. We now ALWAYS have an OperationDesc available in the Call.
Also set a couple of options which might be useful later (when cleaning
up the option-getting code in SerializationContextImpl) in WSDDService.
Revision Changes Path
1.109 +10 -24 xml-axis/java/src/org/apache/axis/client/Call.java
Index: Call.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Call.java,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -r1.108 -r1.109
--- Call.java 27 Mar 2002 17:53:06 -0000 1.108
+++ Call.java 27 Mar 2002 19:27:46 -0000 1.109
@@ -166,7 +166,7 @@
private String encodingStyle = Constants.URI_CURRENT_SOAP_ENC;
private Integer timeout = null;
- private OperationDesc operation = null;
+ private OperationDesc operation = new OperationDesc();
// Our Transport, if any
private Transport transport = null ;
@@ -721,10 +721,6 @@
public void addParameter(QName paramName, QName xmlType,
Class javaType, ParameterMode parameterMode) {
if (parmAndRetReq) {
- if (operation == null) {
- operation = new OperationDesc();
- }
-
ParameterDesc param = new ParameterDesc();
param.setQName( paramName );
param.setTypeQName( xmlType );
@@ -805,8 +801,6 @@
*/
public QName getParameterTypeByQName(QName paramQName) {
int i;
- if ( operation == null ) return( null );
-
ParameterDesc param = operation.getParamByQName(paramQName);
if (param != null) {
return param.getTypeQName();
@@ -822,11 +816,9 @@
public void setReturnType(QName type) {
if (parmAndRetReq) {
returnType = type ;
- if (operation != null) {
- operation.setReturnType(type);
- TypeMapping tm = getTypeMapping();
- operation.setReturnClass(tm.getClassForQName(type));
- }
+ operation.setReturnType(type);
+ TypeMapping tm = getTypeMapping();
+ operation.setReturnClass(tm.getClassForQName(type));
}
else {
throw new JAXRPCException();
@@ -885,7 +877,7 @@
*/
public void removeAllParameters() {
if (parmAndRetReq) {
- operation = null; // FIXME -- ???
+ operation = new OperationDesc();
}
else {
throw new JAXRPCException();
@@ -1383,7 +1375,7 @@
// If we never set-up any names... then just return what was passed in
//////////////////////////////////////////////////////////////////////
- if ( operation == null ) return( params );
+ if ( operation.getNumParams() == 0 ) return( params );
// Count the number of IN and INOUT params, this needs to match the
// number of params passed in - if not throw an error
@@ -1531,7 +1523,7 @@
{
myHeaders = null;
}
-
+
public TypeMapping getTypeMapping()
{
// Get the TypeMappingRegistry
@@ -1570,7 +1562,7 @@
TypeMapping tm = getTypeMapping();
if (!force && tm.isRegistered(javaType, xmlType))
return;
-
+
// Register the information
tm.register(javaType, xmlType, sf, df);
}
@@ -1862,15 +1854,9 @@
}
msgContext.setMaintainSession(maintainSession);
- OperationDesc oper = operation;
-
- // If we haven't set up an OperationDesc for this Call, just make a
- // temporary one.
- if (oper == null)
- oper = new OperationDesc();
- msgContext.setOperation(oper);
+ msgContext.setOperation(operation);
- oper.setStyle(operationStyle);
+ operation.setStyle(operationStyle);
msgContext.setOperationStyle(operationStyle);
if (useSOAPAction) {
1.46 +6 -0
xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDService.java
Index: WSDDService.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDService.java,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- WSDDService.java 22 Mar 2002 16:08:31 -0000 1.45
+++ WSDDService.java 27 Mar 2002 19:27:47 -0000 1.46
@@ -326,6 +326,12 @@
service.setName(getQName().getLocalPart());
service.setOptions(getParametersTable());
+ if (style != ServiceDesc.STYLE_RPC) {
+ // No Multirefs/xsi:types
+ service.setOption(AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
+ service.setOption(AxisEngine.PROP_SEND_XSI, Boolean.FALSE);
+ }
+
if (tmr == null) {
tmr = new TypeMappingRegistryImpl();
}
1.13 +2 -2
xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java
Index: SerializationContextImpl.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- SerializationContextImpl.java 5 Mar 2002 18:38:21 -0000 1.12
+++ SerializationContextImpl.java 27 Mar 2002 19:27:47 -0000 1.13
@@ -201,14 +201,14 @@
Boolean opt = (Boolean)engine.getOption(AxisEngine.PROP_SEND_XSI);
if ((opt != null) && (opt.equals(Boolean.FALSE))) {
- sendXSIType = false;
+ sendXSIType = false ;
}
// A Document-style service overrides the above settings. Don't
// send xsi:type, and don't do multiref in that case.
SOAPService service = msgContext.getService();
if (service != null) {
- if (service.getStyle() == ServiceDesc.STYLE_DOCUMENT) {
+ if (service.getStyle() != ServiceDesc.STYLE_RPC) {
sendXSIType = false;
doMultiRefs = false;
}