---
schema_version: "1"
id: 5f5db93a40a488774dff1f683ed69b7fa526d24f633b828ab29bfd5a975b9cf6
title: Web Service Consumer Additional Configuration Information
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/web-service-consumer-connector/1.11/web-service-consumer-config-topics.md
canonical_url: https://docs.mulesoft.com/web-service-consumer-connector/1.11/web-service-consumer-config-topics
source_site: docs.mulesoft.com
content_type: documentation
content_hash: ad7f8dabae4e2f26e3778a4d25bb108e51ec74ef733505ccc3997832b6a3fbde
description: MuleSoft Documentation Site
release: "1.11"
latest: false
---
---
product: Web Service Consumer Connector
version: 1.11
---

# Web Service Consumer Additional Configuration Information

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Set additional configuration for Anypoint Connector for Web Service Consumer (Web Service Consumer
Connector), such as custom HTTP Transport and Web Service Security both in Anypoint Studio and in
the XML editor.

## Configure Custom HTTP Transport

By default, the connector uses a simple unprotected HTTP configuration to dispatch all outgoing SOAP
messages. For cases where a more advanced HTTP configuration is required, you can parameterize the
Web Service Consumer Connector with an HTTP Connector configuration to dispatch the messages.

The following example illustrates how you might declare and reference an HTTP Requester
configuration with HTTP Basic authentication in the **Transport Configuration** parameter of the Web
Service Consumer Connector configuration to ensure that the connector dispatches each request:

1.  In Studio, open the **Global Element Properties** window of the Web Service Consumer Connector.

2.  On the **Transport** tab, for **Transport Configuration**, select
    `HTTP Transport Configuration`.  
    The **Requester Config** field automatically populates `HTTP_Request_configuration` only if you
    previously created the HTTP Request configuration.

3.  Click **OK**

In Studio, configuring custom HTTP transport looks like this:

![Configure Custom HTTP Transport](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/web-service-consumer-configure-transport.png)

In the **Configuration XML** tab, the reference of the HTTP Requester configuration
`<http:request-config name="HTTP_Request_configuration">` is under the Web Service Consumer
configuration `<wsc:custom-transport-configuration>`:

```xml
<http:request-config name="HTTP_Request_configuration">
    <http:request-connection host="www.exampleplace.com" port="8182" protocol="HTTP">
        <http:authentication>
            <http:basic-authentication username="admin" password="textpassword"/>
        </http:authentication>
    </http:request-connection>
</http:request-config>

<wsc:config name="with-custom-transport">
    <wsc:connection wsdlLocation="http://www.host.com?WSDL" service="Service" port="Port">
        <wsc:custom-transport-configuration>
            <wsc:http-transport-configuration requesterConfig="basic-auth"/>
        </wsc:custom-transport-configuration>
    </wsc:connection>
</wsc:config>
```

## Configure Web Service Security

The WS-Security protocol enables you to use various security token formats to enforce message
integrity and confidentiality. This protocol uses XML Signature and XML Encryption to provide
end-to-end security.

WS-Security describes how to:

- Sign SOAP messages to ensure integrity and provide nonrepudiation

- Encrypt SOAP messages to ensure confidentiality

- Attach security tokens to ascertain the sender’s identity

Web Service Consumer Connector supports the following mechanisms:

- Timestamp

- Signature or signature verification

- Username

- Encryption or decryption

The following example illustrates how you might configure a username token security strategy as web
service security for the connector:

1.  In Studio, open the **Global Element Properties** window of the Web Service Consumer Connector.

2.  On the **Security** tab, for **Username token security strategy**, select `Edit inline`.

3.  Complete the **Username**, and **Password** fields, and set **Add nonce** and **Add created**
    fields to `true`.

4.  Click **OK**.

In Studio, configuring web service security looks like this:

![Configure Web Service Security](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/web-service-consumer-configure-wsecurity.png)

In the **Configuration XML** tab, configuring Web Service Security looks like this:

```xml
<wsc:config name="with-custom-transport">
    <wsc:connection wsdlLocation="http://www.host.com?WSDL" service="Service" port="Port">
        <wsc:web-service-security>
            <wsc:username-token-security-strategy username="admin" password="textPassword" addCreated="true" addNonce="true"/>
        </wsc:web-service-security>
    </wsc:connection>
</wsc:config>
```

## Configure WSC:EMPTY\_RESPONSE Error

When mandatory fields are missing from the response (Illegal Empty Response), you can configure the
**Error Handler** component to throw the `WSC:EMPTY_RESPONSE` error for the Web Service Consumer
Connector.

1.  In Studio, select the **On Error Continue** component of the Error handling section.

2.  Set **Type** to **WSC:EMPTY\_RESPONSE**.

![WSC:EMPTY\_RESPONSE selected for Type field](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/web-service-consumer-emptyresponse.png)

In the **Configuration XML** tab, the configuration looks like this:

```xml
<flow name="WSC-Example">
  <scheduler>
    <scheduling-strategy >
      <fixed-frequency />
    </scheduling-strategy>
  </scheduler>
  <set-variable value="test" variableName="variableSample"/>
  <ee:transform>
    <ee:message >
      <ee:set-payload ><![CDATA[ %dw 2.0
output application/xml
ns con http://service.soap.service.mule.org/
---
con#attachOperation: {
    text: vars.variableSample
}]]></ee:set-payload>
    </ee:message>
  </ee:transform>
  <wsc:consume config-ref="Web_Service_Consumer_Config" operation="attachOperation">
    <wsc:message-customizations forceXMLProlog="true"/>
  </wsc:consume>
    <error-handler >
      <on-error-continue enableNotifications="true" logException="true" type="WSC:EMPTY_RESPONSE">
      <logger level="INFO" message="The response was empty." />
      </on-error-continue>
    </error-handler>
</flow>
```

## Read Attributes in a Failure Scenario

The following example shows how to configure the Web Service Consumer Connector to read SOAP
attributes or additional transport data attributes in a failure scenario.

1.  In Studio, drag a **Scheduler** source to your flow.

2.  Drag a **Set variable** component alongside the **Scheduler** source.

3.  Set **Name** to `variableSample` and **Value** to `test`.

4.  Drag a **Transform Message** component alongside the **Set Variable** component.

5.  In the Datasense output view, add the following DataWeave expression:

```dataweave
 %dw 2.0
output application/xml
ns con http://service.soap.service.mule.org/
---
con#attachOperation: {
    text: vars.variableSample
}
```

6.  Drag the Web Service Consumer Connector **Consume** operation alongside the **Transform
    Message** component.

7.  Set a **Connector configuration** for the connector.

8.  Set **Operation** to `attachOperation`.

9.  Drag an **On Error Continue** component to the Error handling section of your flow.

10. Set **Type** to `WSC:BAD_RESPONSE`.

11. Drag a **Logger** component into the **On Error Continue** component.

12. Set **Message** to the expression `#[error.additionalData.statusCode]` to read SOAP attributes
    or additional transport data.

In the **Configuration XML** tab, the configuration looks like this:

```xml
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
	xmlns:wsc="http://www.mulesoft.org/schema/mule/wsc" xmlns:compression="http://www.mulesoft.org/schema/mule/compression"
	xmlns="http://www.mulesoft.org/schema/mule/core"
	xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/compression http://www.mulesoft.org/schema/mule/compression/current/mule-compression.xsd
http://www.mulesoft.org/schema/mule/wsc http://www.mulesoft.org/schema/mule/wsc/current/mule-wsc.xsd">
	<flow name="WSC-Example">
  <scheduler>
    <scheduling-strategy >
      <fixed-frequency />
    </scheduling-strategy>
  </scheduler>
  <set-variable value="test" variableName="variableSample"/>
  <ee:transform>
    <ee:message >
      <ee:set-payload ><![CDATA[ %dw 2.0
output application/xml
ns con http://service.soap.service.mule.org/
---
con#attachOperation: {
    text: vars.variableSample
}]]></ee:set-payload>
    </ee:message>
  </ee:transform>
  <wsc:consume config-ref="Web_Service_Consumer_Config" operation="attachOperation">
    <wsc:message-customizations forceXMLProlog="true"/>
  </wsc:consume>
    <error-handler >
      <on-error-continue enableNotifications="true" logException="true" type="WSC:BAD_RESPONSE">
      <logger level="INFO" message="#[error.additionalData.statusCode]" />
      </on-error-continue>
    </error-handler>
</flow>
	</flow>
</mule>
```

## See Also

- [Salesforce Help](https://help.salesforce.com)

- [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/1.11/web-service-consumer-reference)
