Handling looking up 3rd party services
I'm curious as how to handle lookup of 3rd party web services within an enterprise application e.g. a payment gateway.
If you know how to discover the web service (lets开发者_JS百科 assume this information is part of your externalised configuration stored in a properties file), how do you decouple it from you application?
Would implementing the Business Delegate pattern be most suitable for circumstances such as this? Hiding the type of remote service behind an interface.
I was also curious as to best practice to invoke the service (lets assume a JAX-WS end point and you've generated a client from the WSDL).
Invoking an operation on JAX-WS end point is two-step: 1) Create the client-view of the endpoint (jax.ws.Service) 2) Create a proxy. Would it be best to only do 1) once? Or would it be better do it for every request made to the end point so that you can handle the use case where web service is unavailabe?
Yes you could use the Business Delegate pattern to decouple the details of the WebService
精彩评论