sysboard
sysboard

Reputation: 287

Multiple Webservices With Common Operations and Types

I have received many WSDLs that have common operations (login, logout, insert, update etc) and common types (request, response, connect fault, data container). The differences that i found are target namespace and type of data being transported within the data container. Is it possible to have one service client that exposes the common operations?

Upvotes: 0

Views: 93

Answers (1)

CodeCaster
CodeCaster

Reputation: 151720

Only if their interfaces and schemas match exactly. And they don't, since the namespace differs, for one, so no.

Why would you do that? You could however create a kind of wrapper that calls recurring methods on the various service proxy clients.

Edit: I mean like this:

public void Login(String username, String password)
{
    _client1.Login(username, password);
    _client2.Login(username, password);
    _client3.Login(username, password);
}

You don't want to create a "universal" client, for it'll be unable to communicate with one of the services you're trying to consume when the signature of that service changes. What do you do then, create a second client? Then you're back to square one.

Upvotes: 2

Related Questions