Skip to main content
Planview Customer Success Center

Web Services API cannot be used after upgrade to CP 2010 SP2

Symptoms
The connection test using http://.../cpwebservice/wslogin.asmx is working.  Other methods such as Changepoint.CPWebService.Time.Add or Changepoint.CPWebService.Time.GetTimeByRes fail.
 
Error/warning messages
Logging in via web services causes the following warning in web service log file:

4:55:08 PM Level5: Warning for error code:-2003 Login user password is not provided by AccessToken.
  
GetTimeByRes causes the following error in web service log file:

4:55:08 PM Level2: Error: Number= -1 Message= Operation failed (system error).
4:55:08 PM Level2: StackTrace: at Changepoint.ChangepointAPI2.ApiTime.GetTimeByRes(String sResourceId, DateTime daStartDate, DateTime daEndDate)
at Changepoint.CPWebService.Time.GetTimeByRes(String ResourceId, DateTime StartDate, DateTime EndDate)
  
Reason
Web Services API was still the 2010 SP1 version, whereas the Changepoint application was 2010 SP2.


Resolution
Install Changepoint API 2010 SP2.

The sample code below can be used for a simple login test and version check:

Try
token = New UsernameToken(username.Text, password.Text, PasswordOption.SendHashed)
token.Id = "LOGIN"
proxy.RequestSoapContext.Security.Tokens.Add(token)
proxy.Url = url.Text & "/WSLogin.asmx"
'version of \API\CP Web Services\bin\CPWebService.dll
'version of \API\CP Web Services\bin\ChangepointAPI2.dll
MsgBox(proxy.GetVersion)
loginUser = proxy.Login(username.Text)

If Not loginUser.WSException.HaveErrors And Not loginUser.value Is Nothing Then
    MsgBox("Logged in successfully")
Else
    MsgBox(loginUser.WSException.Message, MsgBoxStyle.Critical)
End If

int_id = loginUser.value.UserId
int_token = loginUser.value.AccessToken

Catch ex As Exception
    MsgBox(ex.ToString)

End Try