7

My website currently working in ASP.NET 1.1

Old Process

In our database we have huge amount of data stored for a decoding purpose. We have to update this huge set of data table each week(Data is supplied from a vendor).

In our website (in asp.net 1.1) we query our database to decode information.

New process

Now instead of storing data in our database and query them, we want to replace this through the web service, AS now the vendor is supplying us a DLL, which will give us the decoded information.

Information on the DLL provided by the vendor

The DLL provided, can only be added in 4.0 sites. SO that also impleies that i can not directly add the dll to my 1.1 site. This DLL is exposing certain methods, we simply have to add the DLL refernce in our web service and call the method and fetch the needed information.

Thus we will not have to store those information in our database.

So which type of web service I should go for (asmx OR WCF) that will use the DLLs provided by vendor to fetch the decoded information ??

Flexibility i am looking for in the web service are:

  • It can be consumed from asp.net 1.1 site directly and also using jQuery ajax.
  • It can be consumed from other web services running on the server.
  • It can be consumed from some windows services running from the server.

NOTE : Moreover we have a plan to migrate our website from asp.net 1.1 to 4.0 version in future.So it should be that much supportive for future upgrade.

Jude Fisher
  • 11,138
  • 7
  • 48
  • 91
James
  • 2,136
  • 3
  • 23
  • 42

4 Answers4

4

If I understand you correctly, you intend to create a Web Service that is going to reference the DLL provided by the vendor and return the decoded data to your ASP.NET 1.1 website.

I would seriously suggest you to go for a WCF web service as it targets the .NET 4.0 Framework. Believe me it is going to payoff in the long run. Moreover, .asmx web services are considered a legacy technology according to the MSDN (feel free to consult the MSDN). Go ahead with WCF, do not start with a disadvantage!

Sayan
  • 2,053
  • 3
  • 25
  • 36
  • Yes..That is one of the requirement..And i have started learning WCF too..Can you shed some light on the other 2 areas of consumption of this web service.. – James Oct 09 '12 at 07:10
  • Other 2 areas? I am sorry but I didn't get what you mean to say. Are you talking bout Address, Binding and Contract in a WCF..... – Sayan Oct 09 '12 at 08:33
  • I meant..It can be consumed from other web services running on the server. It can be consumed from some windows services running from the server. – James Oct 09 '12 at 09:13
  • _Ofcourse_ WCF services can be consumed from a server side application as well. Heres a very good link that'll help you get on with your first WCF service – Sayan Oct 10 '12 at 05:22
0

If you want to stay with asp.net 1.1 for now, an asmx service is the only choice with you. It is further advisable to use the asmx service - which in turn uses ajax and compliant with different platforms (in fact, it is a soap service) and you get an excellent interoperability with it.

Further, I am a bit confused here. If you are having a dll provided by the service provider, you might not have a choice at all. It would be the dll which will decide which service to use to communicate with providers data source. Is your provider giving you a choice ?

Murtuza Kabul
  • 6,438
  • 6
  • 27
  • 34
  • No such choice is given from the vendor...And please see the edit..i have added a few info on the DLL. – James Oct 06 '12 at 07:28
  • You are consuming service and not exposing from your website. May be, you don't have to think at all, just add reference of dll to your project and call the methods. The dll will take care of the rest - I think so. – Murtuza Kabul Oct 06 '12 at 07:31
  • Exactly..we can do that..But i have to consume it from several places(site, tools, other service) and it is not wise to add the reference in each place..SO my plan is to create a webservice for this purpose – James Oct 06 '12 at 07:33
  • Your data provider is providing you the data using web services and it is up to him to decide what kind of service to expose. The service exposed by the provider will be consumed by the dll. All you need to do is to invoke the dll method and it will in turn call the service and fetch appropriate data. – Murtuza Kabul Oct 06 '12 at 07:34
  • Even if you want to do that, you are consuming the service at all the places. The question comes to you only when you want to expose the service from your website. Suppose, you want to develop an android application, you might need to expose the web service. In that case, I would recommend you to expose Json REST services. They are far more efficient and almost all the platforms supports it. – Murtuza Kabul Oct 06 '12 at 07:36
  • Yes..but i dont want the data in exact format how the provider is giving..I want to setup a few web methods in my service to fetch and query those data..and supply my desired format data..and that will be in centralized place and hence i can use it from everywhere.. – James Oct 06 '12 at 07:37
  • You can do so, but it is not an efficient way. What is happening here is, you are creating a web service which is in turn calling another web service. Instead, you can create a wrapper dll that will wrap the methods of provider's dll. You can build this wrapper dll to be compatible with framework 1.1 and add reference to that dll in your project. This is my suggestion. However, if you want to build a service, JSON REST service is of my choice. – Murtuza Kabul Oct 06 '12 at 07:44
  • Moreover..the day vendor is changed..What i will do..Then i have to change everything..So if now i create one webservice and have all sort of webmethods for my need..i will only have to change tht one service only as per the new provider... – James Oct 06 '12 at 07:45
  • That is a good point. I have no idea of what kind of service you are consuming but if it is possible that you can change the provider, you should surely consider deploying your own service. – Murtuza Kabul Oct 06 '12 at 07:48
  • I have previously gone through such situations and in my experience, using Push notification for product update is also a good idea if it is feasible solution for your provider. – Murtuza Kabul Oct 06 '12 at 07:51
0

WCf is more flexible than web service old fashioned used soap it is previously ajax, now wcf is more service oriented architecture.so donto use webservice any more

Reddy
  • 66
  • 8
0

Since WCF communicates over the SOAP protocol, I would suggest your best option is to create a separate .Net 4.0 Web Service project (in the same solution if you wish) which can then be referenced by your .Net 1.1 web site.

You may also "double decorate" your new WCF methods to expose them as an ASMX web service for backwards compatability with the website and to reduce down-time with phased migration, see this post. Or, with a little more work and if you prefer to switch the service calls in the client straight away, Microsoft have a guide for exposing WCF to an ASMX client. The easiest method I can see is to simply copy-paste your existing asmx service code into a .Net4 project and replace the methods to utilise your new dll where appropriate, see this post.

When migration is finished and the .Net 1.1 site is refactored to compile and utilise .Net 4's new features, the service could be moved into the main website project again (if you wish) though personally I'd prefer to keep them separate.

Migrating to WCF and .Net 4 should come with a host of benefits, Microsoft has added allot of simple ways to improve your program, WCF is allot more flexible and may be consumed by a much wider set of clients (see here) and I find it's becomming increasingly difficult to find support on the legacy technologies.

HTH

Community
  • 1
  • 1
Dead.Rabit
  • 1,965
  • 1
  • 28
  • 46