delphi 调用c#写关于a+b的webservice,返回值不对?该如何处理
delphi 调用c#写关于a+b的webservice,返回值不对?
调用helloWorld的返回值是正确的,调用add的时候,传入(1,2)时,返回值却为0,不知什么原因,这个问题困惑了很久,请高手们指教~
以下是源码
//c#写的webservice的源码
[WebService(Namespace = "http://tempuri.org/ ")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class servTest : System.Web.Services.WebService {
public servTest () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string HelloWorld() {
return "Hello World ";
}
[WebMethod]
public int add(int a, int b)
{
return a + b;
}
}
//*****************************************
//**************************************
//wdsl导入的代码
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : http://10.20.10.224/servTest.asmx?wsdl
// Encoding : utf-8
// Version : 1.0
// (2007-7-27 下午 04:48:35 - 1.33.2.5)
// ************************************************************************ //
unit servTest;
interface
uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
type
// ************************************************************************ //
// The following types, referred to in the WSDL document are not being represented
// in this file. They are either aliases[@] of other types represented or were referred
// to but never[!] declared in the document. The types from the latter category
// typically map to predefined/known XML or Borland types; however, they could also
// indicate incorrect WSDL documents that failed to declare or import a schema type.
// ************************************************************************ //
// !:string - "http://www.w3.org/2001/XMLSchema "
// !:int - "http://www.w3.org/2001/XMLSchema "
调用helloWorld的返回值是正确的,调用add的时候,传入(1,2)时,返回值却为0,不知什么原因,这个问题困惑了很久,请高手们指教~
以下是源码
//c#写的webservice的源码
[WebService(Namespace = "http://tempuri.org/ ")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class servTest : System.Web.Services.WebService {
public servTest () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
public string HelloWorld() {
return "Hello World ";
}
[WebMethod]
public int add(int a, int b)
{
return a + b;
}
}
//*****************************************
//**************************************
//wdsl导入的代码
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : http://10.20.10.224/servTest.asmx?wsdl
// Encoding : utf-8
// Version : 1.0
// (2007-7-27 下午 04:48:35 - 1.33.2.5)
// ************************************************************************ //
unit servTest;
interface
uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
type
// ************************************************************************ //
// The following types, referred to in the WSDL document are not being represented
// in this file. They are either aliases[@] of other types represented or were referred
// to but never[!] declared in the document. The types from the latter category
// typically map to predefined/known XML or Borland types; however, they could also
// indicate incorrect WSDL documents that failed to declare or import a schema type.
// ************************************************************************ //
// !:string - "http://www.w3.org/2001/XMLSchema "
// !:int - "http://www.w3.org/2001/XMLSchema "