使用Web服务时出现“参数数量不正确”错误

时间:2013-06-10 13:14:13

标签: soap asp-classic

我有这个网络服务:
https://pgws.bpm.bankmellat.ir/pgwchannel/services/pgw?wsdl

Web服务具有bpPayRequest方法,该方法采用10个参数作为Web服务提供商定义如下:

bpPayRequest(long terminalID, string username, string password, long orderID, long amount, string localDate, string localTime, string additionalData, string callbackURL, long payerID)

我正在使用ASP Classic,这是我的代码:

<%
RedirectURL = "http://" & Request.ServerVariables("SERVER_NAME") & "/Frontend/epayverify_l2.asp"

set oSOAPay = Server.CreateObject("MSSOAP.SoapClient30")
oSOAPay.ClientProperty("ServerHTTPRequest") = True
on error resume next
oSOAPay.mssoapinit(webServiceAddr)
oSOAPay.ConnectorProperty("UseSSL") = False 
if err.number <> 0 Then
    if DebugMode Then
        rwbr err.description
        response.end
    Else
        epayAction = false
        this_error = "banknotresponse"
        Exit for
    End if
End if
on error goto 0

result = oSOAPay.bpPayRequest(_
    CLng(str_terminal), _
    CStr(M_ID), _
    "password", _
    CLng(int_orderID), _
    CLng(Amount), _
    "20130610", _
    "102030", _
    "", _
    CStr(RedirectURL), _
    0)
%>

这是result = oSOAPay.bpPayRequest参数的值:

oSOAPay.bpPayRequest( 709499, "11111", "password", 2, 1000, "20130610", "102030", "", "http://mitranik.com/Frontend/epayverify_l2.asp", 0 )

问题是当我运行此代码时,我收到此错误。

Client:Incorrect number of parameters supplied for SOAP request HRESULT=0x80070057: The parameter is incorrect. - Client:Unspecified client error. HRESULT=0x80070057: The parameter is incorrect.
我在这里错过了一些东西吗?

1 个答案:

答案 0 :(得分:1)

Web方法需要9个参数:

  1. long terminalID
  2. string username
  3. 字符串密码
  4. long orderID
  5. 长量
  6. string localDate
  7. string localTime
  8. string callbackURL
  9. long payerID
  10. 但是当你使用它时,你给它10个参数:

    1. CLng函数(str_terminal)
    2. CStr的(M_ID)
    3. “密码”
    4. CLng函数(int_orderID)
    5. CLng函数(金额)
    6. “20130610”
    7. “102030”
    8. “”
    9. CStr的(的redirectUrl)
    10. 0
    11. 参数#8(固定的空字符串)是罪魁祸首,只是摆脱它:

      result = oSOAPay.bpPayRequest(_
          CLng(str_terminal), _
          CStr(M_ID), _
          "password", _
          CLng(int_orderID), _
          CLng(Amount), _
          "20130610", _
          "102030", _
          CStr(RedirectURL), _
          0)