none
using webservice inside VBA (Macro) in Project RRS feed

  • Question

  • I published this Code in the Enterprise Global File and i checked to see if the code is available on the Other Client Computer and its available.

    This code seems to be working on my machine but not on my colleagues computer. 

     

    Private Const c_WSDL_URL As String = "http://servername/serviceName.svc?wsdl"

    Public Sub CallWebService(workRef As String, tk As Task)

    On Error GoTo Err_CallWebService

            Dim oClient As SoapClient30

            Set oClient = New SoapClient30

            Dim iresult As Boolean

            oClient.mssoapinit c_WSDL_URL

            iresult = oClient.MethodName(workRef)

            If iresult = False Then

                tk.Flag1 = False

                SelectRow Row:=tk.ID, RowRelative:=False

                Font Color:=pjRed

                Else

                SelectRow Row:=tk.ID, RowRelative:=False

                Font Color:=pjBlack

                tk.Flag1 = True

            End If

            Set oClient = Nothing

            Exit Sub

    Err_CallWebService:

        MsgBox ("Error on : " & workRef & " " & Err.Description)

    End Sub

     

    thanks 


    Simi
    Wednesday, June 22, 2011 5:24 AM

All replies

  • Hello Simi,

    It seems that you are an administrator on PWA but your coworker might not be the admin so when you are making a PSI web service call, You are able to make it but when Its going from your co-worker's machine, Its not successful.
    You will need to impersonate the user account.

    Sample code by using c# just to give you a start :

    Down load the Project 2010 SDK, to get the samples

    http://msdn.microsoft.com/en-us/library/ff181538.aspx#Y11493
    http://msdn.microsoft.com/en-us/library/bb428835(v=office.12).aspx 

     

     


    Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82
    • Marked as answer by Jim Corbin Wednesday, June 22, 2011 1:48 PM
    • Unmarked as answer by Simi Varghese Saturday, June 25, 2011 6:16 AM
    Wednesday, June 22, 2011 6:20 AM
  • Hello Amit:

    The web service is accessible from Excel however not from Project .   The webservice is not an PSI web service call.The webservice is something i developed for my business requirement and it does not involve  project information. The error i get is as below.

     

    WSDLReader:Loading of the WSDL file failed HRESULT=0x8007007E  any idea? saying the module cannot be found.

    My webservice code is inside a ClassModule.


    Simi


    Saturday, June 25, 2011 6:22 AM