Accessing a webservice from Access 2007..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • totomalas
    New Member
    • Aug 2009
    • 31

    Accessing a webservice from Access 2007..

    My goal is to populate some fields in my table using a webservice that was created by other programmers in the company, and i have been told that i need SOAP to call it. I have tried using the SOAP toolkit and i keep getting "Access denied error", even after I supplied the user name and password....my code is as below:

    Private Sub button1_Click()

    Dim client As MSOSOAPLib30.So apClient30

    Set client = New SoapClient30


    Call client.MSSoapIn it(par_Wsdlfile :="http://wsdl.address")

    client.Connecto rProperty("Auth User") = "user"
    client.Connecto rProperty("Auth Password") = "pss"
    client.Connecto rProperty("Requ estHTTPHeader") = 1

    'call method
    client.populate


    End Sub



    please tell me why i keep getting access denied error, and is there any other code or way to call a webservice into Access?..Thanks ..
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Originally posted by totomalas
    My goal is to populate some fields in my table using a webservice that was created by other programmers in the company, and i have been told that i need SOAP to call it. I have tried using the SOAP toolkit and i keep getting "Access denied error", even after I supplied the user name and password....my code is as below:

    Private Sub button1_Click()

    Dim client As MSOSOAPLib30.So apClient30

    Set client = New SoapClient30


    Call client.MSSoapIn it(par_Wsdlfile :="http://wsdl.address")

    client.Connecto rProperty("Auth User") = "user"
    client.Connecto rProperty("Auth Password") = "pss"
    client.Connecto rProperty("Requ estHTTPHeader") = 1

    'call method
    client.populate


    End Sub



    please tell me why i keep getting access denied error, and is there any other code or way to call a webservice into Access?..Thanks ..
    Try:
    Code:
    Dim client As MSOSOAPLib30.SoapClient30
    
    Set client = New SoapClient30
    
    client.ClientProperty("ServerHTTPRequest") = True
    client.ClientProperty("AuthUser") = "user"
    client.ClientProperty("AuthPassword") = "pss"
    client.ClientProperty("RequestHTTPHeader") = True
    
    client.MSSoapInit "http://wsdl.address"

    Comment

    • totomalas
      New Member
      • Aug 2009
      • 31

      #3
      Thank you,I have tried your code, but now i am getting a new error which say

      The property "AuthUser" is not recognized... :(...although I have the SOAP toolkit referenced....

      Comment

      • totomalas
        New Member
        • Aug 2009
        • 31

        #4
        Can anyone please help......... my whole project depends on this... :(

        Comment

        • ADezii
          Recognized Expert Expert
          • Apr 2006
          • 8834

          #5
          Originally posted by totomalas
          Can anyone please help......... my whole project depends on this... :(
          Reference the Object Browser to set what the valid Objects, Properties, and Methods are for the Class Library. I no Reference to refer to at this end.

          Comment

          • totomalas
            New Member
            • Aug 2009
            • 31

            #6
            Im sorry but I dont understand what you mean..

            Comment

            • ADezii
              Recognized Expert Expert
              • Apr 2006
              • 8834

              #7
              Originally posted by totomalas
              Im sorry but I dont understand what you mean..
              In any Code Window, press F2 which will Open the Object Browser. Select the SOAP Library in the upper left hand corner. Now, all the valid Properties, Methods, and Events for this Class Library will be exposed in the lower panes. This will greatly help you with syntax to see if you are using the correct one such as ClientProperty vs. ConnectorProper ty, etc.

              Comment

              Working...