JAVA Axis2調用WebService

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import javax.xml.rpc.ServiceException;       


     
            String url = "";
            String methodName = "";
            String targetNameSpace = "";

            Service service = new Service();
            Call call = (Call)service.createCall();
            call.setTargetEndpointAddress(new URL(UrlEncode.encodeURI(url)));
            call.setOperationName(
                    new QName(targetNameSpace,
                            methodName));
            call.addParameter("projectId", XMLType.XSD_STRING,
                    ParameterMode.IN);
            call.addParameter("templateName", XMLType.XSD_STRING,
                    ParameterMode.IN);
            call.addParameter("data", XMLType.XSD_BASE64,
                    ParameterMode.IN);
            Object res = call.invoke(new Object[] { projectId, templateName, bytes});

相關文章
相關標籤/搜索