C # system integration with two web services

2

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

If you help, you have this image of the project files:

Thank you in advance!

    
asked by anonymous 24.08.2015 / 21:40

2 answers

1

From what I've come to 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 an ordinary windows service that receives the XML from the 1st ws and delivers the transformed xml to the second.

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

To manipulate XML look for xsltransform.

But ... If you have access to the source code of one of these ws (or both of which would be even better) there is no need to create the service. You could build only one transformation layer and include it in one of the two, preferably in the 2nd you would receive xml the way you are today and translate it yourself.

    
26.08.2015 / 15:28
0

I am taking into account the following premise:

As a service by definition is passive, then your application should query the first service, the response of this request should serve as the basis for mounting a request for the second Webservice.

This type of application usually involves performing some operation at regular intervals, in your case you could be querying 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 the execution of it by Windows Task Scheduler .

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

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

  

Visual Studio > Project > Add Service Reference ...

Then enter the URL (URL) with schema (MEX ou WSDL) of the service, choose a namespace of your choice, then the wizard will mount a Proxy to Web Service .

    
26.08.2015 / 16:05