vamyip
vamyip

Reputation: 1171

WCF on Excel Addin

I've got a somewhat weird requirement and need to explore possibilities. Here's the requirement:

Server side(out of our control and scope to make any changes)
      - We have an Application server running on one machine.
      - The application server is supposed to read data from Web Services at regular intervals( to store          into database for further processing).

Client side:
     - The users work on an Excel Work book. To synchronize their data to Application Server, the Excel Addin should be able to provide a web service interface. The Application Server will periodically poll this client side web service to obtain Updated data.

I am completely aware that it seems to be a wrong design and that the Application server should host a web service for reading data. But, this is what the situation demands.

My question:
1) Is there any remotest possibility that Excel Addin can host a web service?
2) Can a .Net based Addin host the web service using WCF?
3) If yes, can WCF provide exactly same web service interface as ASP.Net Web services? ( I read about BasicHTTPBinding, WSHTTPBinding, etc but could not find enough information to make a decision).

4) Any other alternatives that you can think of??

Thanks,
Vamyip

Upvotes: 1

Views: 1037

Answers (1)

Ladislav Mrnka
Ladislav Mrnka

Reputation: 364279

What an architecture ...

This is not a full answer to your question because I know almost nothing about Excel programming and possible issues with implementing this but it should be theoretically possible to host service in .NET plugin for Excel. I will just point what is needed for WCF:

  • Yes you need service with BasicHttpBinding but if you don't have WSDL + XSDs of expected interface it will be complex task to create compatible service for existing client.
  • You must self-host the service in the plugin (the question is if this requires some special permission in Excel)
  • To self-host HTTP based endpoint the client machine (vista, windows 7) must have http.sys installed (it needs IIS core which is available only in business / enterprise / ultimate version). I'm not sure what is needed on Windows XP.
  • To self-host service you need to configure the system to allow listening on the port (netsh - vista, windows 7 / httpcfg - xp and firewall)
  • Your server application needs to know all client machines where your application will run
  • Your server must "see" client machines (for example if your clients are laptops and they can connect outside of your network it will never work)

Why the hell is not the architecture done correctly by exposing single service on the application server and pushing data from clients to these service? An architect of this application should be fired immediately for total incompetence.

Upvotes: 1

Related Questions