开发者

How to expose desktop application as a Secure Web Service?

开发者 https://www.devze.com 2023-03-05 14:10 出处:网络
The Window desktop application provides C++ API that gives an array of customer information such as name and address. I want to expose this as SOAP Web Service with Security so that authorized clients

The Window desktop application provides C++ API that gives an array of customer information such as name and address. I want to expose this as SOAP Web Service with Security so that authorized clients (from remote servers Linux/Java based through ESB) of this web s开发者_StackOverflow中文版ervice can get this information at any time they want in SOA implementation (Java based). The desktop application does not have a standard database. It stores its data internally. Its basically old custom built CRM application that is installed on each agent's PC box. Each agent has its own list of customers.

What are the steps to achieve this task?

Do I need to run this as Windows service?


The short answer is, yes, you can expose data from a desktop application through a SOAP web service. It is easier to do with C# and .NET, but not impossible to do from C++. What steps you need to take will depend on which platform you are developing for.

Roughly -

Implement an endpoint that supports SSL where clients can connect to your desktop application (using sockets in C++ or HTTPListener using .NET).

Write code that can receive and dispatch SOAP requests.

Handle SOAP requests and return properly formatted SOAP responses.

Handle WSDL requests.

Implement a security mechanism (cookie based or otherwise).

Using .NET, most of this is in the platform code already, you just have to put the pieces together. With C++, you may find some third party libraries but essentially you'll be writing your own.

You only need to implement a windows service if you want the data to be available while a desktop user is not logged in and running your desktop application. The challenge here is that you'll have to make sure the windows service can access the same data the desktop application is using.

Another strategy would be to access the data from your desktop application using the C++ API and Interop and implement the web service as a standard out of the box asmx hosted on IIS.

0

精彩评论

暂无评论...
验证码 换一张
取 消