Well, is validating the address part of the application (UI) logic or part of your domain requirements?
If it's an app function, it goes in the app layer. If it's a core domain function, it goes in the domain layer.
If you're concerned about coupling - for example, if you think that you might decide to use a different address validation service in the future - then place an abstraction over it. Create an interface and a wrapper class:
public interface IAddressValidator
{
bool ValidateAddress(Address address);
}
public class FooAddressValidator : IAddressValidator
{
private FooService service;
public FooAddressValidator(FooService service)
{
this.service = service;
}
public bool ValidateAddress(Address address)
{
return service.ValidateAddress(address.StreetLine1, address.City,
address.State, address.Country);
}
}
Or whatever the logic is. Then make your application (or domain model) depend on IAddressValidator
instead of the service itself, and fan in a concrete IAddressValidator
instance from the outermost layer.
You could put the core IAddressValidator
interface in your domain model and keep the FooAddressValidator
in an external assembly that's only ever referenced by the executable. That way your domain isn't actually dependent on the web service, but you still have address validation as part of your domain logic.
This also makes whatever uses the address validation component a lot easier to test, since you don't actually need to make web service calls, you can use a different MockAddressValidator
instance for that.