简体   繁体   中英

Call ASMX or WCF service from another WCF service

I have a windows service (WCF service with Windows authentication and netTCPBinding) which is consumed by WPF application. Now, I have a requirement to call another service hosted on separate machine (it can be ASMX or WCF service) from my windows service.

I would like to know

a) Is it the correct practice to call one web service from another or should i call it from my WPF application

b) If i have to call this service from my windows service what all things I need to consider and any pitfalls I should be aware of like authentication, bindings.

Any links showing similar implementations will be helpful

Thanks

a) There is no reason you shouldn't but be sure you wrap any errors that can happen in your other service, dot let errors from your downstream service bubble up to your calling (WPF) application.

b) Nothing you wouldn't have encountered in your Calling application, like timeout issues. Make sure your Client to service timeout caters for the timeouts of the service to downstream service.

Also, can I suggest from experience, try and stick to the ChannelFactory pattern http://msdn.microsoft.com/en-us/library/ms734681(v=vs.110).aspx .

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