Showing posts with label snapshot. Show all posts
Showing posts with label snapshot. Show all posts

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

Friday, March 23, 2012

Please check this replication error..

I tried to replicate between SVRPOS01 and SVRPOS02.
SVRPOS01 is publisher and distributor.
Replication is Merge replication.
But, after snapshot agent ran, the following error comes out and merge agent doesn't do merge replication.
When configure replication I choose option initialize schema.., and in SVRPOS02 I just create empty DB.
Most of time this works... but not in this time..
SVRPOS02 doesn't have data replicated...
Please reply any idea of following error, and solution if you have any..
Thank you.

<Error message>
The schema script '\\SVRPOS01\C$\Program Files\Microsoft SQL Server\MSSQL\ReplData\unc\SVRPOS01_POS_POSPublicat ion\20040706003309\v_Item_Old_232.sch' could not be propagated to the subscriber.

<Error Detail>
The schema script '\\SVRPOS01\C$\Program Files\Microsoft SQL Server\MSSQL\ReplData\unc\SVRPOS01_POS_POSPublicat ion\20040706003309\v_Item_Old_232.sch' could not be propagated to the subscriber.
(Source: Merge Replication Provider (Agent); Error number: -2147201001)
----------------------------------
Unable to replicate a view or function because the referenced objects or columns are not present on the Subscriber.
(Source: SVRPOS02 (Agent); Error number: 0)
----------------------------------
Invalid object name 'POSLOC.dbo.BARCODE_MATCH'.
(Source: SVRPOS02 (Data source); Error number: 208)
----------------------------------You have to script the structure of the publishing database and apply to the subscriber before the snapshot agent runs for the first time.|||By any chance, does that view contain some sort of cross-database query? Then you need to make sure that database is also present on the subscriber.