pw.println(" }");
pw.println(" org.apache.axis.client.Call _call = createCall();");
// loop over paramters and set up in/out params
for (int i = 0; i < parms.list.size(); ++i) {
Parameter p = (Parameter) parms.list.get(i);
String mimeType = p.getMIMEType();
// Get the QName representing the parameter type
QName paramType = Utils.getXSIType(p);
// Set the javaType to the name of the type
String javaType = null;
if (mimeType != null) {
javaType = "javax.activation.DataHandler.class, ";
}
else {
javaType = p.getType().getName();
if (javaType != null) {
javaType += ".class, ";
} else {
javaType = "";
}
}
// Get the text representing newing a QName for the name and type
String paramNameText = Utils.getNewQName(p.getQName());
String paramTypeText = Utils.getNewQName(paramType);
// Generate the addParameter call with the
// name qname, typeQName, optional javaType, and mode
if (p.getMode() == Parameter.IN) {
pw.println(" _call.addParameter(" + paramNameText + ", "
+ paramTypeText + ", "
+ javaType + "javax.xml.rpc.ParameterMode.IN);");
}
else if (p.getMode() == Parameter.INOUT) {
pw.println(" _call.addParameter(" + paramNameText + ", "
+ paramTypeText + ", "
+ javaType + "javax.xml.rpc.ParameterMode.INOUT);");
}
else { // p.getMode() == Parameter.OUT
pw.println(" _call.addParameter(" + paramNameText + ", "
+ paramTypeText + ", "
+ javaType + "javax.xml.rpc.ParameterMode.OUT);");
}
}
// set output type
if (parms.returnParam != null) {
// Get the QName for the return Type
QName returnType = Utils.getXSIType(parms.returnParam);
// Get the javaType
String javaType = null;
if (parms.returnParam.getMIMEType() != null) {
javaType = "javax.activation.DataHandler";
}
else {
javaType = parms.returnParam.getType().getName();
}
if (javaType == null) {
pw.println(" _call.setReturnType(" +
Utils.getNewQName(returnType) + ");");
} else {
pw.println(" _call.setReturnType(" +
Utils.getNewQName(returnType) +
", " + javaType + ".class);");
}
}
else {
pw.println(" _call.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID);");
}
// SoapAction
if (soapAction != null) {
pw.println(" _call.setUseSOAPAction(true);");
pw.println(" _call.setSOAPActionURI(\"" + soapAction + "\");");
}
boolean hasMIME = Utils.hasMIME(bEntry, operation);
// Encoding: literal or encoded use.
int use = bEntry.getInputBodyType(operation.getOperation());
if (use == BindingEntry.USE_LITERAL) {
// Turn off encoding
pw.println(" _call.setEncodingStyle(null);");
// turn off XSI types
pw.println(" _call.setScopedProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);");
}
if (hasMIME || use == BindingEntry.USE_LITERAL) {
// If it is literal, turn off multirefs.
//
// If there are any MIME types, turn off multirefs.
// I don't know enough about the guts to know why
// attachments don't work with multirefs, but they don't.
pw.println(" _call.setScopedProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);");
}
// Style: document, RPC, or wrapped
String styleStr = opStyle; // operation style override binding
if (styleStr == null) { // get default from binding
styleStr = "rpc";
int style = bEntry.getBindingStyle();
if (style == BindingEntry.STYLE_DOCUMENT) {
styleStr = "document";
}
}
// FIXME: this only checks for wrapped in a global way, which
// is not really right as some ops can be wrapped and some not
if (styleStr.equals("document") && symbolTable.isWrapped()) {
styleStr = "wrapped";
}
if (!hasMIME) {
pw.println(" _call.setOperationStyle(\"" + styleStr + "\");");
}
// Operation name
if (styleStr.equals("wrapped")) {
// We need to make sure the operation name, which is what we
// wrap the elements in, matches the Qname of the parameter
// element.
Map partsMap = operation.getOperation().getInput().getMessage().getParts();
Part p = (Part)partsMap.values().iterator().next();
QName q = p.getElementName();
pw.println(" _call.setOperationName(" + Utils.getNewQName(q) + ");" );
// Special return info for wrapped - the QName of the element
// which is the return type
if (parms.returnParam != null) {