Red Gate forums :: View topic - Setting up custom webserver to use database
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 5
SmartAssembly 5 forum

Setting up custom webserver to use database

Search in SmartAssembly 5 forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
kimpenhaus



Joined: 13 Feb 2011
Posts: 11
Location: Germany

PostPosted: Wed Feb 16, 2011 9:57 pm    Post subject: Setting up custom webserver to use database Reply with quote

Me again Wink

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 Smile
Best regards,
Marcus
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6577

PostPosted: Thu Feb 17, 2011 10:48 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
kimpenhaus



Joined: 13 Feb 2011
Posts: 11
Location: Germany

PostPosted: Thu Feb 17, 2011 12:00 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6577

PostPosted: Thu Feb 17, 2011 2:43 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
kimpenhaus



Joined: 13 Feb 2011
Posts: 11
Location: Germany

PostPosted: Thu Feb 17, 2011 2:55 pm    Post subject: Reply with quote

Hey Brian,

thanks - but I knew that already Wink 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?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6577

PostPosted: Thu Feb 17, 2011 7:20 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
kimpenhaus



Joined: 13 Feb 2011
Posts: 11
Location: Germany

PostPosted: Fri Feb 18, 2011 10:24 am    Post subject: Reply with quote

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:
Quote:
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 Wink

In the document it says:
Quote:
Edit the {smartassembly}.WebServer.Settings.xml file to configure your Custom Web Server:
<SmartAssembly.WebServer.Settings>
<ServerURL>http://www.myWebServer.com/{sa}WebServices/</ServerURL>
<SecuredURL>https://www.myWebServer.com/{sa}WebServices/</SecuredURL>
<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.
Back to top
View user's profile Send private message
Alex.Davies



Joined: 02 Dec 2008
Posts: 335
Location: Cambridge, uk

PostPosted: Fri Feb 18, 2011 2:40 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
kimpenhaus



Joined: 13 Feb 2011
Posts: 11
Location: Germany

PostPosted: Fri Feb 18, 2011 7:15 pm    Post subject: Reply with quote

uhh - this feels like a slap in the face Wink

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.
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. All times are GMT + 1 Hour
Page 1 of 1

 
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group