/* (non-Javadoc)
* @see org.apache.axis.wsdl.wsdl2ws.cpp.HeaderFileWriter#writeMethods()
*/
protected void writeMethods() throws WrapperFault
{
MethodInfo minfo;
try
{
writer.write(
"\n/* This function is called by the AxisEngine when something went wrong"
+ "\n with the current web service request processing. Appropriate actions should"
+ "\n be taken here.*/");
writer.write("\nvoid " + classname + "::onFault()\n{\n}");
writer.write(
"\n/* This function is called by the AxisEngine when this web service"
+ "\n library is first loaded. So here we can initialize any global/static"
+ "\n data structures of this web service or open database connections */");
writer.write("\nvoid " + classname + "::init()\n{\n}");
writer.write(
"\n/* This function is called by the AxisEngine when this web service"
+ "\n library is unloaded. So we can deallocate any global/static data structures"
+ "\n and close database connections etc here. */");
writer.write("\nvoid " + classname + "::fini()\n{\n}");
writer.write("\n");
for (int i = 0; i < methods.size(); i++)
{
minfo = (MethodInfo) this.methods.get(i);
boolean isAllTreatedAsOutParams = false;
ParameterInfo returntype = null;
int noOfOutParams = minfo.getOutputParameterTypes().size();
if (0 == noOfOutParams)
{
returntype = null;
writer.write("void ");
}
else
{
if (1 == noOfOutParams)
{
returntype =
(ParameterInfo) minfo
.getOutputParameterTypes()
.iterator()
.next();
writer.write(
WrapperUtils
.getClassNameFromParamInfoConsideringArrays(
returntype,
wscontext)
+ " ");
}
else
{
isAllTreatedAsOutParams = true;
writer.write("void ");
}
}
writer.write(classname + "::" + minfo.getMethodname() + "(");
//write parameter names
Iterator params = minfo.getInputParameterTypes().iterator();
if (params.hasNext())
{
ParameterInfo fparam = (ParameterInfo) params.next();
writer.write(
WrapperUtils
.getClassNameFromParamInfoConsideringArrays(
fparam,
wscontext)
+ " Value"
+ 0);
}
for (int j = 1; params.hasNext(); j++)
{
ParameterInfo nparam = (ParameterInfo) params.next();
writer.write(
", "
+ WrapperUtils
.getClassNameFromParamInfoConsideringArrays(
nparam,
wscontext)
+ " Value"
+ j);
}
if (isAllTreatedAsOutParams)
{
params = minfo.getOutputParameterTypes().iterator();
for (int j = 0; params.hasNext(); j++)
{
ParameterInfo nparam = (ParameterInfo) params.next();
writer.write(
", AXIS_OUT_PARAM "