Reputation: 11
I've just written my first WCF Service and things seemed to go pretty smoothly until I needed to consume the service in a VB.NET web form. The Function declaration in the service is:
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
The error that I'm getting is:
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)'
I'm curious where ResponseReasonCodeSpecified, ProcessCCPaymentAuthorizeDotNetResult, and ProcessCCPaymentAuthorizeDotNetResultSpecified even came from as they are not in the list of parameters to supply to the service call. I'm sure this is a rookie mistake. Any help is greatly appreciated!
Upvotes: 1
Views: 55
Reputation: 11
I fixed my issue by changing <OperationContract()>
to
<OperationContract(), XmlSerializerFormat(Style:=OperationFormatStyle.Document)>
.
Thanks again for your response.
Mike
Upvotes: 0
Reputation: 9193
Either you are not calling your function ProcessCCPaymentAuthorizeDotNet
or your ProcessCCPaymentAuthorizeDotNet
function calls a different method with the same name, but different signature. None the less, somewhere down the stack the other version gets called and an expected parameter(s) is(are) not passed. You can tell they are the same name but different Methods by looking at the signatures of your method versus the one provided in the error message. The biggest give away though is that your version is a function and the error message says Sub.
I recommend stepping through the code with the debugger. Remember that you can always include a try catch and look at the StackTrace Property of the exception to help you pinpoint where the code is failing.
Upvotes: 1