现在,应用程序已发布为 xml web services,并且可以使用 soap 激活。使用 internet explorer 浏览到 http://localhost/vb6soap/default.aspx,您会在该 aspx 页上发现一个超链接,通过它可以链接到您的组件所生成的 wsdl。以下 vbscript 将激活您的组件:
set c = getobject ("soap:wsdl=http://localhost/vb6soap/vb6soap.calc.soap?wsdl") for i = 1 to 10 wscript.echo i & " " & c.add(i,i) & " " & time next
要通过 soap toolkit(与 windows xp professional 一起提供,并且不使用 .net remoting)访问同一端点,请运行以下 vbscript:
set c = createobject("mssoap.soapclient") c.mssoapinit("http://localhost/vb6soap/vb6soap.calc.soap?wsdl") for i = 1 to 10 wscript.echo i & " " & c.add(i,i) & " " & time next
set c = getobject ("soap:wsdl=http://localhost/cssoap/cssoap.calc.soap?wsdl") for i = 1 to 10 wscript.echo i & " " & c.add(i,i) & " " & time next
作为 soap 交互操作性的简单示例,soap toolkit 与 windows xp professional 一起提供,并且即使运行 windows xp 的客户端计算机上没有安装 .net 框架,使用以下 vbscript 也可以访问 com+ soap 端点:
set c = createobject("mssoap.soapclient") c.mssoapinit("http://localhost/cssoap/cssoap.calc.soap?wsdl? for i = 1 to 10 wscript.echo i & " " & c.add(i,i) & " " & time next