Skip to main content

Hello,

 I have added a web service URL to the Workflow web service(s). How can i call the web service from code (default server event)?

 
Actually i was looking for some documentation on blackpearl but could not find any.. There are some labs on the portal to download, but there is nothing about coding..

could you please give me some directions?
 

In a server code event you call the web service just like you would from any .NET code.  Declare an instance of the service, set it's credentials and url (if needed), then invoke methods on it.


 InvoiceService.Service1 Serv = new InvoiceService.Service1();
 Serv.Credentials = System.Net.CredentialCache.DefaultCredentials;  //if needed


 //Serv.url =  ...set url if needed
 int ID = (int) K2.ProcessInstance.DataFieldsa"id"].Value;


 bool bl = Serv.DealProfessionalRequired(ID);


Thank you, but where can I add the web service reference, so the proxy class (in this case InvoiceService.Service1) can be generated?

Hi,


Just click on the "Project References" icon


 referenceex5.png


In the window, click "Add", then go to the "Web" tab.


Thank you guys, you've helped me a lot

Reply