Monday, March 26, 2012

PLEASE HELP - Accessing Web Services through Windows App

I am running a vb.net application that is using the Web Service to
issue Update Snapshot. There is a Windows account we are using as a
Service account that has the proper permissions to Generate Events.
The application is running on AutoSys on a 2003 server. I have
confirmed that it will run under this users credentials manually by
logging into the server as the user and firing the app. It works
without a problem. This was using Default Credentials.

The AutoSys job is configured to run under this user's credentials.
There are three ways I have executed this application

>>Through AutoSys running as the user with the proper permissions (this is in place of a Local Service account which is default for AutoSys. This windows user has local admin permissions on the AutoSys server as well as Generate Event permission as confirmed before)
>>By logging into the server as Administrator and executing the app with "Run As..." set to the Windows ID
>>By switching to new.NetworkCredentials and passing the hardcoded username/pass/domain

For all of the above scenarios - it fails

The ONLY time it successfully issues UpdateSnapshot is when I am
logged in to the server as the user in question. In ALL other
instances detailed above it fails and the following comes out of the
event log

"Line 1: Incorrect syntax near 'MyDomainName'.

I have no idea why it is choking on the Domain Name in all three of
those scenarios.

Do I need to impersonate that user through code when passing the Web
Service credentials?

PLEASE PLEASE PLEASE help - I need to wrap this up. ANY HELP WOULD BE
GREATLY APPRECIATED

Could you show a sample of your code? Syntax error indicates compilation/parsing error. AutoSys method #2 or #3 sound like they should be workable.

Thank you.

|||

I was wrong (partially) - the error I am referring to in the original post is being caused by my attempt to trap the error and write it to a log table in SQL Server. The error is actually as follows

The permissions granted to user 'mydomain\myuser' are insufficient for performing this operation

The fact that there are single quotes in the error is causing a syntax error in my SQL statement.

So - the actual user still does not have the permissions needed to issue UpdateSnapshot. I have confirmed with the Administrators that the user is in a role on the server that contains Generate Events and is also a Browser on all reports on the server.

I did this before in a previous environment and it worked perfectly. Can anyone definitively tell me what permissions are required in order to do things like UpdateSnapshot, FireEvent, CreateSubscription? I thought Generate Events was all that was needed.

During testing I was using my ID to do it and it worked. So I thought I could just create a dummy account and give it the permissions. I am stumped

|||

For update snapshot, you need Execute permission on the report you operate on. You can get it from Manage Report or Manager History task.

You are right for FireEvent you need Generate Event task (which contains generate event permission).

For CreateSubscription, you need either CreateSubscription or CreateAnySubscription permission. It is in "Manage Individual Subscriptions" or "Manage Any subscriptions" task.

|||

Thank you - I did discover that I was looking at the wrong permissions for Updating a Snapshot. The problem I originally had raises and interesting question. How do I handle the SOAP exception with the single quotes in it if I want to write that to a SQL Table? Seems odd that an error would contain single quotes!

|||This is the way we choose to mark the name (RS item name, username, etc.). I guess you can do a string replacing before you insert into your table.sql

No comments:

Post a Comment