更新:所以我想我需要以某種方式在方法參數中提交一個複雜類型 - 如何使用VBA執行此操作?VBA MSSOAP.SoapClient30錯誤:爲SOAP請求提供的參數數量不正確HRESULT = 0x80070057
這是我第一次編碼VBA,我會很感激任何可能的指針,我如何解決這個問題。基本上,我已經寫了一點soap服務,它工作正常 - 我用SoapUI測試它 - 所以我猜其他應用程序應該能夠使用它。
The WSDL the service generates is here。也許,VBScript SOAPClient使用起來並不太友好 - 在這個方向上的任何點都會有很大的幫助。
我試圖把一些代碼放在一起,實際使用它(下面的VBScript) - 我已經建立了它,而我發現谷歌搜索時發現的例子。它會產生以下錯誤:
Incorrect number of parameters supplied for SOAP request HRESULT=0x80070057
Module Module1
Dim WSDLFileName As String
Dim base64attachment As String
Dim attachment_filename As String
Dim summary As String
Dim SoapClient
Dim res
Sub Main()
WSDLFileName = "http://localhost:7777/?wsdl"
base64attachment = "UG9ydG1hbiBpcyBwb3J0Zm9saW8gbWFuYWdlbWVudCBzb2Z0d2FyZSB0byBoZWxwIFBNTyBrZWV"
attachment_filename = "test_file.txt"
summary = "test issue with summary"
SoapClient = CreateObject("MSSOAP.SoapClient30")
SoapClient.MSSoapInit(WSDLFileName)
res = SoapClient.CreateJiraIssueWithBase64Attachment(summary, base64attachment, attachment_filename)
Console.Out.WriteLine(res)
End Sub
End Module
任何指針都會幫助,我迷失在這裏。
我期待它應該創造這樣的迴應:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:open="open.JiraAdapter">
<soapenv:Header/>
<soapenv:Body>
<open:CreateJiraIssueWithBase64Attachment>
<open:summary>some summary</open:summary>
<open:base64attachment>BASE64CODEDFILE</open:base64attachment>
<open:attachment_filename>NAME of the file attached</open:attachment_filename>
</open:CreateJiraIssueWithBase64Attachment>
</soapenv:Body>
</soapenv:Envelope>