Results 1 to 4 of 4
  1. #1
    Gdm is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2010
    Posts
    28

    How to call webservice with parameters in vba?

    Calling my web service without parameters works with this code:



    sUrl = "http://www.mysite.com/MyService.asmx?op=MyFunction"
    Set XMLHTTP = CreateObject("MSXML2.XMLHTTP")
    XMLHTTP.Open "GET", sUrl, False
    XMLHTTP.sEnd
    byteData = XMLHTTP.responseBody

    When I try to add parameters, it fails, with this url:
    sUrl = "http://www.mysite.com/MyService.asmx?op=MyFunction&Parm1=abc&Parm2=def&P arm3=ghi"

    The service is expecting 3 string parameters.

    Any ideas most appreciated.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    So Parm1 and Parm2 and Parm3 are defined in MyFunction?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Gdm is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2010
    Posts
    28
    Yes, Parm1, Parm2, and Parm3 are defined in MyFunction.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    Everything I've read says your code should work.

    Possibly the issue is not with Access.

    Bing: vb call web service with multiple parameters in url for function

    This concerns SQLServer and passing parameters to a report. https://msdn.microsoft.com/en-us/lib...or=-2147217396

    This seems to be similar to your issue http://scn.sap.com/thread/1689628
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Call query with parameters provided
    By hufflehuffle in forum Queries
    Replies: 2
    Last Post: 07-12-2014, 02:01 PM
  2. Call A function
    By aspen in forum Programming
    Replies: 10
    Last Post: 03-16-2014, 12:57 PM
  3. Send Report to webservice
    By Vanam in forum Reports
    Replies: 5
    Last Post: 11-25-2013, 05:04 AM
  4. Not even sure what to call this one
    By eizquierdo in forum Queries
    Replies: 2
    Last Post: 03-14-2013, 12:08 PM
  5. Obtaining .net Webservice Data
    By Azmail in forum Programming
    Replies: 0
    Last Post: 01-26-2011, 08:36 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums