Server API for authorization

Hello,
I'm looking for something similar to FOR LOGON trigger in SQL Server, but FOR/AFTER AUTHORIZATION. I prefer solution in T_SQL. If there is any SQL Server API, to hook on event like OnAuthorization it is also OK (C++, C#, etc).
Any idea?
Thanks in advance,
DG

I need to do some work just after authorization is finished - I guess SQL Server executes query in the following workflow:
Authorize --> If user not authorized than return Exception 
               --> Else Parse query --> execute query --> return result
Not really. Rather then interaction between client and server is:
Client (knocks on the door): May I come in?
Server: Show me you credentials.
Client: OK, here they are.
Server: (a) Ah welcome, please come in.
        (b) No, you don't belong here.
        (c) Your credentials were good, but the logon trigger threw you out.
Some time passes, could be microseconds, could be days.
Client: I have a query, please run it for me.
Server: (a) OK, here is the result.
        (b) Nice try, but you need to study the SQL syntax a little closer.
        (d) No, you are not permitted to perform that action or read           that data.
        (d) Oops, I ran into a serious problem, goodbye!
The above is repeated zero to N times and eventually:
Client: Oh, gotta rush! See you later!
Server: It was nice talking to you.
That is, once the user has logged in, no further authorisation takes place except for permission checks. But there are no hooks for permission checks. Furthermore, permission checks can be performed during execution. For instance if a stored procedure calls
a second procedure that has a different owner from the first procedure, the permission check does not occur until the EXEC statement is reached.
If you explain what your really want to achieve (rather the solution you think you have), maybe we can come up with something.
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • Server API for Looking up Web Applications

    Is there a public server API for obtaining a list of deployed web applications and configuration information for those deployed applications?
    Thanks.

    We strongly discourage to use the tomcat APIs. We may support those API's this version and may not support in next version. You can find the deployed app's from server.xml or admin interface. There is a work around to find the deployed applications programatically by using the command
    asadmin> ist-components --user admin_user [--password admin_password] [--host localhost] [--port 4848] [--secure | -s] [--passwordfile file_name] [--type application|ejb|web|connector] instancename

  • Error while accessing SharePoint 2013 news feed REST api - "The server encountered an error processing the request. See server logs for more details."

    Hi Experts,
    I am facing an issue while accessing SharePoint 2013 news feed REST api URL <SiteCollectionURL>/_api/social.feed/my/news from browser giving error "The server encountered an
    error processing the request. See server logs for more details."
    This is happening after posting the image to news feed without entering any text or description with that. If i post an image with some text or description, then i can able to get the feeds. Or else if i delete the image post then also i can able to get
    the feeds.
    I can able to see below logs in log files.
    Exception occured in scope Microsoft.Office.Server.Social.SPSocialRestFeed._SerializeToOData. Exception=System.MissingMethodException: No parameterless constructor defined for this object.     at System.RuntimeTypeHandle.CreateInstance(RuntimeType
    type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)     at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache,
    StackCrawlMark& stackMark)     at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)     at System.Activator.CreateInstance(Type type, Boolean nonPublic)
        at System.Activator.CreateInstance(Type type)     at Microsoft.SharePoint.C...
    ...lient.ValueTypeConverter.<GetODataProperties>d__2.MoveNext()     at Microsoft.Data.OData.Atom.ODataAtomPropertyAndValueSerializer.WriteProperties(IEdmStructuredType owningType, IEnumerable`1 cachedProperties, Boolean isWritingCollection,
    Action beforePropertiesAction, Action afterPropertiesAction, DuplicatePropertyNamesChecker duplicatePropertyNamesChecker, EpmValueCache epmValueCache, EpmSourcePathSegment epmSourcePathSegment, ProjectedPropertiesAnnotation projectedProperties)    
    at Microsoft.Data.OData.Atom.ODataAtomPropertyAndValueSerializer.WriteComplexValue(ODataComplexValue complexValue, IEdmTypeReference metadataTypeReference, Boolean isOpenPropertyType, Boolean isWritingCollection, Action beforeValueAction, Action afterValueAction,
    DuplicatePropertyNamesChecker duplicatePropertyNa...
    ...mesChecker, CollectionWithoutExpectedTypeValidator collectionValidator, EpmValueCache epmValueCache, EpmSourcePathSegment epmSourcePathSegment, ProjectedPropertiesAnnotation projectedProperties)     at Microsoft.Data.OData.Atom.ODataAtomPropertyAndValueSerializer.WriteProperty(ODataProperty
    property, IEdmStructuredType owningType, Boolean isTopLevel, Boolean isWritingCollection, Action beforePropertyAction, EpmValueCache epmValueCache, EpmSourcePathSegment epmParentSourcePathSegment, DuplicatePropertyNamesChecker duplicatePropertyNamesChecker,
    ProjectedPropertiesAnnotation projectedProperties)     at Microsoft.Data.OData.Atom.ODataAtomPropertyAndValueSerializer.WriteProperties(IEdmStructuredType owningType, IEnumerable`1 cachedProperties, Boolean isWritingCollection, Action beforePropertie...
    ...sAction, Action afterPropertiesAction, DuplicatePropertyNamesChecker duplicatePropertyNamesChecker, EpmValueCache epmValueCache, EpmSourcePathSegment epmSourcePathSegment, ProjectedPropertiesAnnotation projectedProperties)     at Microsoft.Data.OData.Atom.ODataAtomPropertyAndValueSerializer.WriteComplexValue(ODataComplexValue
    complexValue, IEdmTypeReference metadataTypeReference, Boolean isOpenPropertyType, Boolean isWritingCollection, Action beforeValueAction, Action afterValueAction, DuplicatePropertyNamesChecker duplicatePropertyNamesChecker, CollectionWithoutExpectedTypeValidator
    collectionValidator, EpmValueCache epmValueCache, EpmSourcePathSegment epmSourcePathSegment, ProjectedPropertiesAnnotation projectedProperties)     at Microsoft.Data.OData.Atom.ODataAtomPropertyAndValueSeriali...
    ...zer.WriteCollectionValue(ODataCollectionValue collectionValue, IEdmTypeReference propertyTypeReference, Boolean isOpenPropertyType, Boolean isWritingCollection)     at Microsoft.Data.OData.Atom.ODataAtomPropertyAndValueSerializer.WriteProperty(ODataProperty
    property, IEdmStructuredType owningType, Boolean isTopLevel, Boolean isWritingCollection, Action beforePropertyAction, EpmValueCache epmValueCache, EpmSourcePathSegment epmParentSourcePathSegment, DuplicatePropertyNamesChecker duplicatePropertyNamesChecker,
    ProjectedPropertiesAnnotation projectedProperties)     at Microsoft.Data.OData.Atom.ODataAtomPropertyAndValueSerializer.WriteProperties(IEdmStructuredType owningType, IEnumerable`1 cachedProperties, Boolean isWritingCollection, Action beforePropertiesAction,
    Action afterPropertiesAct...
    Can anyone please help me out.
    Thanks!
    dinesh

    O365,
    Is this still an issue?
    Thanks!
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • Development Environment for Server APIs in Webcenter Interaction 10.3

    Hi, I installed “Oracle Web Center Interaction 10.3" on standard environment mentioned by oracle (Window 2003 server, IIS6.0, SQL Server 2005). Everything works fine concerning the portal and services.
    I also have visual studio 2005 on the same machine and trying to setup a development environment where I can user server APIs (I start with creating IPTSession).
    I am using follwong code to start with:
    /String serverConfigDir = ConfigPathResolver.GetOpenConfigPath();
    IOKContext configContext = OKConfigFactory.createInstance(serverConfigDir, "portal");
    PortalObjectsFactory.Init(configContext);
    IPTSession ptSession = PortalObjectsFactory.CreateSession();
    Problem: code compiles if I add few dlls, but it do not run, it throws following error
    com.plumtree.openkernel.exceptions.OKFactoryException: Error in AOKFactory.createAndInitializeInstance, unable to create object with name 'com.plumtree.openkernel.impl.config.Config' in assembly or JAR file 'openconfig'.
    I think either server APIs are not more supported in 10.3 or I do not know how to setup the development environment for server APIs.
    Can anyone help??

    i have already tried putting hardcoded path but it didn't help, morover the previous line gives me correct path.
    I issue i mentioned seems to be related with some setting or missing native dlls
    com.plumtree.openkernel.exceptions.OKFactoryException: Error in AOKFactory.createAndInitializeInstance, unable to create object with name 'com.plumtree.openkernel.impl.config.Config' in assembly or JAR file 'openconfig'.
    i got follwing extract from the wsserver-wrapper.log file
    INFO | jvm 1 | 2009/02/20 12:26:17 | 2-20-2009     12:26:17.606     Info     OpenKernel.Config     Disabled-1235112977434     WrapperStartStopAppMain     com.plumtree.openkernel.impl.config.providers.ConfigXMLFileProvider     Loading config data from C:\bea\alui\ptws\10.3.0\bin\..\..\..\common/../settings
    INFO | jvm 1 | 2009/02/20 12:26:18 | 2-20-2009     12:26:18.325     Info     OpenKernel.Config     Disabled-1235112977434     WrapperStartStopAppMain     com.plumtree.openkernel.impl.config.providers.ConfigXMLFileProvider     Setting subscription data.
    INFO | jvm 1 | 2009/02/20 12:26:18 | container config context:EAS:wsserver
    i didn't modified anything in any config file, just configured everything on one machine with oracle configuration manager

  • Configuring Cisco ISE for Authorization with External Radius Server attribute

    Hi,
    I'm trying to integrate an external radius server with Cisco ISE.
    I created an External Identity Store>Radius Token Server.
    I created a Identity Store sequence with just one identity store just as creadted above.
    And I was able to authenticate successfully.
    But when it comes to authorization.
    I observed we just have one tab named Authorization while creating Radius Token server.
    And it always refers to ACS:attribute_name.
    If I want to define a IETF radius attribute, (lets say class with attribute id as 25), how could I do it.
    In Cisco ACS we have a direct entry option in authorization tab where we can define the radius (IETF) attribute within Radius token server creation (within radius token server>Directory attribute tab).
    How ever I try to define the IETF attribute here (class,IETF:Class) I am not able to authorize with this attribute value.
    I tried with just one single authorization rule where it could hit.But observed it to go the default(as none of the rules defined matches the condition).
    Can anyone guide me how can we define a IETF radius attribute for authorization within Cisco ISE and what policy could we set it to work as authorization.
    Thanks in advance
    Senthil K

    This is the step of Creating and Editing RADIUS Vendors
    To create and edit a RADIUS vendor, complete the following steps:
    Step 1 From the Administration mega menu, choose Resources > RADIUS  Vendors.
    The RADIUS Vendors page appears with a list of RADIUS vendors that ISE  supports.
    Step 2 Click Create to create a new RADIUS vendor or click the radio  button next to the RADIUS vendor that
    you want to edit and click Edit.
    Step 3 Enter the following information:
    • Name—(Required) Name of the RADIUS vendor.
    • Description—An optional description for the vendor.
    • Vendor ID—(Required) The Internet Assigned Numbers Authority  (IANA)-approved ID for the
    vendor.
    • Vendor Attribute Type Field Length—(Required) The number of bytes  taken from the attribute value
    to be used to specify the attribute type. Valid values are 1, 2, and 4.  The default value is 1.
    • Vendor Attribute Size Field Length—(Required) The number of bytes  taken from the attribute value
    to be used to specify the attribute length. Valid values are 0 and 1.  The default value is 1.
    Step 4 Click Submit to save the RADIUS vendor.

  • API for getting diagnotic server info

    Is there an API for getting diagnostic information about the server (memory usage, etc.). We'd like to write a program to monitor the server.

    I am trying to do something similar my call to Session.getSession generates
    the following exception:
    com.iplanet.portalserver.session.SessionException: Can't find resource for
    base name iwtNaming, locale en_US
    Can you help?
    Thanks?
    "Marshall Levin" <[email protected]> wrote in message
    news:9ljs3s$[email protected]..
    Hi,
    I have a JSP running on the same web server as the portal server but not
    running within the portal desktop (it is a stand-alone JSP).
    I have successfully gotten the user's Profile object via the Sessionobject
    and I can get the Hashmap of attributes.
    What I'm trying to get now is the user's domain and role -- is there anyway
    I can get this? I don't see these in the list of attributes. Is there an
    API to find this out? Any suggestions on how I can obtain this info
    programmatically?
    Thanks

  • API for Proxy Server Connection

    Hi,
    can anybody tell me any API for Proxy Server Connection in java EXCLUDING
    httpclient(apache) and setting system setting and making a urlconnection.

    hey thanx for replying
    Firstly i clear my requirement
    I want some other way of connecting to Proxy Server Irrespective of Httpclient and setting system properties and then making url Connection ,these ways are clear to me .
    I found one API HTTPClient (not belonging to apache Httpclient) its different
    u check this at
    http://www.innovation.ch/java/HTTPClient/api/index-all.html#_S_
    But the problem is this API Does't support NTLM
    i tried to found higher version of this API but i did't get .
    API should support :
    1. NTML
    2.JDK 1.4
    3.SOCKS (not necessary)
    4.HTTP protocol (other like FTP ... not necessary)

  • The DHCP service failed to see a directory server for authorization.

    We have two DHCP servers hosted on Hyper-V.
    But after shutdown activity at our DC, the servers gave an usual issue.
    "The DHCP service failed to see a directory server for authorization."
    We have rebooted number of time before getting this server into production but it never gave such kind of error.
    Also this time the local DC was shutdown.
    Please suggest the necessary steps to be taken.

    Hi,
    The authorized DHCP server contacts a domain controller every 60 min to detect/redetect his status. Maybe your DHCP has tried to reach the DC which was offline thus throwing that error. Are you still having issues with DHCP server servicing clients?
    Once the server talks to a DC and checks that his authorized the service will start leasing IPs to clients.
    http://technet.microsoft.com/en-us/library/cc754493.aspx
    http://technet.microsoft.com/en-us/library/cc781697(v=ws.10).aspx
    Regards,
    Calin

  • The DHCP Service failed to see a directory server for authorization error

    Hi Experts,
    "The DHCP Service failed to see a directory server for authorization error"
    I have DHCP Server installed on the same server where Active directory is installed its a domain controller, when I see the event logs I saw the above error. 
    This alert comes a number of times, just after the error
    "The DHCP/BINL service on the local machine, belonging to the Windows Administrative domain eg.com.pk, has determined that it is authorized to start. It is servicing clients now."
    Please somebody suggest some solution for this.
    TechSpec90

    Two questios:
    Is the server a domain controller?
    And, according to this, "The DHCP/BINL service on the local machine, belonging to the Windows Administrative domain eg.com.pk, has determined that it is authorized to start. It is servicing clients now", the service eventually do start, yes?
    Best Regards,
    Jesper Vindum, Denmark
    Systems Administrator
    Help the forum: Monitor(alert) your threads and vote helpful replies or mark them as answer, if it helps solving your problem.

  • Use LoginToken for Server API Session

    I get an Invalid pointererror when I try the code below. I'm trying to use the Login Token passed from the portlet as the token for the Server API Session I create.
    portletContext = PortletContextFactory.CreatePortletContext(Request, Response);
    //Get Remote Session
    IRemoteSession prcSession = portletContext.GetRemotePortalSession();
    //Get UserLogin token from Portlet
    stringsUserLoginToken = prcSession.GetLoginToken();
    //Reconnect to portal session with token
    IPTSession oPTSession = PortalObjectsFactory.CreateSession();
    oPTSession.Reconnect(sUserLoginToken);

    We are using 5.0.3. I found I could use the Login Token passed from the portlet in a Server API Session by doing the following:
    IPTSession pSession = PortalObjectsFactory.CreateSession();
    pSession.Reconnect(sLoginToken);

  • Public APIs for Adobe Central Pro Server

    Hi,
    Can anyone point me to the Public APIs that are available with the Adobe Central Pro Server e.g. I would want my application to dynamically add or remove steps in the job db, or change the target printer. Also, is it possible to invoke the preview functionality that comes with the Adobe Designer and integrate with an existing application
    Here what we are trying to do is add the printing (template merging) facility to an existing application and would want access to the public API for these products.
    Thanks in anticipation!
    Regards,

    I'm not sure you can do what you describe in the manner that you appear to be wanting to do it. I know of no APIs that are provided. There are ways to get the job done, though.<br /><br />The job management data base is an ascii text file that can easily be changed programatically. Parts of our application use it for building a drop-down list of printers for the user to select from. Changing it doesn't automatically cause Central to use the new file. Central must be told to reload it before it will be using the modified file. This can be done by placing a certain "command" file in Central's control folder, but it would not run until after the current job completes - if the current job is the one that just changed the file and further steps of the same job are for the processing of the data, then that would be too late. Once a job starts, all the parameters and tasks from the job management database and on the original ^job statement is what will be used. This goes for changing anything about the job, whether it be adding/deleting steps, changing the printer, or any other parameters.<br /><br />We accomplish pretty much what you want by doing several things. <br /><br />*First, we define all of the various configurations of jobs that we need. For example, our main printing job has four tasks; it is not uncommon to need to restart a job someplace besides the first task. Therefore, we have four different jobs defined, each one starting further down the list of tasks. We do the same thing when the processing of the data has to vary in some manner - we have jobs pre-defined for each specific set of tasks and the source of the data sets the ^job name as required for the specific tasks that have to be done.<br /><br />*For modifying the printer, we use the -z<printer> and -asp<driver> parameters on the ^job statement and the source of the file sets the values as necessary. The source of the file will also set the job name so that the desired job is ran. <br /><br />*We also have built into our custom agents the capability to recognize when a "soft" failure is occurring (such as can't reach our database) and it will put the job back in for processing after changing the job name to run the correct job for restarting at the proper step. <br /><br />*One of our steps is to check a control file to see if there is a redirection for the specified printer to a substitute printer (say, the original printer is down for maintenance). This agent will put the job back in for processing, changing not only the job name but the printer parameters. It has to be put back in, instead of just changing the parameters and passing the file on to JFMERGE, because Central uses the parameters on the original ^job line, it doesn't use the parameters that might be on the ^job line when JFMERGE starts.<br /><br />*We have also created our own agent for running as the JFERROR task. This task runs when one of the agents supplied with Central encounter a failure. Our agent analyzes the failure and determines if it was "hard" or "soft". If it was a "soft" failure, this agent requeues the job, changing the name and parameters as necessary.<br /><br />So far we have been unable to determine how to get our VB6 agents to set the ErrorLevel to notify Central that the agent failed (we came up with a workaround instead of spending a lot of time trying to get the ErrorLevel to work). This is necessary to prevent Central's agents from processing when a predicessor custom agent fails. Since we couldn't set the ErrorLevel, we just set up all of our agents to always create an output file for input to the next task. When one of our agents fail, it only outputs a modified ^job line with no following data. This modified ^job line is recognized by our custom agents as an indication that a failure is in process so it skips any processing except to pass the file to the next task. Since there is no data or form commands in the file, once it gets to JFMERGE, it just terminates without producing any output or error condition.<br /><br />Previewing is accomplished by running the JFPVMRG agent to create a PDF and then JFPVSEND to send it to the originating IP# for receipt by the View Manager which will then load it into Adobe Reader. At this point, the job running on Central will be finished - it could have produced hard-copy output or not depending on its design. Once the user receives the PDF, they can do whatever they want with it (save, print, etc).<br /><br />We use the above capability for our users to view an "archive" image of forms, after it has been processed normally. I know of others that use it to create the PDF as part of the normal processing, allowing the user to then print from Adobe Reader it if they wish.<br /><br />What we do is to drop a DAT file into Central's input folder that runs the above two agents. Our application that is running on the user's PC then watches for Adobe Reader to load and when it does it forces it to be the top-most task (we do this because we have a problem that it will often open behind other windows).

  • Visual Studio 2005 crashes when referencing ALI 6.5 portal server API

    Visual Studio 2005 crashes when referencing ALI 6.5 portal server API
    We are building new portlets in .NET 2.0 to that access the ALI 6.5 server API and are experienceing the folowing scenario:
    I create a brand new project in Visual Studio (2005 with SP1 on Win2k3 R2 SP2) using the ALI Portal Project template that is provided with the application accelerator 1.1. This portlet will need to perform portal server searches so I begin by adding references to the following assemblies from C:\bea\alui\ptportal\6.5\bin\assemblies:
    openconfig.dll
    opencounters.dll
    opencache.dll
    openhttp.dll
    openssl.dll
    opentempfile.dll
    plumtreeserver.dll
    ptportalobjects.dll
    I then type in something like below to start up the portal server objects.
    protected void Page_Load(object sender, EventArgs e)
    IOKContext context = OKConfigFactory.createInstance("C:\\bea\\alui\\settings\\", "portal");
    PortalObjectsFactory.Init(context);
    this.Response.Write("Portal Objects Initiallized");
    Some moments later Visual Studio will crash. It has happened before I have entered any code, after I have started typing code and on builds. It seems intermittent but usually occurs within a minute of interacting with this Visual Studio project. I actually managed to build once and have had success accessing this page in Explorer to validate the portal server objects are getting initialized and referenced correctly.
    I thought this was a problem with my personal development environment. So I tried this on other machines: another Win2k3 ALI 6.5 dev portal server and another server with Visual Studio 2005 that I installed the 6.5 portal on just for testing this. The exact behavior listed above is occurring on three development machines here (crashing devenv.exe when portal references are made or loading a project with portal references). Since this does not seem to be isolated to a single development machine, is there any course of action that anyone would suggest to help solve this?
    thanks,
    Troy Rackley

    It turns out that this is only a problem with Visual Studio using the ALI templates or creating any projects using the "New... Web site" functionality of 2005. I was a ble to create a C#... ASP.net Web Application project and add the references to the idk and the local portal server APIs manually without devenv.exe crashes.
    So, the work around I have found if your projects needs to access both the portal server API and the remote API is to create the project with:
    New... Project... Visual C#... ASP.NET Web Application
    and NOT
    New... Web Site... ASP.NET Web Site (or ALI Portlet Project)
    Anyone know why this is the case?
    Thanks.
    Troy

  • Java API for running entire ".sql" files on a remote DB ( mySQL or Oracle)?

    Hi,
    Would anyone happen to know if there's a java API for executing entire ".sql" files (containing several different SQL commands), on a remote database server ?
    It's enough if the API works with MySQL and/or Oracle.
    Just to demonstrate what i'm looking for:
    Suppose you've created sql file "c:/test.sql" with several script lines:
    -- test.sql:
    insert into TABLE1 values(3,3);
    insert into TABLE1 values(5,5);
    create table TABLE2 (name VARCHER) ENGINE innoDB; -- MYSQL specific
    Then the java API should look something like:
    // Dummy java code:
    String driver="com.mysql.jdbc.Driver";
    String url= "jdbc:mysql://localhost:3306/myDb";
    SomeAPI.executeScriptFile( "c:/test.sql", driver, url);
    Thanks.

    No such a API, but it's easy to parse all sqls in a file, then run those command:
    For instance:
    import java.sql.*;
    import java.util.Properties;
    /* A demo show how to load some sql statements. */
    public class testSQL {
    private final static Object[] getSQLStatements(java.util.Vector v) {
    Object[] statements = new Object[v.size()];
    Object temp;
    for (int i = 0; i < v.size(); i++) {
    temp = v.elementAt(i);
    if (temp instanceof java.util.Vector)
    statements[i] = getSQLStatements( (java.util.Vector) temp);
    else
    statements[i] = temp;
    return statements;
    public final static Object[] getSQLStatements(String sqlFile) throws java.
    io.IOException {
    java.util.Vector v = new java.util.Vector(1000);
    try {
    java.io.BufferedReader br = new java.io.BufferedReader(new java.io.
    FileReader(sqlFile));
    java.util.Vector batchs = new java.util.Vector(10);
    String temp;
    while ( (temp = br.readLine()) != null) {
    temp = temp.trim();
    if (temp.length() == 0)
    continue;
    switch (temp.charAt(0)) {
    case '*':
    case '"':
    case '\'':
    // System.out.println(temp);
    break; //Ignore any line which begin with the above character
    case '#': //Used to begin a new sql statement
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    break;
    case 'S':
    case 's':
    case '?':
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    v.addElement(temp);
    break;
    case '!': //Use it to get a large number of simple update statements
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    String part1 = temp.substring(1);
    String part2 = br.readLine();
    for (int i = -2890; i < 1388; i += 39)
    batchs.addElement(part1 + i + part2);
    for (int i = 1890; i < 2388; i += 53) {
    batchs.addElement(part1 + i + part2);
    batchs.addElement(part1 + i + part2);
    for (int i = 4320; i > 4268; i--) {
    batchs.addElement(part1 + i + part2);
    batchs.addElement(part1 + i + part2);
    for (int i = 9389; i > 7388; i -= 83)
    batchs.addElement(part1 + i + part2);
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    break;
    default:
    batchs.addElement(temp);
    break;
    if (batchs.size() > 0) {
    v.addElement(getSQLStatements(batchs));
    batchs.removeAllElements();
    br.close();
    br = null;
    catch (java.io.FileNotFoundException fnfe) {
    v.addElement(sqlFile); //sqlFile is a sql command, not a file Name
    Object[] statements = new Object[v.size()];
    for (int i = 0; i < v.size(); i++)
    statements[i] = v.elementAt(i);
    return statements;
    public static void main(String argv[]) {
    try {
    String url;
    Object[] statements;
    switch (argv.length) {
    case 0: //Use it for the simplest test
    case 1:
    url = "jdbc:dbf:/.";
    if (argv.length == 0) {
    statements = new String[1];
    statements[0] = "select * from test";
    else
    statements = argv;
    break;
    case 2:
    url = argv[0];
    statements = getSQLStatements(argv[1]);
    break;
    default:
    throw new Exception(
    "Syntax Error: java testSQL url sqlfile");
    Class.forName("com.hxtt.sql.dbf.DBFDriver").newInstance();
    //Please see Connecting to the Database section of Chapter 2. Installation in Development Document
    Properties properties = new Properties();
    Connection con = DriverManager.getConnection(url, properties);
    Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_READ_ONLY);
    //Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
    // stmt.setMaxRows(0);
    stmt.setFetchSize(10);
    final boolean serializeFlag = false;//A test switch to serialize/deserialize the resultSet
    ResultSet rs;
    for (int i = 0; i < statements.length; i++) {
    if (statements[i] instanceof java.lang.String) {
    String temp = (java.lang.String) statements;
    switch (temp.charAt(0)) {
    case 'S':
    case 's':
    case '?':
    System.out.println(temp);
    rs = stmt.executeQuery(temp);
    if (serializeFlag) {
    // serialize the resultSet
    try {
    java.io.FileOutputStream fileOutputStream = new
    java.io.FileOutputStream("testrs.tmp");
    java.io.ObjectOutputStream
    objectOutputStream = new java.io.
    ObjectOutputStream(fileOutputStream);
    objectOutputStream.writeObject(rs);
    objectOutputStream.flush();
    objectOutputStream.close();
    fileOutputStream.close();
    catch (Exception e) {
    System.out.println(e);
    e.printStackTrace();
    System.exit(1);
    rs.close(); //Let the CONCUR_UPDATABLE resultSet release its open files at once.
    rs = null;
    // deserialize the resultSet
    try {
    java.io.FileInputStream fileInputStream = new
    java.io.FileInputStream("testrs.tmp");
    java.io.ObjectInputStream objectInputStream = new
    java.io.ObjectInputStream(
    fileInputStream);
    rs = (ResultSet) objectInputStream.
    readObject();
    objectInputStream.close();
    fileInputStream.close();
    catch (Exception e) {
    System.out.println(e);
    e.printStackTrace();
    System.exit(1);
    ResultSetMetaData resultSetMetaData = rs.
    getMetaData();
    int iNumCols = resultSetMetaData.getColumnCount();
    for (int j = 1; j <= iNumCols; j++) {
    // System.out.println(resultSetMetaData.getColumnName(j));
    /* System.out.println(resultSetMetaData.getColumnType(j));
    System.out.println(resultSetMetaData.getColumnDisplaySize(j));
    System.out.println(resultSetMetaData.getPrecision(j));
    System.out.println(resultSetMetaData.getScale(j));
    System.out.println(resultSetMetaData.
    getColumnLabel(j)
    + " " +
    resultSetMetaData.getColumnTypeName(j));
    Object colval;
    rs.beforeFirst();
    long ncount = 0;
    while (rs.next()) {
    // System.out.print(rs.rowDeleted()+" ");
    ncount++;
    for (int j = 1; j <= iNumCols; j++) {
    colval = rs.getObject(j);
    System.out.print(colval + " ");
    System.out.println();
    rs.close(); //Let the resultSet release its open tables at once.
    rs = null;
    System.out.println(
    "The total row number of resultset: " + ncount);
    System.out.println();
    break;
    default:
    int updateCount = stmt.executeUpdate(temp);
    System.out.println(temp + " : " + updateCount);
    System.out.println();
    else if (statements[i] instanceof java.lang.Object[]) {
    int[] updateCounts;
    Object[] temp = (java.lang.Object[]) statements[i];
    try {
    for (int j = 0; j < temp.length; j++){
    System.out.println( temp[j]);
    stmt.addBatch( (java.lang.String) temp[j]);
    updateCounts = stmt.executeBatch();
    for (int j = 0; j < temp.length; j++)
    System.out.println((j+1)+":"+temp[j]);
    for (int j = 0; j < updateCounts.length; j++)
    System.out.println((j+1)+":" +updateCounts[j]);
    catch (java.sql.BatchUpdateException e) {
    updateCounts = e.getUpdateCounts();
    for (int j = 0; j < updateCounts.length; j++)
    System.out.println((j+1)+":"+updateCounts[j]);
    java.sql.SQLException sqle = e;
    do {
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:" +
    sqle.getErrorCode());
    System.out.println("SQL State:" + sqle.getSQLState());
    sqle.printStackTrace();
    while ( (sqle = sqle.getNextException()) != null);
    catch (java.sql.SQLException sqle) {
    do {
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:" +
    sqle.getErrorCode());
    System.out.println("SQL State:" + sqle.getSQLState());
    sqle.printStackTrace();
    while ( (sqle = sqle.getNextException()) != null);
    stmt.clearBatch();
    System.out.println();
    stmt.close();
    con.close();
    catch (SQLException sqle) {
    do {
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:" + sqle.getErrorCode());
    System.out.println("SQL State:" + sqle.getSQLState());
    sqle.printStackTrace();
    while ( (sqle = sqle.getNextException()) != null);
    catch (Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();

  • I need urgent help in business catalyst SOAP api for [Product_UpdateInsert] operation.

    Hi Everyone, I am new in Business Catalyst, but, my company is working with BC for a while. I have a task to import external data (such as catalogue, products, orders, shopping cart etc) to business catalyst native tables via SOAP api. I am able to use "Product_ListRetrieve" function that gave me products from BC. Now I want to insert and update product list, for which the api call is "Product_UpdateInsert". I am not being able to feed in even a single record. I need any code (jquery, php, javascript, java etc) as a sample, that works with SOAP api for this function. It is very urgent. Please help me. Thanks in advance. I have tried with the code below, but I am getting bugs (format not valid):
    try
         $soapfileurlUpdate="https://worldsecuresystems.com/catalystwebservice/catalystecommercewebservice.asmx?wsdl";
         $soap_clientUpdate = new SoapClient($soapfileurlUpdate);
         $array_of_products=array("Products",
      array("productId"=>"1128",
       "productCode"=>"1128",
               "productName"=>"Bostik 1128  Heat Transfer Sealer (thermo Putty) 460g Cartridge",
               "description"=>"Bostik 1128  Heat Transfer Sealer (thermo Putty) 460g Cartridge",
               "smallImage"=>"images/products/TEMUFF-7_New.jpg",
               "largeImage"=>"/images/products/TEMUFF-7.jpg",
               "cataloguesArray"=>array("DUCTS"), //array("string"=>"DUCTS"),
               "pricesSaleArray"=>array("US/9.95"),//array("string"=>"US/9.95"),
               "pricesRetailArray"=>array("US/9.95"),
               "pricesWholesaleArray"=>array("US/5.00"),
               "wholesaleTaxCodeArray"=>array("US/0.00"),
               "taxCodeArray"=>array("GB/VAT"),
               "groupProducts"=>array(""),
               "groupProductsDescriptions"=>array(""),
               "supplierEntityId"=>"1",
               "supplierCommission"=>"2",
               "weight"=>"20",
               "relatedProducts"=>array(""),
               "tags"=>"",
               "unitType"=>"",
               "minUnits"=>"1",
               "maxUnits"=>"2",
               "inStock"=>"10",
               "onOrder"=>"0",
               "reOrder"=>"0",
               "inventoryControl"=>"true",
               "canPreOrder"=>"0",
               "custom1"=>"",
               "custom2"=>"",
               "custom3"=>"",
               "custom4"=>"",
               "popletImages"=>"",
               "enabled"=>"true",
               "deleted"=>"false",
               "captureDetails"=>"true",
               "downloadLimitCount"=>"22",
               "limitDownloadsToIP"=>"0",
               "isOnSale"=>"true",
               "hideIfNoStock"=>"false",
               "productAttributes"=>"Size*|5|N:Small|,Medium|,Large|;Color*|5|N:Red|,Wh",
               "isGiftVoucher"=>"false",
               "enableDropShipping"=>"true",
               "productWeight"=>"20",
               "productWidth"=>"20",
               "productHeight"=>"29",
               "productDepth"=>"20",
               "excludeFromSearch"=>"0",
               "productTitle"=>"Bostik 1128  Heat Transfer Sealer (thermo Putty) 460g Cartridge",
               "cycletypeId"=>"1",
               "cycletypeCount"=>"1",
               "slug"=>"item-1",
               "hasVariations"=>"false",
               //"variations"=>array("ProductVariation"=>"true"),
               "roleResponsible"=>"",
               "metaDescription"=>""));
      echo "SOAP Data To Be Inserted:<br/>";
      var_dump($array_of_products);
      $vectUpdate = array("soap_version"   => SOAP_1_2,
                     "username"=>$soapusername,
                     "password" => $soappassword,
                     "siteId"=> $soapsiteid,
                     "productList"=>$array_of_products);
      $quoteUpdate = $soap_clientUpdate->Product_UpdateInsert($vectUpdate);
         $status = 1;
      echo "BC side is updated.";
      catch (SoapFault $sf)
         $errorlogText=date("Y-m-d h:i:s A"). "=> Error occurred while inserting data to business catalyst. \r\n";
      echo $errorlogText. " See log for errors.\r\n";
      echo $sf->getTrace();
      //fwrite($errorLogFile,$errorlogText. "Error Dump: ". $sf->getMessage());
      return;

    Hi BCMan, Thanks for replying. Yes, the error is from BC side. The format was invalid. I fixed the issue today. Actually, I was pushing data from my PHP server to BC host system using SOAP api. I am still getting format errors, but I am able to insert data into products table.
    One more question if you don't mind. Is it possible to use JQuery/Javascript to push data into BC tables in real time (while browsing products table) using customized pages? There are documents to solve this. However, I could not find examples of how I could fetch data from JSON file using JQuery and then populate products/catalog/order tables.
    I appreciate your help.
    Thank you.

  • API for Shared Review in Acrobat SDK

    Hi,
    I would like to implement the functionality for Shared Review programmatically.
    Right now we need to open each pdf file select Comments -> Send for Shared Review in Acrobat Professional and follow the steps in wizard.
    I am looking at achieving the above steps programmatically so that I need not open each pdf individually and run through the wizard. For this, is there any API available either in Acrobat 8.1 or 9.0 SDK which I can make use of and build an automatic service.
    A swift response is appreciated.
    Thanks & regards,
    Rajeev

    is there (today - 2011) really still no API for that?
    Also not in LiveCycle Server?
    Thanks,

Maybe you are looking for