C# system integration with two web services

Asked

Viewed 468 times

2

I have to create an application that plays the role of a "bridge" between two web service that store information. I have to take information from one and send it to the other the way this "other" wants. These requests and responses will be on the basis of SOAP. I’ve never done anything like, I’ve seen some code subjects and examples SOAP but, I still carry many doubts. For now, my doubt is what kind of project I create in the Visual Studio C# to support this type of creation? What I aim to achieve (given by the boss) is that this application will run as a service and will be installed by prompt de comando. I saw something about WCF but it doesn’t match what I want either.

If help has this image of the project files:

inserir a descrição da imagem aqui

Thanks in advance!

2 answers

1

From what I understand you need to manipulate the information that comes from a Ws before handing it over to a second Ws. What you can do is a common windows service that receives the XML from the 1º Ws and delivers the transformed xml to the second.

To create windows service in VS2010 - new project > windows > windows service.

To manipulate XML search for xsltransform.

But... If you have access to the source code of one of these Ws (or both of which would be better yet) there is no need to create the service. You could build only a transformation layer and include in one of the two, preferably in the 2nd that would receive the xml as it is today and it would translate the information itself.

0

I am taking into account the following premise:

Since a service by definition is passive, then your application should consult the first service, the answer of this request should serve as the basis to mount a request for the second Webservice.

This type of application usually involves performing some operation at regular intervals, in your case you could be consulting the first webservice every 90 minutes.

For this type of situation, you have two options, create a project of type 'Windows Service' and internally have a Timer, or make a Console Application and schedule its execution by Windows Task Scheduler.

I personally prefer the simplest option, which is to make a Console Application and entrust the Windows Task Scheduler, in any case I advise you to read this article:

As for Web Services, check if it exposes your schema through MEX or WSDL, if you do, then all you need to do is add a Service Reference for each service:

Visual Studio > Project > Add Service Reference ...

Then enter the address (URL) with the schema (MEX ou WSDL) of the service, choose a Namespace of your preference, then the Wizard will assemble a Proxy to the Web Service.

  • I think it would be nice for you to also explain the part of Webservice itself, which, in my view, is at the heart of her doubt.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.