Help understanding how to build a web service - asp.net

I have a client who has an ASP shopping cart (classic asp) and a Windows based point of sale system both using their own SQL Server databases.
The maker of the Windows point of sale system has a utility that will export the inventory as an XML file and will also retrieve any sales from the shopping cart if it is in their special XML format.
I asked them "where do I make the XML request for the inventory" and they told me it had to be done as a web service. I assumed that their software would either have a place for me to do a POST or GET request for the XML via HTTP or that it would generate it as a file on the hard drive. I have never built a web service, although I have been a developer for more than 15 years, so forgive me for my newbie-ness to this :)
Can anyone get me started with some links or any suggestions on how I can understand this better?
If I understood how I would make a request and allow requests for XML files with a web service, I'm sure I could build it.

This site seems to have a decent example.

Related

lan http chat and file shareing

I want to share files and chat over LAN using the protocol HTTP, the aim is that clients don't have to install anything except of having a browser.
I have tried HFS and edited it to make a very basic chat, the file shareing was fine, but the chat wasn't realtime.
my knowledge doesn't get over HTML , CSS ,and the very basics of JS
Creating such a software needs having knowledge in these languages and tools as it is web based application (HTML, PHP or JSP or .Net, sql server or my sql, Ajax).
*HTML: to create the GUI (pages, forms, colors).
*Programming languages like PHP or JSP or .Net: to handel the data transferring (texts and files) and database connection and session creation.
*sql server or mysqlUsed to store the data, even if its a real time, you need a database for temporary storing the data.
*Ajax: its the combination of javascript and css,, it is used to check frequently for new comming messages, for example every 3 seconds..
This may help..
It is a simple web base live text chat code, that uses php, html, mysql, and ajax
http://code.tutsplus.com/tutorials/how-to-create-a-simple-web-based-chat-application--net-5931

.NET WebAPI - automatic pdf generation

I have developed an ExtJS 5 + .NET MVC WebAPI RIA for reporting purposes.
Now the client is requesting a feature to subscribe to some reports. The reports (pdf) should be generated automatically and then the server should send them per mail to the user who subscribed a report. It would also be a nice to have that the user can specify the date and time when he will receive the report.
Currently the application has already a PDF export where the user can save these reports. In this case the applications sends the html of the report section to the server and the server is working with wkhtmltopdf to generate the pdf.
For my new feature i have the following questions:
Can i implement this new feature service in my WebAPI (e.g. as a thread which ill start on startup) or should i write an independet service for it.
Would it be appropriate to just load the site on the server with the reports and execute the process which i am already running for my PDF export to get the pdf out of it?
I am thankful for every advice.
A separate process that calls the WebApi makes a lot of sense. Separation of concerns and all that. But whether you include it in the API itself or in a separate mailer portal, I suggest you don't try to write any scheduling yourself. Scott Hanselman has a great post on why you shouldn't and suggests several alternatives. Of those, my favorite solution is Hangfire. I use it in production, and it's pretty easy to set up and use.
And if you need nicely formatted emails, I suggest checking out Postal for their composition.

JSP, Tomcat & MySQL replacement?

I had little experience writing a web based inventory management system using jsp, tomcat, and db in mysql.
Ever since then, I changed my career as an embedded software engineer(so my knowledge about this topic is rather outdated), and I need to write a web format based code tracking tool with localized database and no server running like a tomcat.
So I decided to give sqllite a try since it does not require a sever running. But I am not sure what to replace a web container with. (I might be little confused here)
basically I need something like below:
1. user accesses web based interface
2. user requests code tracking or source browsing
3. something(that does not require a server running) handles request and extracts information and displays possible matching links
db will be replaced with sqlite, and no tomcat will run. But then I am not sure how I can make "something" in 3) work :(
I'd really appreciate any suggestion.

How to access client's outlook in ASP.net?

What I want to do with my app is accessing client's outlook, getting some data, using them to get more data from the database, and then make a file ready for blackberry to sync. All of these are better done on the server, so at the clients' end, there is only one file with everything ready, so they can easily sync it. I have searched a little, and found it is possible if I access exchange server. Could any one explain in details? I know nothing about exchange servers. Also, is there any other possible solutions?
Thank you.
Ok,
As i said you have a number of options.
I assume that you want to run this from a IIS server as you title says "Asp.Net"
Also I will assume that you want to do this in managed code. i.e not write a com object or native code.
Your options then, are to speak to exchange via web DAV , Exchange Web Services (EWS) or use a great 3rd party tool called Redemption which has RDO objects.
If you are running exchange 2007 EWS is the way to go. if you running earlier versions Web Dav is the way to go both these ways are supported by MS. RDO can be used with both versions but is supported by Dmitry Streblechenko
As far as EWS and DAV there are quite allot of resources out on the net and information on stackoverflow.
Also there are a few libraries that wrap EWS and web Dav calls up which may get you up and productive quicker.
http://www.independentsoft.com/webdavex/index.html is a good example.
EWS Resources
http://msdn.microsoft.com/en-us/library/bb204119.aspx
http://msdn.microsoft.com/en-us/library/cc540447.aspx
http://blogs.visoftinc.com/archive/2008/03/20/Using-Exchange-Web-Services-2007-The-Basics.aspx
http://www.webreference.com/programming/asp/Ajax_WebService/
WebDav
http://msdn.microsoft.com/en-us/library/aa486282(EXCHG.65).aspx
http://www.msexchange.org/articles/Access-Exchange-2000-2003-Mailbox-WebDAV.html
http://blogs.technet.com/kclemson/archive/2004/01/23/62247.aspx
http://gsexdev.blogspot.com/2005/04/aspnet-and-exchange-tips-and-samples.html
For Redemeption go to the Redemption site http://www.dimastr.com/redemption/ there are loads of examples most of them in VBA/VB but you can easliy transpose then into C#
Personaly I think that you should go down the MS supported routes first.
Marcus

How to write an offline version of an AJAX/ASP.NET web application

We have a web application that uses AJAX to talk to an ASP.NET web service. We would like to write another version that can be used offline. We need to be able to re-use our existing code as much as possible. What approaches should we consider?
The app is currently using XmlHttpRequest to get dynamic data from the server. Obviously the offline version will not be able to talk to the server, but it does need to talk to something! I'm sure installing IIS or Cassini on the client would work, but I was hoping for a simpler solution. Is there no other way for JavaScript to talk to some external code?
There are plenty offline web apps nowaday. It simply evolve from AJAX.
For example:
WoaS (wiki on a stick / stickwiki), Tiddly Wiki,
Google doc and Gmail is going to be offline.
You don't need a webserver to run these webapps in offline mode. Just store the required data, scripts on the client side (usually as XML).
One of the possibilities would be to use Cassini. This is a web server that acts as a host for the ASP.Net runtime. You can host Cassini in a Windows application or a Windows Service. In this scenario you do not have to rewrite the web app and the web service.
Most other solutions do require a rewrite of both your web app and your web service. Depending on the way you have written the existing app you can reuse more or less code.
Have you considered HTML5 with application cache and offline storage?
If you hope to create an "offline" version of your package your biggest issue by far will be the need to install your site into a local copy of IIS (registering a virtual directory, etc.). I pursued this briefly a few years ago and gave up in frustration. It can be done: a number of software vendors such as DevExpress do this so you have local copies of their demonstration projects. Indeed, I was able to do this. The problem was the classic "it works on my computer" syndrome. There was simply no way to guarantee that most of my end-users had anywhere near the technical proficiency to make this work.
Thus, I would strongly recommend that you not pursue this path unless you have very technically proficient users and a huge support staff.
But there is one more very important question: did you abstract all data access code to a DAL? If not, then you have a lot of work to do in managing data access as well.
Update: user "Rine" has recommended Cassini. I just wanted to let you know that I pursued Cassini and another 3rd-party web server as well. I think that there are licensing issues with Cassini but may be wrong - it has been awhile. However, I do distinctly remember running into barrier after barrier with this approach and very little documentation to help me out.
if you want a web application run offline, you need a webserver (IIS for ASP) bound to the localhost (127.0.0.1) address. After this so can access your web application by typing http://127.0.0.1/ in your web browser the same way as you do online.
If your AJAX relies on XMLHttpRequest's, you can:
Make the static versions of XML's you get over XMLHttpRequest and put then into a folder on disk.
Rewrite your XMLHttpRequest URL's so that they point to files on disk.
Rewrite your XMLHttpRequest's so that they don't check status (it's always 0 for the file:// protocol.
All JScript works on file:// pages as well as on http:// ones.
Of course it's not the best way to develop static pages, but it may save you some time on rewriting.
I havent come across any framework specifically built for asp.net like the ones available for PHP or RoR.
Here is a good article by Steven to get you started with HTML 5 and ASP.Net Creating HTML 5 Offline application
Obviously the offline version will not be able to talk to the server, but it does need to talk to something!
Enter HTML5 LocalStorage. It works like a database and enables you to put data on your client. Indeed you have to rework parts of your code in javascript and transmit it to the client, but then it would work offline.
Local Storage works like this:
- Setter: window.localStorage.setItem(KEY, VALUE)
- Getter: window.localStorage.getItem(KEY)
- Remove: window.localStorage.removeItem(KEY)
To get the main page working offline you need to create a manifest. This is used to store complete sites on the client. Please refer to this for more information about manifests:
http://diveintohtml5.info/offline.html
You want to build a web application to work offline?? It can't be done.
You could split the interface code from the rest (in diferent dlls) and create a windows application to mimic the behaviour of your web application. This way you have 2 distinct user interfaces but the same code for business rules and data access.
I don't really see any other way...

Resources