Contact Free trial Login

To Configure the Web Service Consumer

To consume a SOAP Web Service operation, you need to create a configuration that points to the service that you want to consume.

The Web Service Consumer (WSC) connector has a single configuration. The most important configuration parameters are the the WSDL Location (wdslLocation), the Service (service), and the Port (port). The configuration will not be valid if any of them are not set.

The WSDL Location is the path or URL where the WSDL is located (local or remote), and the Service and Port are the parameters that specify which SOAP operations can be executed using the configuration.

Another important parameter is Service Address (address), where indicates where the requests are dispatched. This parameter is usually auto-populated when the Service and Port are specified, but sometimes the Service-Port pair does not indicate an address, and you need to provide the correct one.

Here is a simple configuration example:

Simple Web Service Consumer Configuration
<wsc:config name="wsc">

Note that the configuration above does not contains the address parameter because the service and port pair declares a valid address. The WSDL in the example is for the Global Weather service, a public service.

Setting a Custom HTTP Transport Configuration

By default, the connector uses a simple, non-protected HTTP configuration to dispatch all outgoing SOAP messages. For cases where a more advanced HTTP configuration is required, the Web Service Consumer can be parameterized with an HTTP connector configuration that will be used to dispatch the messages. Take a look at the following example:

Custom Transport Web Service Consumer Configuration
<http:request-config name="basic-auth">
    <http:request-connection host="" port="8182" protocol="HTTP">
            <http:basic-authentication username="alejandro.garcia" password="nariz"/>

<wsc:config name="with-custom-transport">
    <wsc:connection wsdlLocation="" service="Service" port="Port">
            <wsc:http-transport-configuration requesterConfig="basic-auth"/>

In the example, an HTTP Requester configuration with HTTP basic authentication is declared and then referenced in the custom-transport-configuration element in the WSC configuration. Now the WSC will dispatch each one of the requests using the advanced configuration that is provided.

Note that the Web Service Consumer configuration also supports WSS security strategies. See the link to the Technical Reference below for more information.

Setting Web Service Security

The WS-Security (WSS) protocol specifies how integrity and confidentiality can be enforced on messages and allows the communication of various security token formats. Its main focus is the use of XML Signature and XML Encryption to provide end-to-end security.

WS-Security describes three main mechanisms:

  • How to sign SOAP messages to assure integrity. Signed messages also provide nonrepudiation.

  • How to encrypt SOAP messages to assure confidentiality.

  • How to attach security tokens to ascertain the sender’s identity.

The Web Service consumer supports the following mechanisms:

  • Timestamp

  • Signature/Signature Verification

  • Username

  • Encryption/Decryption

Example of a configuration with username WSS stategy:

<wsc:config name="with-custom-transport">
    <wsc:connection wsdlLocation="" service="Service" port="Port">
            <wsc:username-token-security-strategy username="admin" password="textPassword" addCreated="true" addNonce="true"/>

See: Web Service Consumer Technical Reference to know how to configure each WSS strategy and see the description of each parameter associated to it.

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub