Skip to main content
Nintex Community Menu Bar

Dynamic Web Service Reference

  • July 23, 2009
  • 2 replies
  • 13 views

Forum|alt.badge.img+8
I am referenceing a web service in a server event. In a regular VS project I can dynamically change the web reference to the WSDL depending on my environment. I cannot see how to do this using the string table to refernce the url to the WSDL. Am I missing something?

2 replies

Forum|alt.badge.img+8
  • July 23, 2009

Hi,


you should be able to just set the url property of the proxy class, here is a code snippet:


using

SourceCode.Workflow.Common.Authentication;
.
.
.
.
ADCredentials k2creds = new ADCredentials();
xWS.K2HRService ws = new xWS.K2HRService();
ws.Url = K2.StringTable["webServiceURL"];
ws.Credentials = k2creds.GetCredentials(ws.Url);


 


Forum|alt.badge.img+6
  • July 24, 2009

You can also go for the no design time proxy option by making use of the ChannelFactory<> of .net, that is if you have a WCF Service off course, then you can change the deployment settings all in its config, without having to wory to change it in code.