高手請幫忙看看小弟寫的這個web service:

cold_liu發表於2004-04-29
小弟寫了下面這個:基於apache axis 和java的web service 程式,用來呼叫基於C的伺服器端程式,可是編譯執行後,總是提示說引數無法傳遞....不知是何緣故,請高手指點一二:
另外,小弟有個建議,就是:能否專門開闢一個專欄用語討論和研究Web service技術的 ^_^
import java.util.Date;
import java.text.DateFormat;
import java.util.Date;
import java.text.DateFormat;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
import java.lang.Integer;
import javax.xml.rpc.ParameterMode;
public class DeliverClient {
public DeliverClient() {
}
public static void main(String[] args) {
System.out.println("+++++++++++++++++++++++++++++++ 聯通SP簡訊程式 +++++++++++++++++++++++++++++++");
System.out.println("+ +");
System.out.println("+ SMS130-1.0版本 創作:Cold_liu@hotmail.com 日期:2004-4-27 +");
System.out.println("+ +");
System.out.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
try {
String LoginName = "cwtest41";
String LoginPassword = "cwsmstest41";
String endpoint="http://211.94.227.177/smsservice/service.asmx";
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName(new QName("cn.com._2266.www","Deliver"));
call.addParameter("LoginName",org.apache.axis.encoding.XMLType.XSD_DATE,javax.xml.rpc.ParameterMode.IN);
call.addParameter("LoginPassword",org.apache.axis.encoding.XMLType.XSD_DATE,javax.xml.rpc.ParameterMode.IN);
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
call.setUseSOAPAction(true);
call.setSOAPActionURI("http://www.2266.com.cn/Deliver");
String[] k = (String[])call.invoke(new String[]{LoginName,LoginPassword});
for (int i=0;i<k.length;i++){
System.out.println( "result is " + k);
}
}
catch (Exception e) {System.err.println(e.toString());}

}



}

相關文章