Fields Summary |
---|
public static final int | MSG_METHOD_BODYARRAY |
public static final int | MSG_METHOD_SOAPENVELOPE |
public static final int | MSG_METHOD_ELEMENTARRAY |
public static final int | MSG_METHOD_DOCUMENT |
public static final int | MSG_METHOD_NONCONFORMING |
public static Map | mepStrings |
protected static Log | log |
private ServiceDesc | parentThe service we're a part of |
private ArrayList | parametersParameter list |
private String | nameThe operation name (String, or QName?) |
private QName | elementQNameAn XML QName which should dispatch to this method |
private transient Method | methodThe actual Java method associated with this operation, if known |
private org.apache.axis.constants.Style | styleThis operation's style/use. If null, we default to our parent's |
private org.apache.axis.constants.Use | use |
private int | numInParamsThe number of "in" params (i.e. IN or INOUT) for this operation |
private int | numOutParamsThe number of "out" params (i.e. OUT or INOUT) for this operation |
private String | soapActionA unique SOAPAction value for this operation |
private ArrayList | faultsFaults for this operation |
private ParameterDesc | returnDesc |
private int | messageOperationStyleIf we're a message-style operation, what's our signature? |
private String | documentationThe documentation for the operation |
private javax.wsdl.OperationType | mepThe MEP for this Operation - uses the WSDL4J OperationType for now
but we might want to have our own extensible enum for WSDL 2.0 |
Methods Summary |
---|
public void | addFault(FaultDesc fault)
if (faults == null)
faults = new ArrayList();
faults.add(fault);
|
public void | addParameter(ParameterDesc param)
// Should we enforce adding INs then INOUTs then OUTs?
param.setOrder(getNumParams());
parameters.add(param);
if ((param.getMode() == ParameterDesc.IN) ||
(param.getMode() == ParameterDesc.INOUT)) {
numInParams++;
}
if ((param.getMode() == ParameterDesc.OUT) ||
(param.getMode() == ParameterDesc.INOUT)) {
numOutParams++;
}
log.debug("@" + Integer.toHexString(hashCode()) + " added parameter >" + param + "@" + Integer.toHexString(param.hashCode()) + "<total parameters:" +getNumParams());
|
public void | addParameter(javax.xml.namespace.QName paramName, javax.xml.namespace.QName xmlType, java.lang.Class javaType, byte parameterMode, boolean inHeader, boolean outHeader)
ParameterDesc param =
new ParameterDesc(paramName, parameterMode, xmlType,
javaType, inHeader, outHeader);
addParameter(param);
|
public java.util.ArrayList | getAllInParams()Return a list of ALL "in" params (including INOUTs)
Note: if we were sure the order went IN->INOUT->OUT, we could optimize
this.
ArrayList result = new ArrayList();
for (Iterator i = parameters.iterator(); i.hasNext();) {
ParameterDesc desc = (ParameterDesc) i.next();
if (desc.getMode() != ParameterDesc.OUT) {
result.add(desc);
}
}
return result;
|
public java.util.ArrayList | getAllOutParams()Return a list of ALL "out" params (including INOUTs)
Note: if we were sure the order went IN->INOUT->OUT, we could optimize
this.
ArrayList result = new ArrayList();
for (Iterator i = parameters.iterator(); i.hasNext();) {
ParameterDesc desc = (ParameterDesc) i.next();
if (desc.getMode() != ParameterDesc.IN) {
result.add(desc);
}
}
return result;
|
public java.lang.String | getDocumentation()get the documentation for the operation
return documentation;
|
public javax.xml.namespace.QName | getElementQName()
return elementQName;
|
public FaultDesc | getFaultByClass(java.lang.Class cls)Returns the FaultDesc for the fault class given.
Returns null if not found.
if (faults == null || cls == null) {
return null;
}
while (cls != null) {
// Check each class in the inheritance hierarchy, stopping at
// java.* or javax.* classes.
for (Iterator iterator = faults.iterator(); iterator.hasNext();) {
FaultDesc desc = (FaultDesc) iterator.next();
if (cls.getName().equals(desc.getClassName())) {
return desc;
}
}
cls = cls.getSuperclass();
if (cls != null && (cls.getName().startsWith("java.") ||
cls.getName().startsWith("javax."))) {
cls = null;
}
}
return null;
|
public FaultDesc | getFaultByClass(java.lang.Class cls, boolean checkParents)Returns the FaultDesc for the fault class given.
Returns null if not found.
if (checkParents) {
return getFaultByClass(cls);
}
if (faults == null || cls == null) {
return null;
}
for (Iterator iterator = faults.iterator(); iterator.hasNext();) {
FaultDesc desc = (FaultDesc) iterator.next();
if (cls.getName().equals(desc.getClassName())) {
return desc;
}
}
return null;
|
public FaultDesc | getFaultByQName(javax.xml.namespace.QName qname)Returns the FaultDesc for a QName (which is typically found
in the details element of a SOAP fault).
Returns null if not found.
if (faults != null) {
for (Iterator iterator = faults.iterator(); iterator.hasNext();) {
FaultDesc desc = (FaultDesc) iterator.next();
if (qname.equals(desc.getQName())) {
return desc;
}
}
}
return null;
|
public FaultDesc | getFaultByXmlType(javax.xml.namespace.QName xmlType)Returns the FaultDesc for an XMLType.
Returns null if not found.
if (faults != null) {
for (Iterator iterator = faults.iterator(); iterator.hasNext();) {
FaultDesc desc = (FaultDesc) iterator.next();
if (xmlType.equals(desc.getXmlType())) {
return desc;
}
}
}
return null;
|
public java.util.ArrayList | getFaults()
return faults;
|
public ParameterDesc | getInputParamByQName(javax.xml.namespace.QName qname)
ParameterDesc param = null;
param = getParamByQName(qname);
if ((param == null) || (param.getMode() == ParameterDesc.OUT)) {
param = null;
}
return param;
|
public javax.wsdl.OperationType | getMep()
return mep;
|
public int | getMessageOperationStyle()
return messageOperationStyle;
|
public java.lang.reflect.Method | getMethod()
return method;
|
public java.lang.String | getName()Return the operation's name
return name;
|
public int | getNumInParams()
return numInParams;
|
public int | getNumOutParams()
return numOutParams;
|
public int | getNumParams()
return parameters.size();
|
public java.util.ArrayList | getOutParams()Returns an ordered list of out params (NOT inouts)
ArrayList result = new ArrayList();
for (Iterator i = parameters.iterator(); i.hasNext();) {
ParameterDesc desc = (ParameterDesc) i.next();
if (desc.getMode() == ParameterDesc.OUT) {
result.add(desc);
}
}
return result;
|
public ParameterDesc | getOutputParamByQName(javax.xml.namespace.QName qname)
ParameterDesc param = null;
for (Iterator i = parameters.iterator(); i.hasNext();) {
ParameterDesc pnext = (ParameterDesc)i.next();
if (pnext.getQName().equals(qname) &&
pnext.getMode() != ParameterDesc.IN) {
param = pnext;
break;
}
}
if (param == null) {
if (null == returnDesc.getQName() ){
param= new ParameterDesc( returnDesc); //Create copy
param.setQName(qname);
}
else if ( qname.equals(returnDesc.getQName())) {
param = returnDesc;
}
}
return param;
|
public ParameterDesc | getParamByQName(javax.xml.namespace.QName qname)
for (Iterator i = parameters.iterator(); i.hasNext();) {
ParameterDesc param = (ParameterDesc) i.next();
if (param.getQName().equals(qname))
return param;
}
return null;
|
public ParameterDesc | getParameter(int i)
if (parameters.size() <= i)
return null;
return (ParameterDesc)parameters.get(i);
|
public java.util.ArrayList | getParameters()
return parameters;
|
public ServiceDesc | getParent()
return parent;
|
public java.lang.Class | getReturnClass()
return returnDesc.getJavaType();
|
public ParameterDesc | getReturnParamDesc()
return returnDesc;
|
public javax.xml.namespace.QName | getReturnQName()
return returnDesc.getQName();
|
public javax.xml.namespace.QName | getReturnType()
return returnDesc.getTypeQName();
|
public java.lang.String | getSoapAction()
return soapAction;
|
public org.apache.axis.constants.Style | getStyle()Return the style of the operation, defaulting to the parent
ServiceDesc's style if we don't have one explicitly set.
if (style == null) {
if (parent != null) {
return parent.getStyle();
}
return Style.DEFAULT; // Default
}
return style;
|
public org.apache.axis.constants.Use | getUse()Return the use of the operation, defaulting to the parent
ServiceDesc's use if we don't have one explicitly set.
if (use == null) {
if (parent != null) {
return parent.getUse();
}
return Use.DEFAULT; // Default
}
return use;
|
public boolean | isReturnHeader()Is the return value in the header of the response message?
return returnDesc.isOutHeader();
|
private void | readObject(java.io.ObjectInputStream in)
in.defaultReadObject();
Class clazz = (Class) in.readObject();
if (clazz != null){
String methodName = (String) in.readObject();
Class[] parameterTypes = (Class[]) in.readObject();
try {
method = clazz.getMethod(methodName, parameterTypes);
} catch (NoSuchMethodException e) {
throw new IOException("Unable to deserialize the operation's method: "+ methodName);
}
}
|
public void | setDocumentation(java.lang.String documentation)set the documentation for the operation
this.documentation = documentation;
|
public void | setElementQName(javax.xml.namespace.QName elementQName)
this.elementQName = elementQName;
|
public void | setMep(javax.wsdl.OperationType mep)
this.mep = mep;
|
public void | setMep(java.lang.String mepString)Set the MEP using a string like "request-response"
OperationType newMep = (OperationType)mepStrings.get(mepString);
if (newMep != null) {
mep = newMep;
}
|
public void | setMessageOperationStyle(int messageOperationStyle)
this.messageOperationStyle = messageOperationStyle;
|
public void | setMethod(java.lang.reflect.Method method)
this.method = method;
|
public void | setName(java.lang.String name)Set the operation's name
this.name = name;
|
public void | setParameters(java.util.ArrayList newParameters)Set the parameters wholesale.
parameters = new ArrayList(); //Keep numInParams correct.
numInParams = 0;
numOutParams = 0;
for( java.util.ListIterator li= newParameters.listIterator();
li.hasNext(); ){
addParameter((ParameterDesc) li.next());
}
|
public void | setParent(ServiceDesc parent)
this.parent = parent;
|
public void | setReturnClass(java.lang.Class returnClass)
returnDesc.setJavaType(returnClass);
|
public void | setReturnHeader(boolean value)Set whether the return value is in the response message.
returnDesc.setOutHeader(value);
|
public void | setReturnQName(javax.xml.namespace.QName returnQName)
returnDesc.setQName(returnQName);
|
public void | setReturnType(javax.xml.namespace.QName returnType)
log.debug("@" + Integer.toHexString(hashCode()) + "setReturnType(" + returnType +")");
returnDesc.setTypeQName(returnType);
|
public void | setSoapAction(java.lang.String soapAction)
this.soapAction = soapAction;
|
public void | setStyle(org.apache.axis.constants.Style style)
this.style = style;
|
public void | setUse(org.apache.axis.constants.Use use)
this.use = use;
|
public java.lang.String | toString()
return toString("");
|
public java.lang.String | toString(java.lang.String indent)
String text ="";
text+=indent+"name: " + getName() + "\n";
text+=indent+"returnQName: " + getReturnQName() + "\n";
text+=indent+"returnType: " + getReturnType() + "\n";
text+=indent+"returnClass: " + getReturnClass() + "\n";
text+=indent+"elementQName:" + getElementQName() + "\n";
text+=indent+"soapAction: " + getSoapAction() + "\n";
text+=indent+"style: " + getStyle().getName() + "\n";
text+=indent+"use: " + getUse().getName() + "\n";
text+=indent+"numInParams: " + getNumInParams() + "\n";
text+=indent+"method:" + getMethod() + "\n";
for (int i=0; i<parameters.size(); i++) {
text+=indent+" ParameterDesc[" + i + "]:\n";
text+=indent+ ((ParameterDesc)parameters.get(i)).toString(" ") + "\n";
}
if (faults != null) {
for (int i=0; i<faults.size(); i++) {
text+=indent+" FaultDesc[" + i + "]:\n";
text+=indent+ ((FaultDesc)faults.get(i)).toString(" ") + "\n";
}
}
return text;
|
private void | writeObject(java.io.ObjectOutputStream out)
out.defaultWriteObject();
if (method != null){
out.writeObject(method.getDeclaringClass());
out.writeObject(method.getName());
out.writeObject(method.getParameterTypes());
} else {
out.writeObject(null);
}
|