Credentials and calling a webservice

  • 2 August 2005
  • 1 reply
  • 0 views

Badge
I have a webservice call from K2 that uses code generated by K2 a wizard in the K2 studio:
oWebService.Credentials = SourceCode.K2Utilities.GeneralMod.GetCredentials(oWebService.Url);

I can not find any documentation on the GetCredentials method or where those credentials are set. It looks like K2 is storing them somewhere and using the context of the webservice url to identify them. My question, is how do I set the credentials? When we move from dev to production the credentials will change.

1 reply

Badge +9
Hi Mark,

If you make use of the Web Service and Assembly event you will find that you can specify the credentials during the configuration of the Wizard, the credentials will be exposed in Clear Text in the generated code, to allow for easy switching between Dev and Production, make use of String Table entries to store the credentials. String Table variables can be updated making use of K2.net 2003 Service Manager, this will have a direct effect on the processes as the values of string tables are retrieved Real Time during execution of the process instance.

The generated code that contains the credentials is below:
Dim credentials As NetworkCredential = New NetworkCredential(K2.StringTable("UserName"),K2.StringTable("Password"),K2.StringTable("Domain"))


Regards,
Renier

Reply