Web service exception Could not load file/assembly services.aonaware.com after starting new instance


Badge +11

Hi


1. On the k2 for visual studio canvas add the following web reference - from project references-  http://services.aonaware.com/DictService/DictService.asmx: notice that services.aonaware.com will be added as a reference.


2. Add two datafields: Word and Meaning


3. add a server event and below it a mail event and set a destination user for the activity.


4. rightclick the server to view code then paste the folloing in the main: - dont forget the using services.aonaware.com in the declaration section -  


--------


try


{


WordDefinition wrddef = new WordDefinition();

DictService dictService = new DictService();


wrddef = dictService.Define(K2.ProcessInstance.DataFields[

"Word"].Value.ToString());


K2.ProcessInstance.DataFields[

"Meaning"].Value = wrddef.Definitions[0].WordDefinition;


}


catch (Exception ex)


{


K2.ProcessInstance.DataFields["Meaning"].Value = ex.Message;


String LogName = "Malibu";


if (!EventLog.SourceExists(LogName))


{


EventLog.CreateEventSource(LogName, LogName);


}


EventLog Log = new EventLog();


Log.Source = LogName;


Log.WriteEntry( ex.Message, EventLogEntryType.Error);


}


---------


5. In the email event put the WORD:MEANING pair datafields


6.Build and deploy the process.


7.From the k2workspce make sure the server rights and the process rights are enabled for the logged in user and the deployed process.


8. Click the instances tree child then click "start new" from the menu.


9. the following error appears


"Could not load file or assembly 'services.aonaware.com, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."


3 replies

Badge +11

Any body!!!


referencing a web service should be out of the box; i should'nt have any propblem dealing with it.

Badge +6

Are you using a design time or run time proxy?


I created a custom wcf service using the SharePoint OM to access SharePoint via my K2 process, but used a runtime proxy using the .net ChannelFactory<>, works like a charm, then you're not bound to design time proxies to change during deployment. I read my wcf service binding info, etc from a seperate class library project (assembly) so that the K2 App domain does not override it at runtime. The path to the assembly I store as an K2 Environment variable, which can be changed to the desired production location, prior to deployment.


Hope this helps a bit?

Badge +11

Thnaks for the reply


i am using the design time proxy because i am referencing the http://services.aonaware.com/DictService/DictService.asmx WEB SERVICE and using it in my code.


In my project i must use a web service published by a govermental institute. i cannot use runtime proxy and i am restricted to use the design time proxy.


The question now becomes CAN I USE DESIGN TIME PROXY IN K2?

Reply