By Wayne Brill
It is not obvious how to get the WebServiceManager in a WebService extension event handler. One of the arguments passed into the event is named “sender” by default. (A Vault event handler will have a sender and event arguments). The sender argument is simple object but it can be cast it to IWebService. You can use IWebService to create WebServiceCredentials and this can be used to create new instance of WebServiceManager. Here is a C# example of an event handler that gets the WebServiceManager:
WebServiceCredentials CurrentCredentials =
WebServiceManager ServiceManager =
Note: Some operations may not work correctly when it’s executed from event handler (i.e. modifying of mapped properties when file is already open in Inventor). For such cases the safer approach may be to schedule a job and perform operation later.