我刚刚编写了我的第一个WCF服务,事情看起来非常顺利,直到我需要在VB.NET Web表单中使用该服务。服务中的Function声明是:
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)'
我很好奇ResponseReasonCodeSpecified,ProcessCCPaymentAuthorizeDotNetResult和ProcessCCPaymentAuthorizeDotNetResultSpecified的位置,因为它们不在供应给服务调用的参数列表中。我确定这是一个新手的错误。非常感谢任何帮助!
答案 0 :(得分:1)
要么您没有调用函数ProcessCCPaymentAuthorizeDotNet
,要么您的ProcessCCPaymentAuthorizeDotNet
函数调用具有相同名称但签名不同的其他方法。尽管如此,在堆栈的某个地方,另一个版本被调用,并且未传递预期的参数。您可以通过查看方法的签名与错误消息中提供的签名来判断它们的名称相同但方法不同。但最大的问题是您的版本是一个函数,错误消息显示为Sub。
我建议stepping through the code with the debugger。请记住,您始终可以包含try catch并查看异常的StackTrace属性,以帮助您确定代码失败的位置。
答案 1 :(得分:0)
我通过将SELECT mu.`id`, mu.`email`
FROM `merchant` m
LEFT JOIN `merchant_user_permission` mup ON m.id = mup.merchant_id
LEFT JOIN `merchant_user` mu ON mu.id = mup.user_id
WHERE mup.`merchant_id` = '123-3456-7789-qwerty'
更改为修正了我的问题
<OperationContract()>
。
再次感谢您的回复。
麦克