简体   繁体   中英

Windows Service consuming web service deployment

I have created a windows service which consumes a WCF Service hosted at some location.

The WCF service endpoint is specified in app.config of this windows service.

I am not sure whether what i want is really the right understanding i have about services or not. So here i go.

I have created a wix installer which encapsulates all my dependent third party dll's into one installer.

Now, the question is do i have to copy all the xsd files the client folder?

If yes , then does changing the WCF endpoint in app.config later once installed , would the new-endpoint be readily adopted by the windows service ( obviously as long as the contract remains same ) or even if it changes.?

I am not able to phrase the question well, maybe that's why even enough of googling didn't bring me any answers.

Please guide me understand this.

The .xsd files need to be copied if your service/dlls make use of them at runtime. I would assume this is the case since it's not likely (although it is certainly possible) that the .xsd files are only used in the development environment. If you have any questions about this, you can always try to install the service on another system and see if it runs successfully without them. Trial-and-error is not the most efficient way to test software, but it works 100% of the time.

As for modifying the endpoint in the app.config post-deployment, the WCF service hosted by your Windows service will happily adopt this providing that you restart the service. This is one of the most appealing features of WCF, namely that how you connect (TCP, HTTP, P2P, etc.) and where you connect (endpoint) can be specified without having to change the code. If the contract changes, things get more sticky. Additions to the contract, eg, new methods, would presumably be non-breaking changes, but modifications to existing methods would require the code to be rebuilt and redeployed.

HTH

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM