从我的第一个WCF服务中的调用函数从vb.net Web form引发错误.函数调用丢失的参数,甚至不在WCF函数中



我刚刚写了我的第一个WCF服务,而且事情似乎很顺利,直到我需要在vb.net Web表单中使用该服务为止。服务中的功能声明为:

Public Function ProcessCCPaymentAuthorizeDotNet(InvoiceID As String, Description As String, CustomerID As String, CardNumber As String, ExpirationDate As String, _
    CVV As String, Price As String, FirstName As String, LastName As String, Address As String, State As String, Zip As String, CompanyName As String, BillingCity As String, _
    BillingState As String, BillingZip As String, Login As String, TranKey As String, MD5Hash As String, AuthorizeURL As String, ByRef ResponseReasonCode As Integer, _
    ByRef ResponseReasonText As String) As Integer Implements IService1.ProcessCCPaymentAuthorizeDotNet

我遇到的错误是:

Argument not specified for parameter 'ProcessCCPaymentAuthorizeDotNetResult' of 'Public Sub ProcessCCPaymentAuthorizeDotNet(InvoiceID As String, Description As String, CustomerID As String, CardNumber As String, ExpirationDate As String, CVV As String, Price As String, FirstName As String, LastName As String, Address As String, State As String, Zip As String, CompanyName As String, BillingCity As String, BillingState As String, BillingZip As String, Login As String, TranKey As String, MD5Hash As String, AuthorizeURL As String, ByRef ResponseReasonCode As Integer, ByRef ResponseReasonCodeSpecified As Boolean, ByRef ResponseReasonText As String, ByRef ProcessCCPaymentAuthorizeDotNetResult As Integer, ByRef ProcessCCPaymentAuthorizeDotNetResultSpecified As Boolean)'

我很好奇响应codeSpeced,processccpaymentauthorizedotnetresult和processccpaymentauthorizedOtnetnetresultsperifiend specifiend,因为它们不在服务呼叫的参数列表中。我确定这是一个新秀错误。任何帮助都非常感谢!

您要么没有调用您的函数ProcessCCPaymentAuthorizeDotNet,要么ProcessCCPaymentAuthorizeDotNet函数调用具有相同名称的其他方法,但签名不同。尽管如此,在堆栈的某个地方,另一个版本被调用,而预期参数(s(未传递。您可以通过查看方法的签名与错误消息中提供的签名来说明它们是相同的名称,但是不同的方法。最大的赠品是您的版本是一个函数,错误消息说sub。

我建议使用调试器逐步浏览代码。请记住,您始终可以尝试捕捉并查看异常的堆叠特性属性,以帮助您查明代码失败的位置。

我通过将<OperationContract()>更改为 <OperationContract(), XmlSerializerFormat(Style:=OperationFormatStyle.Document)>

再次感谢您的回复。

Mike

最新更新