📄 calladdbom.java
字号:
/**
* @Date: 2004-12-10
* @Author: jiadongz
* @E-mail: jiadong.zhu@agile.com
*/
package client.agile.com;
import com.agile.api.*;
import com.agile.px.ActionResult;
import com.agile.px.ICustomAction;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
public class CallAddBOM implements ICustomAction {
private Service service = null;
private Call call = null;
private final String url = "http://tyler.agile.agilesoft.com/Agile/ws/AddBOM";
private final String USER = "yvonnec";
private final String PWD = "agile";
private final String METHOD = "addBOM";
private Object[] parameters = null;
/*
* PX
*/
public ActionResult doAction(IAgileSession session, INode node, IDataObject object) {
try{
if(object==null || !(object instanceof IItem))
return new ActionResult(ActionResult.STRING, "Pls invoke from Item object");
else{
String number = object.getName();
parameters = new String[]{number};
return callAddBOM();
}
}catch(APIException e){
System.out.println(e.getMessage());
return new ActionResult(ActionResult.EXCEPTION, "PX ERROR");
}
}///: doAction() Ends
/*
* Call remote WSX
*/
private ActionResult callAddBOM() {
try {
service = new Service();
call = (Call) service.createCall();
call.setTargetEndpointAddress(url);
call.setUsername(USER);
call.setPassword(PWD);
call.setOperationName(METHOD);
call.invoke(parameters);
} catch (Exception e) {
e.printStackTrace();
}
return new ActionResult(ActionResult.STRING, "Done, check BOM table");
}///: ~ callAddBOM() Ends
}///:~ CallAddBOM Ends
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -