/* (non-Javadoc)
* @see org.apache.axis.wsdl.wsdl2ws.cpp.HeaderFileWriter#writeMethods()
*/
protected void writeMethods() throws WrapperFault {
MethodInfo minfo;
boolean isSimpleType;
try{
writer.write("extern void* get_"+classname+"_stub();\n");
writer.write("extern void destroy_"+classname+"_stub(void* p);\n");
writer.write("extern int get_" + classname + "_Status(void* pStub);\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("extern void ");
}
else if (1==noOfOutParams){
returntype = (ParameterInfo)minfo.getOutputParameterTypes().iterator().next();
String outparam = returntype.getLangName();
writer.write("extern "+WrapperUtils.getClassNameFromParamInfoConsideringArrays(returntype,wscontext)+" ");
}
else{
isAllTreatedAsOutParams = true;
writer.write("extern void ");
}
writer.write(minfo.getMethodname()+"(void* pStub");
//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 "+WrapperUtils.getClassNameFromParamInfoConsideringArrays(nparam,wscontext)+" *OutValue"+j);
}
}