package com.weaver.seconddev.interfaces.oames;

import java.rmi.RemoteException;
import com.weaver.common.i18n.tool.util.I18nContextUtil;
import com.weaver.seconddev.interfaces.prop.ConfigProp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import java.lang.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.weaver.verupgrade.general.BaseBean;
import com.weaver.verupgrade.general.Util;
import org.springframework.stereotype.Component;


@Component
public class CallMesChuMenZhengService extends BaseBean {

	private static final org.slf4j.Logger logger_742486d = LoggerFactory.getLogger(CallMesChuMenZhengService.class);

	private OA_CMZ_SERVICEStub.OA_CMZ_MSG resultIn = null;
	@Autowired
	private ConfigProp configProp;
	public void setOainput(OA_CMZ_SERVICEStub.OA_CMZ_MSG oames) {
		this.resultIn = oames;
	}

	public String[] call() throws RemoteException {
		logger_742486d.error(String.valueOf("调用接口------------------------开始"));
		OA_CMZ_SERVICEStub stub = null;
//		String wsdlLocation = Util.null2String(I18nContextUtilcus.getBean(Environment.class).getProperty("MesInterfaceAddr.WsdlLocation")).trim();
		String wsdlLocation = configProp.getWsdlLocation();
		stub = new OA_CMZ_SERVICEStub(wsdlLocation);
		stub._getServiceClient().getOptions().setProperty("__CHUNKED__", Boolean.FALSE);
		logger_742486d.error(String.valueOf("已获取wsdl"));
		OA_CMZ_SERVICEStub.OA_CMZ_MSGResponse response = stub.oA_CMZ_MSG(resultIn);
		OA_CMZ_SERVICEStub.ArrayOfOA_CMZ_RETURN_TYPE response_result = response.getOA_CMZ_MSGResult();
		OA_CMZ_SERVICEStub.OA_CMZ_RETURN_TYPE[] results = response_result.getOA_CMZ_RETURN_TYPE();
		logger_742486d.error(String.valueOf("调用接口------------------------完成"));
		OA_CMZ_SERVICEStub.OA_CMZ_RETURN_TYPE result = results[0];
		// 封装返回信息
		String[] rtInfo = new String[3];
		rtInfo[0] = result.getISTAT();
		rtInfo[1] = result.getMESSAGE();
		rtInfo[2] = result.getVBELN();
		return rtInfo;
	}
}
