mibuso.com

Microsoft Business Solutions online community
It is currently Wed Sep 17, 2014 5:30 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Pre-Allow Automation Components in Web Service
PostPosted: Tue Dec 04, 2012 5:41 pm 
Offline

Joined: Tue Oct 20, 2009 9:23 pm
Posts: 33
I am trying to port some legacy NAV code to 2013, and it uses the MSXML automation components. However, in a web service this fails as NAV wants to issue a prompt to allow the automation component to run (i.e. Allow for this session, always allow, never allow, etc.). Is there a way to pre-allow automation components to run?

I suppose I could log in as the service account (which is currently Local System... this would need to change) and run it in a process in the GUI to allow it, but this is not a very clean method.


Top
 Profile E-mail  
 
 Post subject: Re: Pre-Allow Automation Components in Web Service
PostPosted: Wed Dec 05, 2012 3:13 am 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 9046
Location: 3rd rock from sun
Country: United States (us)
How did you find out that is the problem? Anything instantiated at the server doesn't pop up the dialog. It only opens when you instantiate the automation at the client.
I suggest to use dotNET type instead of automation control. The performance is much better.

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject: Re: Pre-Allow Automation Components in Web Service
PostPosted: Wed Dec 05, 2012 4:42 pm 
Offline

Joined: Tue Oct 20, 2009 9:23 pm
Posts: 33
Thanks for the reply.

The error is obvious enough coming from NAV, and I used the debugger to debug the web service through until it issues a CREATE statement.

Additionally, the 2013 help explicitly says not to issue a FALSE value to the OnClient parameter:

Quote:
OnClient
Type: Boolean

OnClient must evaluate to true. You can either set the parameter to true or define a Boolean type variable that evaluates to true. If variable evaluates to false, then you will see a run-time error.


I definitely agree on the DotNet variable, but that would require a decent amount of rewrite. Right now we are just trying to get it up and running on 2013.

There should be a way to pre-allow automation components, no? I'm sure this is a registry setting or some other setting.


Top
 Profile E-mail  
 
 Post subject: Re: Pre-Allow Automation Components in Web Service
PostPosted: Wed Dec 05, 2012 5:22 pm 
Offline

Joined: Thu Oct 30, 2008 10:38 am
Posts: 1005
Location: Earth
Country: Netherlands (nl)
Since the webservice runs probably on the server, the onclient may be set to true.
Next is your conclusion: Because the webservice fails at the create issue, you instantly think it's the confirmation dialog. While it may be the automation itself that is already created (due to an omitted isclear check), or something else.

Next is the help of 2013 actually stating that when an automation is created on the server, a runtime error will appear. Which is like saying that the old onserver option is wrong and the default option of onclient is false is something like a bad joke.

Create the automation on the client (which is still the server) and see if that resolves your error.

_________________
|Pressing F1 is so much faster than opening your browser|
|MCBMSS: 5.0 intro|MCTS:NAV09 839..841|JetReports© Certified Specialist|
|Dynamics Anywhere: Mobile Business Solutions|


Top
 Profile  
 
 Post subject: Re: Pre-Allow Automation Components in Web Service
PostPosted: Wed Dec 05, 2012 6:27 pm 
Offline

Joined: Tue Oct 20, 2009 9:23 pm
Posts: 33
I'm not sure if I was clear. You *have* to create an automation with the client parameter set to TRUE. It won't compile otherwise in 2013 - try it out to see the message you get.

The issue at stake here is not was the automation already instantiated. I have seen this same error before in previous NAV versions:

Quote:
Microsoft Dynamics NAV Business Web Services attempted to issue a client callback to create an Automation object...


I have also created it in a simple processing report to confirm that it wants to prompt for access to the automation object. These are not things I need help with, but I do appreciate the input. Troubleshooting this is 100% simple - figuring out how to get around this needless security obstacle is not.

Just to reiterate back to my OP: Does anyone know how to automatically set an automation component to always allow the creation?

We set the service to run under a user account, ran a batch process to prompt for the creation of the same component and chose "always allow", but we still get the same prompt under the context of the web service. The inclusion of this prompt is frustrating, and any help is appreciated.


Top
 Profile E-mail  
 
 Post subject: Re: Pre-Allow Automation Components in Web Service
PostPosted: Wed Dec 05, 2012 6:41 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 9046
Location: 3rd rock from sun
Country: United States (us)
Also 32 bit automation are not supported on Service tier in 2013.

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject: Re: Pre-Allow Automation Components in Web Service
PostPosted: Thu Dec 06, 2012 10:06 am 
Offline

Joined: Mon Sep 08, 2008 10:25 am
Posts: 515
Location: Switzerland
Country: Switzerland (ch)
ara3n is right, your problem is the component itself for sure! I bet it's 32bit COM component, which won't work with 64-bit NAV service Tier...
And therefore you're forced to create the component on the client (Param Client = TRUE). I assuem even if it would be a 64bit COM Component it wouln't work because they prevent to create an instance for com objects on the server side.

Refactor your application for using .net XMLDocument Class, and your fine. Almost all methods are the same as for MSXML Automation, only syntax changes have to be done (I've done that in the past).

_________________
My Blog


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: