hometown 2005年03月22日
请教:如何在asp中调用apache soap做的Web Services。
在java中调用程序如下:
import java.io.*;
import java.net.*;
import java.util.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;
public class HelloWorldClient {
public static void main(String[] arg) throws Exception {
Call c = null;
URL url = null;
Vector params = null;
Response rep = null;

Date date = new Date();

//订单产生时间
System.out.println (date.toLocaleString());

String argName = "fuuftuto";
String argPassword = "23435dtrtr";
String argSex = "1";
String argMail = "adf@din.com";
String argSysID = "2";

String ourUrn = "urn:registr";

String ourMethod = "registrUser";
url = new URL("http://211.144.143.25:8080/soap/servlet/rpcrouter");
for (int i = 26745; i < 200000; i++) {
argName = "" + i;
System.out.println("Passing to our deployed "+ourUrn+" argName ("+argName+"): ");
c = new Call();
c.setTargetObjectURI(ourUrn);
c.setMethodName(ourMethod);
c.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
params = new Vector();
params.addElement(new Parameter("argName", String.class,
argName, null));
params.addElement(new Parameter("argPassword", String.class,
argPassword, null));
params.addElement(new Parameter("argSex", String.class,
argSex, null));
params.addElement(new Parameter("argMail", String.class,
argMail, null));
params.addElement(new Parameter("argSysID", String.class,
argSysID, null));
c.setParams(params);
System.out.print("and its answer is: ");
rep = c.invoke(url, "");
if (rep.generatedFault()) {
Fault fault = rep.getFault();
System.out.println("\nCall failed!");
System.out.println("Code = " + fault.getFaultCode());
System.out.println("String = " + fault.getFaultString());
System.out.println("DetailEntries = " + fault.getDetailEntries());
System.out.println("FaultActorURI = " + fault.getFaultActorURI());
System.out.println("FaultEntries = " + fault.getFaultEntries());
//System.out.println("Code = " + fault.getFaultCode());



} else {
Parameter result = rep.getReturnValue();
System.out.print(result.getValue());
System.out.println();
}
}
}
}

请问在ASP中如何调用呢?
...全文
34 点赞 收藏 4
写回复
4 条回复

还没有回复,快来抢沙发~

发动态
发帖子
Web 开发
创建于2007-09-28

5.2w+

社区成员

34.1w+

社区内容

Java Web 开发
社区公告
暂无公告