using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
//[WebServiceBinding(ConformsTo = WsiProfiles.None)]
//[SoapRpcService(RoutingStyle = SoapServiceRoutingStyle.SoapAction)]
public class Service : System.Web.Services.WebService
{
public Service () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string HelloWorld() {
return "Hello World";
}
[WebMethod(Description = "加法测试")]
public int Count(int x,int y)
{
return x + y;
}
[WebMethod(Description = "上传测量记录")]
public int Upload(string data)
{
return 1;
}
}
如果红字部分打开,则是采用RPC方式传递参数,缺省的BCB就是这样处理的,否则是采用Document|Literal 方式传递,BCB自动生成的代码要加上InvRegistry()->RegisterInvokeOptions(__interfaceTypeinfo(ServiceSoap), ioDocument);才可以正确传递参数。