Setting up custom webserver to use database

kimpenhauskimpenhaus Posts: 14 Bronze 1
edited February 18, 2011 1:15PM in SmartAssembly 5
Me again ;)

As I found already in the code you (Alex) sent me (see: http://www.red-gate.com/messageboard/viewtopic.php?t=12825) and as mentioned in the post about team-package (http://www.red-gate.com/products/dotnet-development/smartassembly/team-package) there must be a possibility to configure the custom webserver to write into the database by default - right?

But on your guid to setup a custom webserver (http://www.red-gate.com/supportcenter/Content?p=SmartAssembly&c=SmartAssembly/help/5.5/SA_CustomWebServer.htm&toc=SmartAssembly/help/5.5/toc1210448.htm) there is nothing shown how to set it up correctly...

I am really sorry to need your help again, but where can I read about how to do it?

Thank you very much :)
Best regards,
Marcus

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    That's a good question! As far as I can tell, the first time a SmartAssembly application connects to the database, it will look at the server settings and create the SmartAssembly database automatically. I don't think you need to do anything except configure a database server in SmartAssembly.
  • Hey Brian,

    yeah - I've done that and in deed SmartAssembly created the database - but I assume that I have to tell the custom webservice at least the connection string to the database... as I am not using standard instance name.

    Thx,
    Marcus.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    If you need to specify a named instance of SQL, you can specify SERVER <backslash> INSTANCE, for instance MYSERVER\SQL2008R2. If you have an older version of SmartAssembly, you may have to hack this yourself into C:\ProgramData\Red Gate\SmartAssembly\SmartAssembly.Settings.
  • Hey Brian,

    thanks - but I knew that already ;) and as I said the database is already up, running and filled with a catalog named SmartAssembly.

    The problem I am facing is - how will the web service know which database to use, what are the credentials etc. I can't believe that this is told by smartassembly application. I guess it has to be somewhere in the web.config maybe as subnode of the connectionstrings?
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    This is interesting -- I can't find any reference to a "database" in the webservice code. It looks like it simply dumps all of the exception reports to a folder on the hard disk specified in the ReportsFolder node of the web.config.

    I suppose sawebservice just stores the report files until they are requested by a SmartAssembly client, which then puts the information in the Smartassembly database.
  • Hi Brian,

    not sure but I think you are absolutly right - there is not direct access to the database. I searched a little while yesterday in the evening and on the SDK wiki-link (http://sdk.red-gate.com/index.php/SmartAssembly_SDK) you posted on the other thread (http://www.red-gate.com/MessageBoard/viewtopic.php?t=12825) there is the downloadable pdf document: http://sdk.red-gate.com/uploads/7/7c/HowToSetupCustomWebServer.zip. As I read it again I stumbled upon following:
    RunOnException: (Optional). An application file name. This application will be launched each time the server receives an exception report. It can be used to send an email, update a database, etc…

    I think this is the clue to get it working - it's a standalone process which will be triggered after the receiving of a report which has to put it into database. Right?

    This leads me to my next question ;-)

    In the document it says:
    Edit the “{smartassembly}.WebServer.Settings.xml” file to configure your Custom Web Server:
    <SmartAssembly.WebServer.Settings>
    <ServerURL>http://www.myWebServer.com/{sa}WebServices/</ServerURL&gt;
    <SecuredURL>https://www.myWebServer.com/{sa}WebServices/</SecuredURL&gt;
    <RunOnException>c:\MyCustomWebServer\SendEmail.exe</RunOnException>
    <Debug>0</Debug>
    </SmartAssembly.WebServer.Settings>

    Where do I find this file? And does the decoupled process gets any start-parameter?

    Kind regards,
    Marcus.
  • Sorry, that document is about an old version of the webservice.

    The custom web service is not intended to connect to the database. I would just stick to using the redgate web service to save yourself the cost of a custom web service.

    The recommended way to do things automatically when new error reports come in is to poll the web service, say every 5 or 10 minutes. That's how the example code I sent you in intended to be run.
    Alex
    Developer,
    Red Gate .NET Tools
  • uhh - this feels like a slap in the face ;-)

    In my humble opinion you loose a lot of functionality while decoupling the webservice from it's "backoffice" processes. If you guys really intend to make the sync tool public I bet it would be better to give more possibilities on the web-service side because you have a bidirectional communication port opened to the customers in that case. I think I can construct a dozen use-cases where instant feedback can be useful. You a simple scenario: The customer ran into an exception caused by bug which is already fixed and ready to ship. While giving him the ticket id from the bugtracker it's an absolute transparent process for him and he can see when the milestone containing the fix is being shipped.

    Is there some point where I can vote for such a functionality (or isn't this out of scope for what is meant to be done by SmartAssembly)? I know it's not just Automated Error Reporting but goes a bit far more in starting an Error Processing Workflow from within a client.

    Anyway thank's for your help - I appreciate much!! I need to think a little while about what my use-case is and if it is even implementable with the SDK.

    Kind regards,
    Marcus.
Sign In or Register to comment.