# mulesoft Web Service Consumer Connector - Full Documentation --- product: Web Service Consumer Connector version: 1.11 --- # Troubleshooting Web Service Consumer Connector > For the full documentation index, see: https://docs.mulesoft.com/llms.txt To troubleshoot Anypoint Connector for Web Service Consumer (Web Service Consumer Connector), become familiar with the information about enabling wire logging, troubleshooting access attachments, troubleshooting design-time WSDL issues, and interpreting commonly thrown messages. ## Enable Wire Logging To begin troubleshooting Web Service Consumer Connector, look at the transport request and response on the Web Service Consumer. If you are using the underlying HTTP transport, you can enable wire logging to see the exact HTTP message, the transmission headers, and the response status. To enable wire logging: 1. Access Anypoint Studio and navigate to the **Package Explorer** view. 2. Open your application’s project name. 3. Open the `src/main/resources` path folder. 4. Open the `log4j2.xml` file inside the folder. 5. If the following line is already in the `log4j2.xml` file, uncomment it to enable it; otherwise, add it: ```xml ``` 6. Save your changes. 7. Click the project name in **Package Explorer** and then click **Run** > **Run As** > **Mule Application**. 8. Navigate to the **Console** view to read the HTTP messages in the logger: ```plain-text POST /essentials/delta HTTP/1.1 soapaction: Host: ilt.mulesoft-training.com User-Agent: AHC/1.0 Connection: keep-alive Accept: */* Content-Type: text/xml; charset=UTF-8 Transfer-Encoding: chunked b1 DEBUG 2021-04-06 15:04:23,058 [[wsc-base].wsc-dispatcher.11 SelectorRunner] [processor: ; event: ] org.mule.service.http.impl.service.HttpMessageLogger.wsc-dispatcher: REQUESTER 0 DEBUG 2021-04-06 15:04:23,319 [[wsc-base].wsc-dispatcher.11 SelectorRunner] [processor: ; event: ] org.mule.service.http.impl.service.HttpMessageLogger.wsc-dispatcher: REQUESTER HTTP/1.1 200 Date: Tue, 06 Apr 2021 18:04:23 GMT Content-Type: text/xml; charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive MULE_ENCODING: UTF-8 Strict-Transport-Security: max-age=31536000; includeSubdomains; X-Content-Type-Options: 1 X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block bfe ... ``` ## Troubleshoot Access Attachments Some servers respond to requests by sending MTOM (Message Transmission Optimization Mechanism) messages. These messages separate their data into parts, which enables different types of content data to coexist in the same HTTP message. MTOM is in charge of sending binary data in a separate part and referencing that part from the corresponding field within the SOAP envelope. Web Service Consumer users interact with these messages (multipart) only with the MTOM configuration. Refer to the following documentation for further information about MTOM: - [RFC2387 - The MIME Multipart/Related Content-type](https://www.ietf.org/rfc/rfc2387.txt) - [XML-binary Optimized Packaging (XOP) W3C Recommendation](https://www.w3.org/TR/2005/REC-xop10-20050125/) - [SOAP Message Transmission Optimization Mechanism (MTOM) W3C Recommendation](https://www.w3.org/TR/soap12-mtom/) Beginning with version 1.6.4, Web Service Consumer Connector enables you to configure MTOM for request messages that also automatically manage MTOM responses, regardless of the MTOM setting in the Web Service Consumer global configuration. Incoming messages with MTOM are treated as MTOM-enabled, regardless of whether MTOM is configured in the Web Service Consumer global configuration. The following example shows the Web Service Consumer Connector global configuration with MTOM enabled: ![Web Service Consumer global element configuration with MTOM field set to TRUE](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/wsc-troubleshoot-3.png) Figure 1. Web Service Consumer Connector Global Element In the XML editor, the `` and `mtomEnabled` configurations look like this: ```xml ``` Depending on the server side multipart setting, the server might send some binary data as a Base64-encoded text field or as a referenced binary part in the MIME message. To troubleshoot how to access the binary data: - If the server sends the binary data as Base64-encoded text field, you must access this field as part of the message. Base64 decoding is automatically performed by Web Service Consumer. - If the server sends the binary data as a referenced binary part, you must access this field as an attachment. The following example shows an image sent as an attachment with MTOM by a web service server. You use DataWeave to access and transform the image into JSON. In this case, Base64 encoding is required: ```DataWeave import * from dw::core::Strings import dw::core::Binaries output application/json ns nam http://mynamespace.com --- { ... "image": Binaries::toBase64(payload.attachments[0]), ... } ``` ## Troubleshoot Design Time WSDL Issues Errors related to incorrect WSDL recognition, acquisition, or parsing sometimes lead to the following issues: - DataSense does not correctly expose the message metadata defined in the WSDL. - In the Web Service Consumer Connector configuration screen, the **Operations** field does not show any web service operation names for the connector to invoke: ![Web Service Consumer Connector Operations field shows empty](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/wsc-troubleshoot-1.png) Figure 2. Web Service Consumer Connector Operations field - In the Web Service Consumer Connector global element configuration, the **Port** and **Address** fields are not automatically filled when a WSDL location is provided. ![In the Web Service Consumer Connector global element window](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/wsc-troubleshoot-2.png) Figure 3. Web Service Consumer Connector Global Element To resolve these issues: - Check the integrity of your WSDL by using your preferred online or desktop viewer applications. Because every parsing error during the configuration is not shown during design-time, implementing an external application helps detect them. - If you do not add the WSDL as a resource in the application’s **src/main/resources** folder in Studio, check for a correct connection to the server hosting the WSDL. Sometimes you need to add custom HTTP settings, such as OAuth settings or user/password settings, to access an HTTP server in an HTTP security layer. See [Setting a Custom HTTP Transport Configuration.](https://docs.mulesoft.com/web-service-consumer-connector/1.11/web-service-consumer-config-topics) ## Troubleshooting Must Understand Error If your Mule Web Service Consumer app throws the error `WSC:CANNOT_DISPATCH`, and the third-party server returns in the HTTP response the `soap:MustUnderstand` as the exception for the connector caused error, this indicates that the Web Service Consumer connector configuration has the Security setting **Must Understand** field set to the default value of `true`. To avoid this issue, set the **Must understand** field to `false`. The default value of this attribute to `true` is on the connector side, but on the SOAP protocol side the implicit value for the **Must Understand** attribute is `false` when is not present. If you do not explicitly need to use the **Must Understand** attribute for SOAP request, set the value to `false`. ![Web Service Consumer configuration setting Must Understand value to false](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/wsc-must-understand.png) The returned HTTP response might come with a compressed or uncompressed payload body for you to check the `soap:MustUnderstand` exception. If the HTTP response header `Content-Encoding` is `gzip`, it indicates that the payload body is compressed, for example, review the following HTTP response where you can see compressed characters such as �RMo�0 �W���: ```XML HTTP/1.1 500 Internal Server Error X-OPNET-Transaction-Trace: a2_ba571488-537c-4839-94a9-48f3f08fadf3 Content-Encoding: gzip Content-Type: multipart/related; type="application/xop+xml"; boundary="uuid:83b066a2-fb96-4abf-a687-dd178a5b3e29"; start=""; start-info="text/xml" Content-Length: 363 X-Cnection: close Date: Wed, 23 Nov 2022 13:41:25 GMT Connection: close Set-Cookie: dc=dcs; Path=/; Version=1; Secure; Httponly; Max-Age=900 Strict-Transport-Security: max-age=31536000 �???????�RMo�0 �W���N!�c-�M�:i��֞� 1�&(h�_h���v���l?[�iJ��4X,`��t��sHs�pɥ�,C�Og8]�GOZYT��#u]��R+����=Vk�`�f�{��Y��x[+�]�0�(G÷*ӲT�����]$������?"�!ksj� ��9$��x��:ڪ/�t��5Q���+��#!�ɏ@��z��} pH^r��e7�/�T6���r�09�o ٽ�hȂ����g%Y�&Ine�@��}� �����@%q�_�,}�i�E0g���`֘�v�n�|�~K��}�?dJ[֜;k-���`+ף������^�����Y9E?? ``` To decompress the payload body of the response, your Mule app must catch the thrown error using an **Error Handler** component, and then use the Compression Module **Decompress** operation to decompress the response. In Studio, navigate to the **Decompress** operation configuration screen, and set the **Compressed** field to the following expression to read compressed payload and catch the exception: `error.exception.errorMessage.typedAttributes.value.headers.` ![Compressed field set with expression value](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/wsc-decompress.png) Subsequently, you can use a **Logger** component in your Mule app to log the entire payload body with the exception, for example, the following logs show the decompressed payload SOAP body with `soap:MustUnderstand`: ```XML INFO 2022-11-23 14:57:05,247 [[MuleRuntime].uber.05: [ri-uhip-integration-esb-1095brequesttransmitterservice2_11-02-20221].BulkRequestTransmitter:\soapkit-config.BLOCKING @3f46eb07] [processor: BulkRequestTransmitter:\soapkit-config/processors/4/errorHandler/0/processors/2; event: 58ed0ad0-6b57-11ed-b9ce-147ddaa4cf6c] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: --uuid:223e386d-3093-4df4-b5f9-9cb3b9a493a2 Content-Type: application/xop+xml; charset=UTF-8; type="text/xml" Content-Transfer-Encoding: binary Content-ID: soap:MustUnderstandMustUnderstand headers: [{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security] are not understood. --uuid:223e386d-3093-4df4-b5f9-9cb3b9a493a2-- ``` ## Troubleshooting Systems Properties - `mule.soap.maxAttributeSize` (default value = 524288) The XML parser library has a value limit for the `mule.soap.maxAttributeSize` system property that specifies maximum allowed length of attribute values, in characters. The limit protects against possible Denial-of-Service (DoS) attacks, wherein XML-based web services may be attacked by specifically crafted documents that could cause processing problems by excessive memory or computing power usage. The default value is 524288 characters and it is a reasonable default value for normal usage. You can change it to a higher value if input documents can legitimately exceed the default limit, or to a lower value if specific attacks are observed or the system has a lower resource allocation. One signal to change the value limit is when the exception `javax.xml.stream.XMLStreamException: Maximum attribute size limit (524288) exceeded` occurs when processing legitimate documents. To change this value, you have to set the `mule.soap.maxAttributeSize` system property with the accurate number according to your needs. Refer to the Knowledge article [How can I set Mule and Java system properties at startup?](https://help.salesforce.com/s/articleView?id=001115098&type=1)). The maximum value allowed is 2147483647 ([Integer.MAX\_VALUE](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html#MAX_VALUE) in Java). If you set 0 or if you don’t set the property, the connector takes the default value. ## No Content-Type Boundled in the Message In Web Service Consumer Connector 1.10.0 and earlier, you might see the `No Content-Type boundled in the message` error. In Web Service Consumer Connector 1.10.1 and later, the `No Content-Type boundled in the message` error is not thrown if the Content-Type header is missing in the response when the status code is not `200`. For more information, refer to the [SOAP specification](https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383529) and [HTTP Response Headers Fields](https://www.w3.org/TR/soap12-part2/#http-respbindprocess). ## Understand Common Throws Here is a list of common throw messages and how to interpret them. - WSC:SOAP\_FAULT Error matching the SOAP response with the format provided by the WSDL. Every CXF SOAP fault error is wrapped in a \`WSC:SOAP\_FAULT\`. - WSC:BAD\_REQUEST The Web Service Consumer Connector operation does not exist in the WSDL. The request body is not a valid XML. - WSC:INVALID\_WSDL The WSDL is poorly formatted. - WSC:EMPTY\_RESPONSE Occurs when mandatory fields are missing from the response (Illegal Empty Response). ## See Also - [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/1.11/web-service-consumer-reference) - [Salesforce Help](https://help.salesforce.com) - [Known Issues](https://help.salesforce.com/s/issues) --- product: Web Service Consumer Connector version: 1.12 --- # Troubleshooting Web Service Consumer Connector > For the full documentation index, see: https://docs.mulesoft.com/llms.txt To troubleshoot Anypoint Connector for Web Service Consumer (Web Service Consumer Connector), become familiar with the information about enabling wire logging, troubleshooting access attachments, troubleshooting design-time WSDL issues, and interpreting commonly thrown messages. ## Enable Wire Logging To begin troubleshooting Web Service Consumer Connector, look at the transport request and response on the Web Service Consumer. If you are using the underlying HTTP transport, you can enable wire logging to see the exact HTTP message, the transmission headers, and the response status. To enable wire logging: 1. Access Anypoint Studio and navigate to the **Package Explorer** view. 2. Open your application’s project name. 3. Open the `src/main/resources` path folder. 4. Open the `log4j2.xml` file inside the folder. 5. If the following line is already in the `log4j2.xml` file, uncomment it to enable it; otherwise, add it: ```xml ``` 6. Save your changes. 7. Click the project name in **Package Explorer** and then click **Run** > **Run As** > **Mule Application**. 8. Navigate to the **Console** view to read the HTTP messages in the logger: ```plain-text POST /essentials/delta HTTP/1.1 soapaction: Host: ilt.mulesoft-training.com User-Agent: AHC/1.0 Connection: keep-alive Accept: */* Content-Type: text/xml; charset=UTF-8 Transfer-Encoding: chunked b1 DEBUG 2021-04-06 15:04:23,058 [[wsc-base].wsc-dispatcher.11 SelectorRunner] [processor: ; event: ] org.mule.service.http.impl.service.HttpMessageLogger.wsc-dispatcher: REQUESTER 0 DEBUG 2021-04-06 15:04:23,319 [[wsc-base].wsc-dispatcher.11 SelectorRunner] [processor: ; event: ] org.mule.service.http.impl.service.HttpMessageLogger.wsc-dispatcher: REQUESTER HTTP/1.1 200 Date: Tue, 06 Apr 2021 18:04:23 GMT Content-Type: text/xml; charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive MULE_ENCODING: UTF-8 Strict-Transport-Security: max-age=31536000; includeSubdomains; X-Content-Type-Options: 1 X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block bfe ... ``` ## Troubleshoot Access Attachments Some servers respond to requests by sending MTOM (Message Transmission Optimization Mechanism) messages. These messages separate their data into parts, which enables different types of content data to coexist in the same HTTP message. MTOM is in charge of sending binary data in a separate part and referencing that part from the corresponding field within the SOAP envelope. Web Service Consumer users interact with these messages (multipart) only with the MTOM configuration. Refer to the following documentation for further information about MTOM: - [RFC2387 - The MIME Multipart/Related Content-type](https://www.ietf.org/rfc/rfc2387.txt) - [XML-binary Optimized Packaging (XOP) W3C Recommendation](https://www.w3.org/TR/2005/REC-xop10-20050125/) - [SOAP Message Transmission Optimization Mechanism (MTOM) W3C Recommendation](https://www.w3.org/TR/soap12-mtom/) Beginning with version 1.6.4, Web Service Consumer Connector enables you to configure MTOM for request messages that also automatically manage MTOM responses, regardless of the MTOM setting in the Web Service Consumer global configuration. Incoming messages with MTOM are treated as MTOM-enabled, regardless of whether MTOM is configured in the Web Service Consumer global configuration. The following example shows the Web Service Consumer Connector global configuration with MTOM enabled: ![Web Service Consumer global element configuration with MTOM field set to TRUE](/mulesoft/current/en-us/web-service-consumer-connector/1.12/_images/wsc-troubleshoot-3.png) Figure 1. Web Service Consumer Connector Global Element In the XML editor, the `` and `mtomEnabled` configurations look like this: ```xml ``` Depending on the server side multipart setting, the server might send some binary data as a Base64-encoded text field or as a referenced binary part in the MIME message. To troubleshoot how to access the binary data: - If the server sends the binary data as Base64-encoded text field, you must access this field as part of the message. Base64 decoding is automatically performed by Web Service Consumer. - If the server sends the binary data as a referenced binary part, you must access this field as an attachment. The following example shows an image sent as an attachment with MTOM by a web service server. You use DataWeave to access and transform the image into JSON. In this case, Base64 encoding is required: ```DataWeave import * from dw::core::Strings import dw::core::Binaries output application/json ns nam http://mynamespace.com --- { ... "image": Binaries::toBase64(payload.attachments[0]), ... } ``` ## Troubleshoot Design Time WSDL Issues Errors related to incorrect WSDL recognition, acquisition, or parsing sometimes lead to the following issues: - DataSense does not correctly expose the message metadata defined in the WSDL. - In the Web Service Consumer Connector configuration screen, the **Operations** field does not show any web service operation names for the connector to invoke: ![Web Service Consumer Connector Operations field shows empty](/mulesoft/current/en-us/web-service-consumer-connector/1.12/_images/wsc-troubleshoot-1.png) Figure 2. Web Service Consumer Connector Operations field - In the Web Service Consumer Connector global element configuration, the **Port** and **Address** fields are not automatically filled when a WSDL location is provided. ![In the Web Service Consumer Connector global element window](/mulesoft/current/en-us/web-service-consumer-connector/1.12/_images/wsc-troubleshoot-2.png) Figure 3. Web Service Consumer Connector Global Element To resolve these issues: - Check the integrity of your WSDL by using your preferred online or desktop viewer applications. Because every parsing error during the configuration is not shown during design-time, implementing an external application helps detect them. - If you do not add the WSDL as a resource in the application’s **src/main/resources** folder in Studio, check for a correct connection to the server hosting the WSDL. Sometimes you need to add custom HTTP settings, such as OAuth settings or user/password settings, to access an HTTP server in an HTTP security layer. See [Setting a Custom HTTP Transport Configuration.](https://docs.mulesoft.com/web-service-consumer-connector/1.12/web-service-consumer-config-topics) ## Troubleshooting Must Understand Error If your Mule Web Service Consumer app throws the error `WSC:CANNOT_DISPATCH`, and the third-party server returns in the HTTP response the `soap:MustUnderstand` as the exception for the connector caused error, this indicates that the Web Service Consumer connector configuration has the Security setting **Must Understand** field set to the default value of `true`. To avoid this issue, set the **Must understand** field to `false`. The default value of this attribute to `true` is on the connector side, but on the SOAP protocol side the implicit value for the **Must Understand** attribute is `false` when is not present. If you do not explicitly need to use the **Must Understand** attribute for SOAP request, set the value to `false`. ![Web Service Consumer configuration setting Must Understand value to false](/mulesoft/current/en-us/web-service-consumer-connector/1.12/_images/wsc-must-understand.png) The returned HTTP response might come with a compressed or uncompressed payload body for you to check the `soap:MustUnderstand` exception. If the HTTP response header `Content-Encoding` is `gzip`, it indicates that the payload body is compressed, for example, review the following HTTP response where you can see compressed characters such as �RMo�0 �W���: ```XML HTTP/1.1 500 Internal Server Error X-OPNET-Transaction-Trace: a2_ba571488-537c-4839-94a9-48f3f08fadf3 Content-Encoding: gzip Content-Type: multipart/related; type="application/xop+xml"; boundary="uuid:83b066a2-fb96-4abf-a687-dd178a5b3e29"; start=""; start-info="text/xml" Content-Length: 363 X-Cnection: close Date: Wed, 23 Nov 2022 13:41:25 GMT Connection: close Set-Cookie: dc=dcs; Path=/; Version=1; Secure; Httponly; Max-Age=900 Strict-Transport-Security: max-age=31536000 �???????�RMo�0 �W���N!�c-�M�:i��֞� 1�&(h�_h���v���l?[�iJ��4X,`��t��sHs�pɥ�,C�Og8]�GOZYT��#u]��R+����=Vk�`�f�{��Y��x[+�]�0�(G÷*ӲT�����]$������?"�!ksj� ��9$��x��:ڪ/�t��5Q���+��#!�ɏ@��z��} pH^r��e7�/�T6���r�09�o ٽ�hȂ����g%Y�&Ine�@��}� �����@%q�_�,}�i�E0g���`֘�v�n�|�~K��}�?dJ[֜;k-���`+ף������^�����Y9E?? ``` To decompress the payload body of the response, your Mule app must catch the thrown error using an **Error Handler** component, and then use the Compression Module **Decompress** operation to decompress the response. In Studio, navigate to the **Decompress** operation configuration screen, and set the **Compressed** field to the following expression to read compressed payload and catch the exception: `error.exception.errorMessage.typedAttributes.value.headers.` ![Compressed field set with expression value](/mulesoft/current/en-us/web-service-consumer-connector/1.12/_images/wsc-decompress.png) Subsequently, you can use a **Logger** component in your Mule app to log the entire payload body with the exception, for example, the following logs show the decompressed payload SOAP body with `soap:MustUnderstand`: ```XML INFO 2022-11-23 14:57:05,247 [[MuleRuntime].uber.05: [ri-uhip-integration-esb-1095brequesttransmitterservice2_11-02-20221].BulkRequestTransmitter:\soapkit-config.BLOCKING @3f46eb07] [processor: BulkRequestTransmitter:\soapkit-config/processors/4/errorHandler/0/processors/2; event: 58ed0ad0-6b57-11ed-b9ce-147ddaa4cf6c] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: --uuid:223e386d-3093-4df4-b5f9-9cb3b9a493a2 Content-Type: application/xop+xml; charset=UTF-8; type="text/xml" Content-Transfer-Encoding: binary Content-ID: soap:MustUnderstandMustUnderstand headers: [{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security] are not understood. --uuid:223e386d-3093-4df4-b5f9-9cb3b9a493a2-- ``` ## Troubleshooting Systems Properties - `mule.soap.maxAttributeSize` (default value = 524288) The XML parser library has a value limit for the `mule.soap.maxAttributeSize` system property that specifies maximum allowed length of attribute values, in characters. The limit protects against possible Denial-of-Service (DoS) attacks, wherein XML-based web services may be attacked by specifically crafted documents that could cause processing problems by excessive memory or computing power usage. The default value is 524288 characters and it is a reasonable default value for normal usage. You can change it to a higher value if input documents can legitimately exceed the default limit, or to a lower value if specific attacks are observed or the system has a lower resource allocation. One signal to change the value limit is when the exception `javax.xml.stream.XMLStreamException: Maximum attribute size limit (524288) exceeded` occurs when processing legitimate documents. To change this value, you have to set the `mule.soap.maxAttributeSize` system property with the accurate number according to your needs. Refer to the Knowledge article [How can I set Mule and Java system properties at startup?](https://help.salesforce.com/s/articleView?id=001115098&type=1)). The maximum value allowed is 2147483647 ([Integer.MAX\_VALUE](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html#MAX_VALUE) in Java). If you set 0 or if you don’t set the property, the connector takes the default value. ## No Content-Type Boundled in the Message In Web Service Consumer Connector 1.10.0 and earlier, you might see the `No Content-Type boundled in the message` error. In Web Service Consumer Connector 1.10.1 and later, the `No Content-Type boundled in the message` error is not thrown if the Content-Type header is missing in the response when the status code is not `200`. For more information, refer to the [SOAP specification](https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383529) and [HTTP Response Headers Fields](https://www.w3.org/TR/soap12-part2/#http-respbindprocess). ## Understand Common Throws Here is a list of common throw messages and how to interpret them. - WSC:SOAP\_FAULT Error matching the SOAP response with the format provided by the WSDL. Every CXF SOAP fault error is wrapped in a \`WSC:SOAP\_FAULT\`. - WSC:BAD\_REQUEST The Web Service Consumer Connector operation does not exist in the WSDL. The request body is not a valid XML. - WSC:INVALID\_WSDL The WSDL is poorly formatted. - WSC:EMPTY\_RESPONSE Occurs when mandatory fields are missing from the response (Illegal Empty Response). ## See Also - [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/1.12/web-service-consumer-reference) - [Salesforce Help](https://help.salesforce.com) - [Known Issues](https://help.salesforce.com/s/issues) --- product: Web Service Consumer Connector version: 2.0 --- # Troubleshooting Web Service Consumer Connector > For the full documentation index, see: https://docs.mulesoft.com/llms.txt To troubleshoot Anypoint Connector for Web Service Consumer (Web Service Consumer Connector), become familiar with the information about enabling wire logging, troubleshooting access attachments, troubleshooting design-time WSDL issues, and interpreting commonly thrown messages. ## Enable Wire Logging To begin troubleshooting Web Service Consumer Connector, look at the transport request and response on the Web Service Consumer. If you are using the underlying HTTP transport, you can enable wire logging to see the exact HTTP message, the transmission headers, and the response status. To enable wire logging: 1. Access Anypoint Studio and navigate to the **Package Explorer** view. 2. Open your application’s project name. 3. Open the `src/main/resources` path folder. 4. Open the `log4j2.xml` file inside the folder. 5. If the following line is already in the `log4j2.xml` file, uncomment it to enable it; otherwise, add it: ```xml ``` 6. Save your changes. 7. Click the project name in **Package Explorer** and then click **Run** > **Run As** > **Mule Application**. 8. Navigate to the **Console** view to read the HTTP messages in the logger: ```plain-text POST /essentials/delta HTTP/1.1 soapaction: Host: ilt.mulesoft-training.com User-Agent: AHC/1.0 Connection: keep-alive Accept: */* Content-Type: text/xml; charset=UTF-8 Transfer-Encoding: chunked b1 DEBUG 2021-04-06 15:04:23,058 [[wsc-base].wsc-dispatcher.11 SelectorRunner] [processor: ; event: ] org.mule.service.http.impl.service.HttpMessageLogger.wsc-dispatcher: REQUESTER 0 DEBUG 2021-04-06 15:04:23,319 [[wsc-base].wsc-dispatcher.11 SelectorRunner] [processor: ; event: ] org.mule.service.http.impl.service.HttpMessageLogger.wsc-dispatcher: REQUESTER HTTP/1.1 200 Date: Tue, 06 Apr 2021 18:04:23 GMT Content-Type: text/xml; charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive MULE_ENCODING: UTF-8 Strict-Transport-Security: max-age=31536000; includeSubdomains; X-Content-Type-Options: 1 X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block bfe ... ``` ## Troubleshoot Access Attachments Some servers respond to requests by sending MTOM (Message Transmission Optimization Mechanism) messages. These messages separate their data into parts, which enables different types of content data to coexist in the same HTTP message. MTOM is in charge of sending binary data in a separate part and referencing that part from the corresponding field within the SOAP envelope. Web Service Consumer users interact with these messages (multipart) only with the MTOM configuration. Refer to the following documentation for further information about MTOM: - [RFC2387 - The MIME Multipart/Related Content-type](https://www.ietf.org/rfc/rfc2387.txt) - [XML-binary Optimized Packaging (XOP) W3C Recommendation](https://www.w3.org/TR/2005/REC-xop10-20050125/) - [SOAP Message Transmission Optimization Mechanism (MTOM) W3C Recommendation](https://www.w3.org/TR/soap12-mtom/) Beginning with version 1.6.4, Web Service Consumer Connector enables you to configure MTOM for request messages that also automatically manage MTOM responses, regardless of the MTOM setting in the Web Service Consumer global configuration. Incoming messages with MTOM are treated as MTOM-enabled, regardless of whether MTOM is configured in the Web Service Consumer global configuration. The following example shows the Web Service Consumer Connector global configuration with MTOM enabled: ![Web Service Consumer global element configuration with MTOM field set to TRUE](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/wsc-troubleshoot-3.png) Figure 1. Web Service Consumer Connector Global Element In the XML editor, the `` and `mtomEnabled` configurations look like this: ```xml ``` Depending on the server side multipart setting, the server might send some binary data as a Base64-encoded text field or as a referenced binary part in the MIME message. To troubleshoot how to access the binary data: - If the server sends the binary data as Base64-encoded text field, you must access this field as part of the message. Base64 decoding is automatically performed by Web Service Consumer. - If the server sends the binary data as a referenced binary part, you must access this field as an attachment. The following example shows an image sent as an attachment with MTOM by a web service server. You use DataWeave to access and transform the image into JSON. In this case, Base64 encoding is required: ```DataWeave import * from dw::core::Strings import dw::core::Binaries output application/json ns nam http://mynamespace.com --- { ... "image": Binaries::toBase64(payload.attachments[0]), ... } ``` ## Troubleshoot Design Time WSDL Issues Errors related to incorrect WSDL recognition, acquisition, or parsing sometimes lead to the following issues: - DataSense does not correctly expose the message metadata defined in the WSDL. - In the Web Service Consumer Connector configuration screen, the **Operations** field does not show any web service operation names for the connector to invoke: ![Web Service Consumer Connector Operations field shows empty](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/wsc-troubleshoot-1.png) Figure 2. Web Service Consumer Connector Operations field - In the Web Service Consumer Connector global element configuration, the **Port** and **Address** fields are not automatically filled when a WSDL location is provided. ![In the Web Service Consumer Connector global element window](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/wsc-troubleshoot-2.png) Figure 3. Web Service Consumer Connector Global Element To resolve these issues: - Check the integrity of your WSDL by using your preferred online or desktop viewer applications. Because every parsing error during the configuration is not shown during design-time, implementing an external application helps detect them. - If you do not add the WSDL as a resource in the application’s **src/main/resources** folder in Studio, check for a correct connection to the server hosting the WSDL. Sometimes you need to add custom HTTP settings, such as OAuth settings or user/password settings, to access an HTTP server in an HTTP security layer. See [Setting a Custom HTTP Transport Configuration.](https://docs.mulesoft.com/web-service-consumer-connector/2.0/web-service-consumer-config-topics) ## Troubleshooting Must Understand Error If your Mule Web Service Consumer app throws the error `WSC:CANNOT_DISPATCH`, and the third-party server returns in the HTTP response the `soap:MustUnderstand` as the exception for the connector caused error, this indicates that the Web Service Consumer connector configuration has the Security setting **Must Understand** field set to the default value of `true`. To avoid this issue, set the **Must understand** field to `false`. The default value of this attribute to `true` is on the connector side, but on the SOAP protocol side the implicit value for the **Must Understand** attribute is `false` when is not present. If you do not explicitly need to use the **Must Understand** attribute for SOAP request, set the value to `false`. ![Web Service Consumer configuration setting Must Understand value to false](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/wsc-must-understand.png) The returned HTTP response might come with a compressed or uncompressed payload body for you to check the `soap:MustUnderstand` exception. If the HTTP response header `Content-Encoding` is `gzip`, it indicates that the payload body is compressed, for example, review the following HTTP response where you can see compressed characters such as �RMo�0 �W���: ```XML HTTP/1.1 500 Internal Server Error X-OPNET-Transaction-Trace: a2_ba571488-537c-4839-94a9-48f3f08fadf3 Content-Encoding: gzip Content-Type: multipart/related; type="application/xop+xml"; boundary="uuid:83b066a2-fb96-4abf-a687-dd178a5b3e29"; start=""; start-info="text/xml" Content-Length: 363 X-Cnection: close Date: Wed, 23 Nov 2022 13:41:25 GMT Connection: close Set-Cookie: dc=dcs; Path=/; Version=1; Secure; Httponly; Max-Age=900 Strict-Transport-Security: max-age=31536000 �???????�RMo�0 �W���N!�c-�M�:i��֞� 1�&(h�_h���v���l?[�iJ��4X,`��t��sHs�pɥ�,C�Og8]�GOZYT��#u]��R+����=Vk�`�f�{��Y��x[+�]�0�(G÷*ӲT�����]$������?"�!ksj� ��9$��x��:ڪ/�t��5Q���+��#!�ɏ@��z��} pH^r��e7�/�T6���r�09�o ٽ�hȂ����g%Y�&Ine�@��}� �����@%q�_�,}�i�E0g���`֘�v�n�|�~K��}�?dJ[֜;k-���`+ף������^�����Y9E?? ``` To decompress the payload body of the response, your Mule app must catch the thrown error using an **Error Handler** component, and then use the Compression Module **Decompress** operation to decompress the response. In Studio, navigate to the **Decompress** operation configuration screen, and set the **Compressed** field to the following expression to read compressed payload and catch the exception: `error.exception.errorMessage.typedAttributes.value.headers.` ![Compressed field set with expression value](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/wsc-decompress.png) Subsequently, you can use a **Logger** component in your Mule app to log the entire payload body with the exception, for example, the following logs show the decompressed payload SOAP body with `soap:MustUnderstand`: ```XML INFO 2022-11-23 14:57:05,247 [[MuleRuntime].uber.05: [ri-uhip-integration-esb-1095brequesttransmitterservice2_11-02-20221].BulkRequestTransmitter:\soapkit-config.BLOCKING @3f46eb07] [processor: BulkRequestTransmitter:\soapkit-config/processors/4/errorHandler/0/processors/2; event: 58ed0ad0-6b57-11ed-b9ce-147ddaa4cf6c] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: --uuid:223e386d-3093-4df4-b5f9-9cb3b9a493a2 Content-Type: application/xop+xml; charset=UTF-8; type="text/xml" Content-Transfer-Encoding: binary Content-ID: soap:MustUnderstandMustUnderstand headers: [{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security] are not understood. --uuid:223e386d-3093-4df4-b5f9-9cb3b9a493a2-- ``` ## Troubleshooting Systems Properties - `mule.soap.maxAttributeSize` (default value = 524288) The XML parser library has a value limit for the `mule.soap.maxAttributeSize` system property that specifies maximum allowed length of attribute values, in characters. The limit protects against possible Denial-of-Service (DoS) attacks, wherein XML-based web services may be attacked by specifically crafted documents that could cause processing problems by excessive memory or computing power usage. The default value is 524288 characters and it is a reasonable default value for normal usage. You can change it to a higher value if input documents can legitimately exceed the default limit, or to a lower value if specific attacks are observed or the system has a lower resource allocation. One signal to change the value limit is when the exception `javax.xml.stream.XMLStreamException: Maximum attribute size limit (524288) exceeded` occurs when processing legitimate documents. To change this value, you have to set the `mule.soap.maxAttributeSize` system property with the accurate number according to your needs. Refer to the Knowledge article [How can I set Mule and Java system properties at startup?](https://help.salesforce.com/s/articleView?id=001115098&type=1)). The maximum value allowed is 2147483647 ([Integer.MAX\_VALUE](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html#MAX_VALUE) in Java). If you set 0 or if you don’t set the property, the connector takes the default value. ## No Content-Type Boundled in the Message In Web Service Consumer Connector 1.10.0 and earlier, you might see the `No Content-Type boundled in the message` error. In Web Service Consumer Connector 1.10.1 and later, the `No Content-Type boundled in the message` error is not thrown if the Content-Type header is missing in the response when the status code is not `200`. For more information, refer to the [SOAP specification](https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383529) and [HTTP Response Headers Fields](https://www.w3.org/TR/soap12-part2/#http-respbindprocess). ## Understand Common Throws Here is a list of common throw messages and how to interpret them. - WSC:SOAP\_FAULT Error matching the SOAP response with the format provided by the WSDL. Every CXF SOAP fault error is wrapped in a \`WSC:SOAP\_FAULT\`. - WSC:BAD\_REQUEST The Web Service Consumer Connector operation does not exist in the WSDL. The request body is not a valid XML. - WSC:INVALID\_WSDL The WSDL is poorly formatted. - WSC:EMPTY\_RESPONSE Occurs when mandatory fields are missing from the response (Illegal Empty Response). ## See Also - [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/2.0/web-service-consumer-reference) - [Salesforce Help](https://help.salesforce.com) - [Known Issues](https://help.salesforce.com/s/issues) --- product: Web Service Consumer Connector version: 2.1 --- # Troubleshooting Web Service Consumer Connector > For the full documentation index, see: https://docs.mulesoft.com/llms.txt To troubleshoot Anypoint Connector for Web Service Consumer (Web Service Consumer Connector), become familiar with the information about enabling wire logging, troubleshooting access attachments, troubleshooting design-time WSDL issues, and interpreting commonly thrown messages. ## Enable Wire Logging To begin troubleshooting Web Service Consumer Connector, look at the transport request and response on the Web Service Consumer. If you are using the underlying HTTP transport, you can enable wire logging to see the exact HTTP message, the transmission headers, and the response status. To enable wire logging: 1. Access Anypoint Studio and navigate to the **Package Explorer** view. 2. Open your application’s project name. 3. Open the `src/main/resources` path folder. 4. Open the `log4j2.xml` file inside the folder. 5. If the following line is already in the `log4j2.xml` file, uncomment it to enable it; otherwise, add it: ```xml ``` 6. Save your changes. 7. Click the project name in **Package Explorer** and then click **Run** > **Run As** > **Mule Application**. 8. Navigate to the **Console** view to read the HTTP messages in the logger: ```plain-text POST /essentials/delta HTTP/1.1 soapaction: Host: ilt.mulesoft-training.com User-Agent: AHC/1.0 Connection: keep-alive Accept: */* Content-Type: text/xml; charset=UTF-8 Transfer-Encoding: chunked b1 DEBUG 2021-04-06 15:04:23,058 [[wsc-base].wsc-dispatcher.11 SelectorRunner] [processor: ; event: ] org.mule.service.http.impl.service.HttpMessageLogger.wsc-dispatcher: REQUESTER 0 DEBUG 2021-04-06 15:04:23,319 [[wsc-base].wsc-dispatcher.11 SelectorRunner] [processor: ; event: ] org.mule.service.http.impl.service.HttpMessageLogger.wsc-dispatcher: REQUESTER HTTP/1.1 200 Date: Tue, 06 Apr 2021 18:04:23 GMT Content-Type: text/xml; charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive MULE_ENCODING: UTF-8 Strict-Transport-Security: max-age=31536000; includeSubdomains; X-Content-Type-Options: 1 X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block bfe ... ``` ## Troubleshoot Access Attachments Some servers respond to requests by sending MTOM (Message Transmission Optimization Mechanism) messages. These messages separate their data into parts, which enables different types of content data to coexist in the same HTTP message. MTOM is in charge of sending binary data in a separate part and referencing that part from the corresponding field within the SOAP envelope. Web Service Consumer users interact with these messages (multipart) only with the MTOM configuration. Refer to the following documentation for further information about MTOM: - [RFC2387 - The MIME Multipart/Related Content-type](https://www.ietf.org/rfc/rfc2387.txt) - [XML-binary Optimized Packaging (XOP) W3C Recommendation](https://www.w3.org/TR/2005/REC-xop10-20050125/) - [SOAP Message Transmission Optimization Mechanism (MTOM) W3C Recommendation](https://www.w3.org/TR/soap12-mtom/) Beginning with version 1.6.4, Web Service Consumer Connector enables you to configure MTOM for request messages that also automatically manage MTOM responses, regardless of the MTOM setting in the Web Service Consumer global configuration. Incoming messages with MTOM are treated as MTOM-enabled, regardless of whether MTOM is configured in the Web Service Consumer global configuration. The following example shows the Web Service Consumer Connector global configuration with MTOM enabled: ![Web Service Consumer global element configuration with MTOM field set to TRUE](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/wsc-troubleshoot-3.png) Figure 1. Web Service Consumer Connector Global Element In the XML editor, the `` and `mtomEnabled` configurations look like this: ```xml ``` Depending on the server side multipart setting, the server might send some binary data as a Base64-encoded text field or as a referenced binary part in the MIME message. To troubleshoot how to access the binary data: - If the server sends the binary data as Base64-encoded text field, you must access this field as part of the message. Base64 decoding is automatically performed by Web Service Consumer. - If the server sends the binary data as a referenced binary part, you must access this field as an attachment. The following example shows an image sent as an attachment with MTOM by a web service server. You use DataWeave to access and transform the image into JSON. In this case, Base64 encoding is required: ```DataWeave import * from dw::core::Strings import dw::core::Binaries output application/json ns nam http://mynamespace.com --- { ... "image": Binaries::toBase64(payload.attachments[0]), ... } ``` ## Troubleshoot Design Time WSDL Issues Errors related to incorrect WSDL recognition, acquisition, or parsing sometimes lead to the following issues: - DataSense does not correctly expose the message metadata defined in the WSDL. - In the Web Service Consumer Connector configuration screen, the **Operations** field does not show any web service operation names for the connector to invoke: ![Web Service Consumer Connector Operations field shows empty](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/wsc-troubleshoot-1.png) Figure 2. Web Service Consumer Connector Operations field - In the Web Service Consumer Connector global element configuration, the **Port** and **Address** fields are not automatically filled when a WSDL location is provided. ![In the Web Service Consumer Connector global element window](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/wsc-troubleshoot-2.png) Figure 3. Web Service Consumer Connector Global Element To resolve these issues: - Check the integrity of your WSDL by using your preferred online or desktop viewer applications. Because every parsing error during the configuration is not shown during design-time, implementing an external application helps detect them. - If you do not add the WSDL as a resource in the application’s **src/main/resources** folder in Studio, check for a correct connection to the server hosting the WSDL. Sometimes you need to add custom HTTP settings, such as OAuth settings or user/password settings, to access an HTTP server in an HTTP security layer. See [Setting a Custom HTTP Transport Configuration.](https://docs.mulesoft.com/web-service-consumer-connector/2.1/web-service-consumer-config-topics) ## Troubleshooting Must Understand Error If your Mule Web Service Consumer app throws the error `WSC:CANNOT_DISPATCH`, and the third-party server returns in the HTTP response the `soap:MustUnderstand` as the exception for the connector caused error, this indicates that the Web Service Consumer connector configuration has the Security setting **Must Understand** field set to the default value of `true`. To avoid this issue, set the **Must understand** field to `false`. The default value of this attribute to `true` is on the connector side, but on the SOAP protocol side the implicit value for the **Must Understand** attribute is `false` when is not present. If you do not explicitly need to use the **Must Understand** attribute for SOAP request, set the value to `false`. ![Web Service Consumer configuration setting Must Understand value to false](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/wsc-must-understand.png) The returned HTTP response might come with a compressed or uncompressed payload body for you to check the `soap:MustUnderstand` exception. If the HTTP response header `Content-Encoding` is `gzip`, it indicates that the payload body is compressed, for example, review the following HTTP response where you can see compressed characters such as �RMo�0 �W���: ```XML HTTP/1.1 500 Internal Server Error X-OPNET-Transaction-Trace: a2_ba571488-537c-4839-94a9-48f3f08fadf3 Content-Encoding: gzip Content-Type: multipart/related; type="application/xop+xml"; boundary="uuid:83b066a2-fb96-4abf-a687-dd178a5b3e29"; start=""; start-info="text/xml" Content-Length: 363 X-Cnection: close Date: Wed, 23 Nov 2022 13:41:25 GMT Connection: close Set-Cookie: dc=dcs; Path=/; Version=1; Secure; Httponly; Max-Age=900 Strict-Transport-Security: max-age=31536000 �???????�RMo�0 �W���N!�c-�M�:i��֞� 1�&(h�_h���v���l?[�iJ��4X,`��t��sHs�pɥ�,C�Og8]�GOZYT��#u]��R+����=Vk�`�f�{��Y��x[+�]�0�(G÷*ӲT�����]$������?"�!ksj� ��9$��x��:ڪ/�t��5Q���+��#!�ɏ@��z��} pH^r��e7�/�T6���r�09�o ٽ�hȂ����g%Y�&Ine�@��}� �����@%q�_�,}�i�E0g���`֘�v�n�|�~K��}�?dJ[֜;k-���`+ף������^�����Y9E?? ``` To decompress the payload body of the response, your Mule app must catch the thrown error using an **Error Handler** component, and then use the Compression Module **Decompress** operation to decompress the response. In Studio, navigate to the **Decompress** operation configuration screen, and set the **Compressed** field to the following expression to read compressed payload and catch the exception: `error.exception.errorMessage.typedAttributes.value.headers.` ![Compressed field set with expression value](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/wsc-decompress.png) Subsequently, you can use a **Logger** component in your Mule app to log the entire payload body with the exception, for example, the following logs show the decompressed payload SOAP body with `soap:MustUnderstand`: ```XML INFO 2022-11-23 14:57:05,247 [[MuleRuntime].uber.05: [ri-uhip-integration-esb-1095brequesttransmitterservice2_11-02-20221].BulkRequestTransmitter:\soapkit-config.BLOCKING @3f46eb07] [processor: BulkRequestTransmitter:\soapkit-config/processors/4/errorHandler/0/processors/2; event: 58ed0ad0-6b57-11ed-b9ce-147ddaa4cf6c] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: --uuid:223e386d-3093-4df4-b5f9-9cb3b9a493a2 Content-Type: application/xop+xml; charset=UTF-8; type="text/xml" Content-Transfer-Encoding: binary Content-ID: soap:MustUnderstandMustUnderstand headers: [{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security] are not understood. --uuid:223e386d-3093-4df4-b5f9-9cb3b9a493a2-- ``` ## Troubleshooting Systems Properties - `mule.soap.maxAttributeSize` (default value = 524288) The XML parser library has a value limit for the `mule.soap.maxAttributeSize` system property that specifies maximum allowed length of attribute values, in characters. The limit protects against possible Denial-of-Service (DoS) attacks, wherein XML-based web services may be attacked by specifically crafted documents that could cause processing problems by excessive memory or computing power usage. The default value is 524288 characters and it is a reasonable default value for normal usage. You can change it to a higher value if input documents can legitimately exceed the default limit, or to a lower value if specific attacks are observed or the system has a lower resource allocation. One signal to change the value limit is when the exception `javax.xml.stream.XMLStreamException: Maximum attribute size limit (524288) exceeded` occurs when processing legitimate documents. To change this value, you have to set the `mule.soap.maxAttributeSize` system property with the accurate number according to your needs. Refer to the Knowledge article [How can I set Mule and Java system properties at startup?](https://help.salesforce.com/s/articleView?id=001115098&type=1)). The maximum value allowed is 2147483647 ([Integer.MAX\_VALUE](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html#MAX_VALUE) in Java). If you set 0 or if you don’t set the property, the connector takes the default value. ## No Content-Type Boundled in the Message In Web Service Consumer Connector 1.10.0 and earlier, you might see the `No Content-Type boundled in the message` error. In Web Service Consumer Connector 1.10.1 and later, the `No Content-Type boundled in the message` error is not thrown if the Content-Type header is missing in the response when the status code is not `200`. For more information, refer to the [SOAP specification](https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383529) and [HTTP Response Headers Fields](https://www.w3.org/TR/soap12-part2/#http-respbindprocess). ## Understand Common Throws Here is a list of common throw messages and how to interpret them. - WSC:SOAP\_FAULT Error matching the SOAP response with the format provided by the WSDL. Every CXF SOAP fault error is wrapped in a \`WSC:SOAP\_FAULT\`. - WSC:BAD\_REQUEST The Web Service Consumer Connector operation does not exist in the WSDL. The request body is not a valid XML. - WSC:INVALID\_WSDL The WSDL is poorly formatted. - WSC:EMPTY\_RESPONSE Occurs when mandatory fields are missing from the response (Illegal Empty Response). ## See Also - [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/2.1/web-service-consumer-reference) - [Salesforce Help](https://help.salesforce.com) - [Known Issues](https://help.salesforce.com/s/issues) --- product: Web Service Consumer Connector version: 2.2 is-latest-version: true --- # Troubleshooting Web Service Consumer Connector > For the full documentation index, see: https://docs.mulesoft.com/llms.txt To troubleshoot Anypoint Connector for Web Service Consumer (Web Service Consumer Connector), become familiar with the information about enabling wire logging, troubleshooting access attachments, troubleshooting design-time WSDL issues, and interpreting commonly thrown messages. ## Enable Wire Logging To begin troubleshooting Web Service Consumer Connector, look at the transport request and response on the Web Service Consumer. If you are using the underlying HTTP transport, you can enable wire logging to see the exact HTTP message, the transmission headers, and the response status. To enable wire logging: 1. Access Anypoint Studio and navigate to the **Package Explorer** view. 2. Open your application’s project name. 3. Open the `src/main/resources` path folder. 4. Open the `log4j2.xml` file inside the folder. 5. If the following line is already in the `log4j2.xml` file, uncomment it to enable it; otherwise, add it: ```xml ``` 6. Save your changes. 7. Click the project name in **Package Explorer** and then click **Run** > **Run As** > **Mule Application**. 8. Navigate to the **Console** view to read the HTTP messages in the logger: ```plain-text POST /essentials/delta HTTP/1.1 soapaction: Host: ilt.mulesoft-training.com User-Agent: AHC/1.0 Connection: keep-alive Accept: */* Content-Type: text/xml; charset=UTF-8 Transfer-Encoding: chunked b1 DEBUG 2021-04-06 15:04:23,058 [[wsc-base].wsc-dispatcher.11 SelectorRunner] [processor: ; event: ] org.mule.service.http.impl.service.HttpMessageLogger.wsc-dispatcher: REQUESTER 0 DEBUG 2021-04-06 15:04:23,319 [[wsc-base].wsc-dispatcher.11 SelectorRunner] [processor: ; event: ] org.mule.service.http.impl.service.HttpMessageLogger.wsc-dispatcher: REQUESTER HTTP/1.1 200 Date: Tue, 06 Apr 2021 18:04:23 GMT Content-Type: text/xml; charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive MULE_ENCODING: UTF-8 Strict-Transport-Security: max-age=31536000; includeSubdomains; X-Content-Type-Options: 1 X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block bfe ... ``` ## Troubleshoot Access Attachments Some servers respond to requests by sending MTOM (Message Transmission Optimization Mechanism) messages. These messages separate their data into parts, which enables different types of content data to coexist in the same HTTP message. MTOM is in charge of sending binary data in a separate part and referencing that part from the corresponding field within the SOAP envelope. Web Service Consumer users interact with these messages (multipart) only with the MTOM configuration. Refer to the following documentation for further information about MTOM: - [RFC2387 - The MIME Multipart/Related Content-type](https://www.ietf.org/rfc/rfc2387.txt) - [XML-binary Optimized Packaging (XOP) W3C Recommendation](https://www.w3.org/TR/2005/REC-xop10-20050125/) - [SOAP Message Transmission Optimization Mechanism (MTOM) W3C Recommendation](https://www.w3.org/TR/soap12-mtom/) Beginning with version 1.6.4, Web Service Consumer Connector enables you to configure MTOM for request messages that also automatically manage MTOM responses, regardless of the MTOM setting in the Web Service Consumer global configuration. Incoming messages with MTOM are treated as MTOM-enabled, regardless of whether MTOM is configured in the Web Service Consumer global configuration. The following example shows the Web Service Consumer Connector global configuration with MTOM enabled: ![Web Service Consumer global element configuration with MTOM field set to TRUE](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/wsc-troubleshoot-3.png) Figure 1. Web Service Consumer Connector Global Element In the XML editor, the `` and `mtomEnabled` configurations look like this: ```xml ``` Depending on the server side multipart setting, the server might send some binary data as a Base64-encoded text field or as a referenced binary part in the MIME message. To troubleshoot how to access the binary data: - If the server sends the binary data as Base64-encoded text field, you must access this field as part of the message. Base64 decoding is automatically performed by Web Service Consumer. - If the server sends the binary data as a referenced binary part, you must access this field as an attachment. The following example shows an image sent as an attachment with MTOM by a web service server. You use DataWeave to access and transform the image into JSON. In this case, Base64 encoding is required: ```DataWeave import * from dw::core::Strings import dw::core::Binaries output application/json ns nam http://mynamespace.com --- { ... "image": Binaries::toBase64(payload.attachments[0]), ... } ``` ## Troubleshoot Design Time WSDL Issues Errors related to incorrect WSDL recognition, acquisition, or parsing sometimes lead to the following issues: - DataSense does not correctly expose the message metadata defined in the WSDL. - In the Web Service Consumer Connector configuration screen, the **Operations** field does not show any web service operation names for the connector to invoke: ![Web Service Consumer Connector Operations field shows empty](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/wsc-troubleshoot-1.png) Figure 2. Web Service Consumer Connector Operations field - In the Web Service Consumer Connector global element configuration, the **Port** and **Address** fields are not automatically filled when a WSDL location is provided. ![In the Web Service Consumer Connector global element window](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/wsc-troubleshoot-2.png) Figure 3. Web Service Consumer Connector Global Element To resolve these issues: - Check the integrity of your WSDL by using your preferred online or desktop viewer applications. Because every parsing error during the configuration is not shown during design-time, implementing an external application helps detect them. - If you do not add the WSDL as a resource in the application’s **src/main/resources** folder in Studio, check for a correct connection to the server hosting the WSDL. Sometimes you need to add custom HTTP settings, such as OAuth settings or user/password settings, to access an HTTP server in an HTTP security layer. See [Setting a Custom HTTP Transport Configuration.](https://docs.mulesoft.com/web-service-consumer-connector/latest/web-service-consumer-config-topics) ## Troubleshooting Must Understand Error If your Mule Web Service Consumer app throws the error `WSC:CANNOT_DISPATCH`, and the third-party server returns in the HTTP response the `soap:MustUnderstand` as the exception for the connector caused error, this indicates that the Web Service Consumer connector configuration has the Security setting **Must Understand** field set to the default value of `true`. To avoid this issue, set the **Must understand** field to `false`. The default value of this attribute to `true` is on the connector side, but on the SOAP protocol side the implicit value for the **Must Understand** attribute is `false` when is not present. If you do not explicitly need to use the **Must Understand** attribute for SOAP request, set the value to `false`. ![Web Service Consumer configuration setting Must Understand value to false](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/wsc-must-understand.png) The returned HTTP response might come with a compressed or uncompressed payload body for you to check the `soap:MustUnderstand` exception. If the HTTP response header `Content-Encoding` is `gzip`, it indicates that the payload body is compressed, for example, review the following HTTP response where you can see compressed characters such as �RMo�0 �W���: ```XML HTTP/1.1 500 Internal Server Error X-OPNET-Transaction-Trace: a2_ba571488-537c-4839-94a9-48f3f08fadf3 Content-Encoding: gzip Content-Type: multipart/related; type="application/xop+xml"; boundary="uuid:83b066a2-fb96-4abf-a687-dd178a5b3e29"; start=""; start-info="text/xml" Content-Length: 363 X-Cnection: close Date: Wed, 23 Nov 2022 13:41:25 GMT Connection: close Set-Cookie: dc=dcs; Path=/; Version=1; Secure; Httponly; Max-Age=900 Strict-Transport-Security: max-age=31536000 �???????�RMo�0 �W���N!�c-�M�:i��֞� 1�&(h�_h���v���l?[�iJ��4X,`��t��sHs�pɥ�,C�Og8]�GOZYT��#u]��R+����=Vk�`�f�{��Y��x[+�]�0�(G÷*ӲT�����]$������?"�!ksj� ��9$��x��:ڪ/�t��5Q���+��#!�ɏ@��z��} pH^r��e7�/�T6���r�09�o ٽ�hȂ����g%Y�&Ine�@��}� �����@%q�_�,}�i�E0g���`֘�v�n�|�~K��}�?dJ[֜;k-���`+ף������^�����Y9E?? ``` To decompress the payload body of the response, your Mule app must catch the thrown error using an **Error Handler** component, and then use the Compression Module **Decompress** operation to decompress the response. In Studio, navigate to the **Decompress** operation configuration screen, and set the **Compressed** field to the following expression to read compressed payload and catch the exception: `error.exception.errorMessage.typedAttributes.value.headers.` ![Compressed field set with expression value](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/wsc-decompress.png) Subsequently, you can use a **Logger** component in your Mule app to log the entire payload body with the exception, for example, the following logs show the decompressed payload SOAP body with `soap:MustUnderstand`: ```XML INFO 2022-11-23 14:57:05,247 [[MuleRuntime].uber.05: [ri-uhip-integration-esb-1095brequesttransmitterservice2_11-02-20221].BulkRequestTransmitter:\soapkit-config.BLOCKING @3f46eb07] [processor: BulkRequestTransmitter:\soapkit-config/processors/4/errorHandler/0/processors/2; event: 58ed0ad0-6b57-11ed-b9ce-147ddaa4cf6c] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: --uuid:223e386d-3093-4df4-b5f9-9cb3b9a493a2 Content-Type: application/xop+xml; charset=UTF-8; type="text/xml" Content-Transfer-Encoding: binary Content-ID: soap:MustUnderstandMustUnderstand headers: [{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security] are not understood. --uuid:223e386d-3093-4df4-b5f9-9cb3b9a493a2-- ``` ## Troubleshooting Systems Properties - `mule.soap.maxAttributeSize` (default value = 524288) The XML parser library has a value limit for the `mule.soap.maxAttributeSize` system property that specifies maximum allowed length of attribute values, in characters. The limit protects against possible Denial-of-Service (DoS) attacks, wherein XML-based web services may be attacked by specifically crafted documents that could cause processing problems by excessive memory or computing power usage. The default value is 524288 characters and it is a reasonable default value for normal usage. You can change it to a higher value if input documents can legitimately exceed the default limit, or to a lower value if specific attacks are observed or the system has a lower resource allocation. One signal to change the value limit is when the exception `javax.xml.stream.XMLStreamException: Maximum attribute size limit (524288) exceeded` occurs when processing legitimate documents. To change this value, you have to set the `mule.soap.maxAttributeSize` system property with the accurate number according to your needs. Refer to the Knowledge article [How can I set Mule and Java system properties at startup?](https://help.salesforce.com/s/articleView?id=001115098&type=1)). The maximum value allowed is 2147483647 ([Integer.MAX\_VALUE](https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html#MAX_VALUE) in Java). If you set 0 or if you don’t set the property, the connector takes the default value. ### Re-enable DOCTYPE and External Entity Processing in XML Parsing In Web Service Consumer Connector 2.2 and later, XML parsing is hardened by default to mitigate XML External Entity (XXE) attacks. DOCTYPE declarations and external general or parameter entities are disabled when parsing SOAP messages. If your integration requires DOCTYPE declarations or external entity processing in SOAP messages, you can re-enable these XML features by setting this system property: `mule.soap.xml.disableXxeProtection` (default value = `false`) Setting this property to `true` re-enables DOCTYPE and external entity processing. This isn’t recommended because doing so reintroduces exposure to XXE-based attacks. The runtime logs a warning when the property is active. To set this property, refer to [How can I set Mule and Java system properties at startup?](https://help.salesforce.com/s/articleView?id=001115098&type=1). ## No Content-Type Boundled in the Message In Web Service Consumer Connector 1.10.0 and earlier, you might see the `No Content-Type boundled in the message` error. In Web Service Consumer Connector 1.10.1 and later, the `No Content-Type boundled in the message` error is not thrown if the Content-Type header is missing in the response when the status code is not `200`. For more information, refer to the [SOAP specification](https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383529) and [HTTP Response Headers Fields](https://www.w3.org/TR/soap12-part2/#http-respbindprocess). ## Understand Common Throws Here is a list of common throw messages and how to interpret them. - WSC:SOAP\_FAULT Error matching the SOAP response with the format provided by the WSDL. Every CXF SOAP fault error is wrapped in a \`WSC:SOAP\_FAULT\`. - WSC:BAD\_REQUEST The Web Service Consumer Connector operation does not exist in the WSDL. The request body is not a valid XML. - WSC:INVALID\_WSDL The WSDL is poorly formatted. - WSC:EMPTY\_RESPONSE Occurs when mandatory fields are missing from the response (Illegal Empty Response). ## See Also - [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/latest/web-service-consumer-reference) - [Salesforce Help](https://help.salesforce.com) - [Known Issues](https://help.salesforce.com/s/issues) --- product: Web Service Consumer Connector version: 2.0 --- # Upgrading and Migrating Web Service Consumer Connector to Version 2.0 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Upgrade Web Service Consumer Connector to version 2.x. ## Supported Upgrade Paths
From VersionTo Version

1.x

2.x

## Changes in This Release Web Service Consumer Connector 2.0 includes these changes. - Web Service Consumer Connector (and its dependencies) are now compilable and compatible only with Java 17. - To align with modern development practices and ensure continued compatibility with secure and supported libraries, Web Service Consumer Connector is upgraded from Spring 5.x to Spring 6.x. ## Upgrade Prerequisites Before you perform the upgrade, you must create a backup of your files, data, and configurations in case you need to restore them. ## Upgrade Steps Follow these steps to perform the upgrade: 1. In Anypoint Studio, right-click the project and select **Manage Dependencies** > **Manage Modules**. 2. Select `Web Service Consumer Connector - Mule 4` and click **Update version**. 3. Click **Apply and Close**. 4. Verify that the Web Service Consumer Connector dependency version is `2.0.0` in the `pom.xml` file in the Mule project. Alternatively, you can manually update the Web Service Consumer Connector dependency version in the `pom.xml` file in the Mule project, or simply add the updated connector to the project. ### Verify the Upgrade After you upgrade the connector, follow these steps to verify the upgrade: 1. In Studio, verify that there are no errors in the **Problems** or **Console** views. 2. Verify that there are no problems in the project `pom.xml` file. 3. Test the connection to verify that the operations work. ## Troubleshoot If there are problems with caching the parameters and caching the metadata, try restarting Anypoint Studio. ### Revert the Upgrade If it is necessary to revert to the previous version of Web Service Consumer Connector, change the Web Service Consumer Connector dependency version `2.0.0` in the project’s `pom.xml` to the previous version. You must update the project’s `pom.xml` in Anypoint Studio. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/2.0/web-service-consumer-reference) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 2.1 --- # Upgrading and Migrating Web Service Consumer Connector to Version 2.1 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Upgrade Web Service Consumer Connector to version 2.x. ## Supported Upgrade Paths
From VersionTo Version

1.x

2.x

## Changes in This Release Web Service Consumer Connector 2.0 includes these changes. - Web Service Consumer Connector (and its dependencies) are now compilable and compatible only with Java 17. - To align with modern development practices and ensure continued compatibility with secure and supported libraries, Web Service Consumer Connector is upgraded from Spring 5.x to Spring 6.x. ## Upgrade Prerequisites Before you perform the upgrade, you must create a backup of your files, data, and configurations in case you need to restore them. ## Upgrade Steps Follow these steps to perform the upgrade: 1. In Anypoint Studio, right-click the project and select **Manage Dependencies** > **Manage Modules**. 2. Select `Web Service Consumer Connector - Mule 4` and click **Update version**. 3. Click **Apply and Close**. 4. Verify that the Web Service Consumer Connector dependency version is `2.0.0` in the `pom.xml` file in the Mule project. Alternatively, you can manually update the Web Service Consumer Connector dependency version in the `pom.xml` file in the Mule project, or simply add the updated connector to the project. ### Verify the Upgrade After you upgrade the connector, follow these steps to verify the upgrade: 1. In Studio, verify that there are no errors in the **Problems** or **Console** views. 2. Verify that there are no problems in the project `pom.xml` file. 3. Test the connection to verify that the operations work. ## Troubleshoot If there are problems with caching the parameters and caching the metadata, try restarting Anypoint Studio. ### Revert the Upgrade If it is necessary to revert to the previous version of Web Service Consumer Connector, change the Web Service Consumer Connector dependency version `2.0.0` in the project’s `pom.xml` to the previous version. You must update the project’s `pom.xml` in Anypoint Studio. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/2.1/web-service-consumer-reference) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 2.2 is-latest-version: true --- # Upgrading and Migrating Web Service Consumer Connector to Version 2.2 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Upgrade Web Service Consumer Connector to version 2.x. ## Supported Upgrade Paths
From VersionTo Version

1.x

2.x

## Changes in 2.2 - New `WSC:SECURITY` error type usable in `` blocks. Operations that fail because of a security-related cause now raise this error type. - The `soap-engine` dependency is upgraded to version 2.4.0 with security improvements. XML parsing is hardened by default; if your integration legitimately requires DOCTYPE declarations or external entities in SOAP messages, see [Troubleshooting](https://docs.mulesoft.com/web-service-consumer-connector/latest/web-service-consumer-troubleshooting) for the system property to re-enable them. ## Changes in 2.1 - The WSS Sign Configuration Adapter type now includes the new **Expand XOP Include** field to define how XOP (XML-binary Optimized Packaging) includes are expanded inline within the SOAP message body. ## Changes in 2.0 Web Service Consumer Connector 2.0 includes these changes. - Web Service Consumer Connector (and its dependencies) are now compilable and compatible only with Java 17. - To align with modern development practices and ensure continued compatibility with secure and supported libraries, Web Service Consumer Connector is upgraded from Spring 5.x to Spring 6.x. ## Upgrade Prerequisites Before you perform the upgrade, you must create a backup of your files, data, and configurations in case you need to restore them. ## Upgrade Steps Follow these steps to perform the upgrade: 1. In Anypoint Studio, right-click the project and select **Manage Dependencies** > **Manage Modules**. 2. Select `Web Service Consumer Connector - Mule 4` and click **Update version**. 3. Click **Apply and Close**. 4. Verify that the Web Service Consumer Connector dependency version is `2.0.0` in the `pom.xml` file in the Mule project. Alternatively, you can manually update the Web Service Consumer Connector dependency version in the `pom.xml` file in the Mule project, or simply add the updated connector to the project. ### Verify the Upgrade After you upgrade the connector, follow these steps to verify the upgrade: 1. In Studio, verify that there are no errors in the **Problems** or **Console** views. 2. Verify that there are no problems in the project `pom.xml` file. 3. Test the connection to verify that the operations work. ## Troubleshoot If there are problems with caching the parameters and caching the metadata, try restarting Anypoint Studio. ### Revert the Upgrade If it is necessary to revert to the previous version of Web Service Consumer Connector, change the Web Service Consumer Connector dependency version `2.0.0` in the project’s `pom.xml` to the previous version. You must update the project’s `pom.xml` in Anypoint Studio. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/latest/web-service-consumer-reference) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 1.11 --- # Using Anypoint Studio to Configure Web Service Consumer 1.11 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and configuration files. To add and configure a connector in Studio: 1. [Create a Mule project](#create-mule-project). 2. [Add the connector to your Mule project](#add-connector-to-project). 3. [Configure a source for the connector’s flow](#configure-input-source). 4. [Add a connector operation to the flow](#add-connector-operation). 5. [Configure a global element for the connector](#configure-global-element). 6. [Configure the Consume operation](#configure-other-fields). When you run the connector, you can view the app log to check for problems, as described in [View the App Log](#view-app-log). If you are new to configuring connectors in Studio, see [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio). If, after reading this topic, you need additional information about the connector fields, see the [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/1.11/web-service-consumer-reference). ## Create a Mule Project In Studio, create a new Mule project in which to add and configure the connector: 1. In Studio, select **File > New > Mule Project**. 2. Enter a name for your Mule project and click **Finish**. ## Add the Connector to Your Mule Project Add Web Service Consumer Connector to your Mule project to automatically populate the XML code with the connector’s namespace and schema location and add the required dependencies to the project’s `pom.xml` file: 1. In the **Mule Palette** view, click **(X) Search in Exchange**. 2. In **Add Dependencies to Project**, type `web service consumer` in the search field. 3. Click **Web Service Consumer** in **Available modules**. 4. Click **Add**. 5. Click **Finish**. Adding a connector to a Mule project in Studio does not make that connector available to other projects in your Studio workspace. ## Configure a Source An input source initiates a flow when a specified condition is met. For example, to configure HTTP **Listener**, follow these steps: 1. In the **Mule Palette** view, select **HTTP** > **Listener**. 2. Drag **Listener** to the Studio canvas. 3. On the **Listener** configuration screen, optionally change the value of the **Display Name** field. 4. Specify a value for the **Path** field. 5. Click the plus sign (**+**) next to the **Connector configuration** field to configure a global element that can be used by all instances of `HTTP Listener` in the app. 6. On the **General** tab, specify connection information. 7. On the **TLS** tab, optionally specify TLS information. 8. On the **Advanced** tab, optionally specify reconnection information, including a reconnection strategy. 9. Click **Test Connection** to confirm that Mule can connect with the specific server. 10. Click **OK**. ## Add a Connector Operation to the Flow When you add a connector operation to your flow, you immediately define a specific operation for that connector to perform. To add the Consume operation to Web Service Consumer Connector, follow these steps: 1. In the **Mule Palette** view, select **Web Service Consumer** and then select the **Consume** operation. 2. Drag the operation onto the Studio canvas to the right of the input source. ![Web Service Consumer Connector Operations](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/web-service-consumer-operation.png) Figure 1. Web Service Consumer Connector Operations ## Configure a Global Element for the Connector When you configure a connector, it’s best to configure a global element that all instances of that connector in the app can use. To consume a SOAP web service operation, you need to create a configuration that points to the service that you want to consume. To configure the global element for Web Service Consumer Connector, follow these steps: 1. Select the name of the connector in the Studio canvas. 2. In the **Basic Settings** section of the **General** tab, click the plus sign (+) next to the **Connector configuration** field to access the global element configuration fields. 3. In the **Connection** section of the **General** tab, configure the following parameters: - **WSDL location** The remote or local WSDL file URL - **Service** The service name - **Port** The port name - **Address** The address of the web server to dispatch requests if the **Service** and **Port** parameters did not automatically provide this value. Note that the **WSDL location**, **Service**, and **Port** parameters are mandatory for the configuration to be valid. The following example shows how to configure the global element to get a list of flights by airline: ![Web Service Consumer Global Element](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/web-service-consumer-global-element.png) Figure 2. Web Service Consumer Global Element In the **Configuration XML** tab, the XML looks like this: ```xml ``` ## Configure Consume Operation After you configure a global element for Web Service Consumer Connector, configure the Consume operation parameters, such as **Operation**, **Message** (**Body, Headers, Attachments**) and so on. Additionally, learn about the output of the Consume operation and metadata attributes used to dispatch messages. ### Parameters The Consume operation has two main parameters: - **Operation** Defines which SOAP operation of the web service to invoke. During the design phase, the parameter defines the input and output types for the Consume operation. The types will change depending on which operation you choose. - **Message** A representation of `SOAP:ENVELOP` composed of three optional parameters: - **Body** The XML body to include in the SOAP message, with all the required parameters, or `null` if no parameters are required - **Headers** The XML headers to include in the SOAP message - **Attachments** The attachments to include in the SOAP request To configure these parameters for the Consume operation, follow these steps: 1. Select the name of the connector in the Studio canvas. 2. In the **General** section of the Consume operation, define **Operation**, and in the **Message** section, define **Body**, **Headers**, and **Attachments** fields: ![Configure Consume Operation](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/web-service-consumer-configure-consume.png) Figure 3. Configure Consume Operation In the **Configuration XML** tab, a basic configuration for the Consume operation looks like this: ```xml #[payload] ``` #### Body Parameter The `body` parameter is the main part of the SOAP message. It accepts embedded DataWeave script values so expects that you can construct the XML request without having a side effect on the message or having to use multiple components to create the request. Some characteristics of the parameter include: - The default value is `#[payload]`, based on the assumption that the incoming payload is the XML entity ready to ship to the service. - If the body is not valid XML, or if the request cannot be created for some reason, you get a `WSC:BAD_REQUEST` error. - If you don’t provide body content, the Web Service Consumer Connector attempts to generate one, and this works only for cases where no XML entity is expected in the body. - Some web services require to append the XML prolog tag into the envelope’s body XML content, which contains the version and encoding information that identifies the document as being XML. The following example shows a DataWeave expression inside the `body` parameter, and how to force the Web Service Consumer Connector to dispatch any payload by enabling the XML prolog option: 1. Select the name of the connector in the Studio canvas. 2. In the **Body** parameter field of the **General** tab, add the DataWeave expression. 3. In the **Message Customization** section of the **Advanced** tab, enable the option **Force XML Prolog into body** like this: ![Configure XML Prolog into Body](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/web-service-consumer-xmlprolog.png) Figure 4. Configure XML Prolog into Body In the **Configuration XML** tab, the XML looks like this: ```xml #[ %dw 2.0 output application/xml ns con http://service.soap.clients.namespace/ --- con#clients: { client: { name: "admin1", lastname: "textpassword1" }, client: { name: "admin2", lastname: "textpassword2" } }] ``` #### Headers Parameter The `headers` parameter contains application-specific information about the SOAP message, such as authentication, payment, and so on. The parameter is an XML entity, that accepts an embedded DataWeave script as its value. The following XML example shows a DataWeave expression inside the `headers` parameter: ```xml #[payload] #[ %dw 2.0 output application/xml ns con http://service.soap.clients.namespace/ --- "headers": { con#user: "admin", con#pass: "textpassword" }] ``` Note that inside the DW script, the root must be `"headers"`, otherwise, the following error returns while running the application: `Invalid input headers XML: It must be an xml with the root tag named \'headers\'`. #### Attachments Parameter The `attachments` parameter enables you to bind attachments to the SOAP message. To create attachments for transport over SOAP, declare a DataWeave script in which each entry represents an attachment and the entry value provides the content of the attachment. The following XML example shows a DataWeave expression inside the `attachments` parameter that declares a new attachment called `clientsJson`. The attachment value content is stored in the `jsonFile` variable. This variable can be set from a `file:read` operation: ```xml #[payload] #[{ clientsJson: vars.jsonFile } ] ``` ### Output The output of the Consume operation represents an incoming SOAP message that contains the same elements that the `Message` parameter has, and you can access each part of it. The following XML example stores: - The content of the body in a `soap.body` variable - The content of the header called `auth` in a `soap.header.auth` variable - The content of an attachment called `json` in a `soap.attachment.json` variable ```xml #[payload] ``` ### Attributes When your app consumes a web service operation, you might be interested not only in the response content but also in the metadata of the underlying transport used to dispatch the messages. For example, when you use HTTP, attributes carry HTTP headers bound to the HTTP request (`content-length`, `status`, and so on). The Web Service Consumer Connector uses Mule message attributes to access this information. ## View the App Log To check for problems, you can view the app log as follows: - If you’re running the app from Anypoint Platform, the output is visible in the Anypoint Studio console window. - If you’re running the app using Mule from the command line, the app log is visible in your OS console. Unless the log file path is customized in the app’s log file (`log4j2.xml`), you can also view the app log in the default location `MULE_HOME/logs/.log`. ## Next Step After you configure a global element and connection information, configure the other fields for the connector. See [Additional Configuration Information](https://docs.mulesoft.com/web-service-consumer-connector/1.11/web-service-consumer-config-topics) for more configuration steps. ## See Also - [How to set SOAP headers in Web Service Consumer in Mule 4](https://help.salesforce.com/s/articleView?id=001114743&type=1) - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [Web Service Consumer Reference](https://docs.mulesoft.com/web-service-consumer-connector/1.11/web-service-consumer-reference) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 1.12 --- # Using Anypoint Studio to Configure Web Service Consumer 1.12 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and configuration files. To add and configure a connector in Studio: 1. [Create a Mule project](#create-mule-project). 2. [Add the connector to your Mule project](#add-connector-to-project). 3. [Configure a source for the connector’s flow](#configure-input-source). 4. [Add a connector operation to the flow](#add-connector-operation). 5. [Configure a global element for the connector](#configure-global-element). 6. [Configure the Consume operation](#configure-other-fields). When you run the connector, you can view the app log to check for problems, as described in [View the App Log](#view-app-log). If you are new to configuring connectors in Studio, see [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio). If, after reading this topic, you need additional information about the connector fields, see the [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/1.12/web-service-consumer-reference). ## Create a Mule Project In Studio, create a new Mule project in which to add and configure the connector: 1. In Studio, select **File > New > Mule Project**. 2. Enter a name for your Mule project and click **Finish**. ## Add the Connector to Your Mule Project Add Web Service Consumer Connector to your Mule project to automatically populate the XML code with the connector’s namespace and schema location and add the required dependencies to the project’s `pom.xml` file: 1. In the **Mule Palette** view, click **(X) Search in Exchange**. 2. In **Add Dependencies to Project**, type `web service consumer` in the search field. 3. Click **Web Service Consumer** in **Available modules**. 4. Click **Add**. 5. Click **Finish**. Adding a connector to a Mule project in Studio does not make that connector available to other projects in your Studio workspace. ## Configure a Source An input source initiates a flow when a specified condition is met. For example, to configure HTTP **Listener**, follow these steps: 1. In the **Mule Palette** view, select **HTTP** > **Listener**. 2. Drag **Listener** to the Studio canvas. 3. On the **Listener** configuration screen, optionally change the value of the **Display Name** field. 4. Specify a value for the **Path** field. 5. Click the plus sign (**+**) next to the **Connector configuration** field to configure a global element that can be used by all instances of `HTTP Listener` in the app. 6. On the **General** tab, specify connection information. 7. On the **TLS** tab, optionally specify TLS information. 8. On the **Advanced** tab, optionally specify reconnection information, including a reconnection strategy. 9. Click **Test Connection** to confirm that Mule can connect with the specific server. 10. Click **OK**. ## Add a Connector Operation to the Flow When you add a connector operation to your flow, you immediately define a specific operation for that connector to perform. To add the Consume operation to Web Service Consumer Connector, follow these steps: 1. In the **Mule Palette** view, select **Web Service Consumer** and then select the **Consume** operation. 2. Drag the operation onto the Studio canvas to the right of the input source. ![Web Service Consumer Connector Operations](/mulesoft/current/en-us/web-service-consumer-connector/1.12/_images/web-service-consumer-operation.png) Figure 1. Web Service Consumer Connector Operations ## Configure a Global Element for the Connector When you configure a connector, it’s best to configure a global element that all instances of that connector in the app can use. To consume a SOAP web service operation, you need to create a configuration that points to the service that you want to consume. To configure the global element for Web Service Consumer Connector, follow these steps: 1. Select the name of the connector in the Studio canvas. 2. In the **Basic Settings** section of the **General** tab, click the plus sign (+) next to the **Connector configuration** field to access the global element configuration fields. 3. In the **Connection** section of the **General** tab, configure the following parameters: - **WSDL location** The remote or local WSDL file URL - **Service** The service name - **Port** The port name - **Address** The address of the web server to dispatch requests if the **Service** and **Port** parameters did not automatically provide this value. Note that the **WSDL location**, **Service**, and **Port** parameters are mandatory for the configuration to be valid. The following example shows how to configure the global element to get a list of flights by airline: ![Web Service Consumer Global Element](/mulesoft/current/en-us/web-service-consumer-connector/1.12/_images/web-service-consumer-global-element.png) Figure 2. Web Service Consumer Global Element In the **Configuration XML** tab, the XML looks like this: ```xml ``` ## Configure Consume Operation After you configure a global element for Web Service Consumer Connector, configure the Consume operation parameters, such as **Operation**, **Message** (**Body, Headers, Attachments**) and so on. Additionally, learn about the output of the Consume operation and metadata attributes used to dispatch messages. ### Parameters The Consume operation has two main parameters: - **Operation** Defines which SOAP operation of the web service to invoke. During the design phase, the parameter defines the input and output types for the Consume operation. The types will change depending on which operation you choose. - **Message** A representation of `SOAP:ENVELOP` composed of three optional parameters: - **Body** The XML body to include in the SOAP message, with all the required parameters, or `null` if no parameters are required - **Headers** The XML headers to include in the SOAP message - **Attachments** The attachments to include in the SOAP request To configure these parameters for the Consume operation, follow these steps: 1. Select the name of the connector in the Studio canvas. 2. In the **General** section of the Consume operation, define **Operation**, and in the **Message** section, define **Body**, **Headers**, and **Attachments** fields: ![Configure Consume Operation](/mulesoft/current/en-us/web-service-consumer-connector/1.12/_images/web-service-consumer-configure-consume.png) Figure 3. Configure Consume Operation In the **Configuration XML** tab, a basic configuration for the Consume operation looks like this: ```xml #[payload] ``` #### Body Parameter The `body` parameter is the main part of the SOAP message. It accepts embedded DataWeave script values so expects that you can construct the XML request without having a side effect on the message or having to use multiple components to create the request. Some characteristics of the parameter include: - The default value is `#[payload]`, based on the assumption that the incoming payload is the XML entity ready to ship to the service. - If the body is not valid XML, or if the request cannot be created for some reason, you get a `WSC:BAD_REQUEST` error. - If you don’t provide body content, the Web Service Consumer Connector attempts to generate one, and this works only for cases where no XML entity is expected in the body. - Some web services require to append the XML prolog tag into the envelope’s body XML content, which contains the version and encoding information that identifies the document as being XML. The following example shows a DataWeave expression inside the `body` parameter, and how to force the Web Service Consumer Connector to dispatch any payload by enabling the XML prolog option: 1. Select the name of the connector in the Studio canvas. 2. In the **Body** parameter field of the **General** tab, add the DataWeave expression. 3. In the **Message Customization** section of the **Advanced** tab, enable the option **Force XML Prolog into body** like this: ![Configure XML Prolog into Body](/mulesoft/current/en-us/web-service-consumer-connector/1.12/_images/web-service-consumer-xmlprolog.png) Figure 4. Configure XML Prolog into Body In the **Configuration XML** tab, the XML looks like this: ```xml #[ %dw 2.0 output application/xml ns con http://service.soap.clients.namespace/ --- con#clients: { client: { name: "admin1", lastname: "textpassword1" }, client: { name: "admin2", lastname: "textpassword2" } }] ``` #### Headers Parameter The `headers` parameter contains application-specific information about the SOAP message, such as authentication, payment, and so on. The parameter is an XML entity, that accepts an embedded DataWeave script as its value. The following XML example shows a DataWeave expression inside the `headers` parameter: ```xml #[payload] #[ %dw 2.0 output application/xml ns con http://service.soap.clients.namespace/ --- "headers": { con#user: "admin", con#pass: "textpassword" }] ``` Note that inside the DW script, the root must be `"headers"`, otherwise, the following error returns while running the application: `Invalid input headers XML: It must be an xml with the root tag named \'headers\'`. #### Attachments Parameter The `attachments` parameter enables you to bind attachments to the SOAP message. To create attachments for transport over SOAP, declare a DataWeave script in which each entry represents an attachment and the entry value provides the content of the attachment. The following XML example shows a DataWeave expression inside the `attachments` parameter that declares a new attachment called `clientsJson`. The attachment value content is stored in the `jsonFile` variable. This variable can be set from a `file:read` operation: ```xml #[payload] #[{ clientsJson: vars.jsonFile } ] ``` ### Output The output of the Consume operation represents an incoming SOAP message that contains the same elements that the `Message` parameter has, and you can access each part of it. The following XML example stores: - The content of the body in a `soap.body` variable - The content of the header called `auth` in a `soap.header.auth` variable - The content of an attachment called `json` in a `soap.attachment.json` variable ```xml #[payload] ``` ### Attributes When your app consumes a web service operation, you might be interested not only in the response content but also in the metadata of the underlying transport used to dispatch the messages. For example, when you use HTTP, attributes carry HTTP headers bound to the HTTP request (`content-length`, `status`, and so on). The Web Service Consumer Connector uses Mule message attributes to access this information. ## View the App Log To check for problems, you can view the app log as follows: - If you’re running the app from Anypoint Platform, the output is visible in the Anypoint Studio console window. - If you’re running the app using Mule from the command line, the app log is visible in your OS console. Unless the log file path is customized in the app’s log file (`log4j2.xml`), you can also view the app log in the default location `MULE_HOME/logs/.log`. ## Next Step After you configure a global element and connection information, configure the other fields for the connector. See [Additional Configuration Information](https://docs.mulesoft.com/web-service-consumer-connector/1.12/web-service-consumer-config-topics) for more configuration steps. ## See Also - [How to set SOAP headers in Web Service Consumer in Mule 4](https://help.salesforce.com/s/articleView?id=001114743&type=1) - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [Web Service Consumer Reference](https://docs.mulesoft.com/web-service-consumer-connector/1.12/web-service-consumer-reference) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 2.0 --- # Using Anypoint Studio to Configure Web Service Consumer 2.0 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and configuration files. To add and configure a connector in Studio: 1. [Create a Mule project](#create-mule-project). 2. [Add the connector to your Mule project](#add-connector-to-project). 3. [Configure a source for the connector’s flow](#configure-input-source). 4. [Add a connector operation to the flow](#add-connector-operation). 5. [Configure a global element for the connector](#configure-global-element). 6. [Configure the Consume operation](#configure-other-fields). When you run the connector, you can view the app log to check for problems, as described in [View the App Log](#view-app-log). If you are new to configuring connectors in Studio, see [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio). If, after reading this topic, you need additional information about the connector fields, see the [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/2.0/web-service-consumer-reference). ## Create a Mule Project In Studio, create a new Mule project in which to add and configure the connector: 1. In Studio, select **File > New > Mule Project**. 2. Enter a name for your Mule project and click **Finish**. ## Add the Connector to Your Mule Project Add Web Service Consumer Connector to your Mule project to automatically populate the XML code with the connector’s namespace and schema location and add the required dependencies to the project’s `pom.xml` file: 1. In the **Mule Palette** view, click **(X) Search in Exchange**. 2. In **Add Dependencies to Project**, type `web service consumer` in the search field. 3. Click **Web Service Consumer** in **Available modules**. 4. Click **Add**. 5. Click **Finish**. Adding a connector to a Mule project in Studio does not make that connector available to other projects in your Studio workspace. ## Configure a Source An input source initiates a flow when a specified condition is met. For example, to configure HTTP **Listener**, follow these steps: 1. In the **Mule Palette** view, select **HTTP** > **Listener**. 2. Drag **Listener** to the Studio canvas. 3. On the **Listener** configuration screen, optionally change the value of the **Display Name** field. 4. Specify a value for the **Path** field. 5. Click the plus sign (**+**) next to the **Connector configuration** field to configure a global element that can be used by all instances of `HTTP Listener` in the app. 6. On the **General** tab, specify connection information. 7. On the **TLS** tab, optionally specify TLS information. 8. On the **Advanced** tab, optionally specify reconnection information, including a reconnection strategy. 9. Click **Test Connection** to confirm that Mule can connect with the specific server. 10. Click **OK**. ## Add a Connector Operation to the Flow When you add a connector operation to your flow, you immediately define a specific operation for that connector to perform. To add the Consume operation to Web Service Consumer Connector, follow these steps: 1. In the **Mule Palette** view, select **Web Service Consumer** and then select the **Consume** operation. 2. Drag the operation onto the Studio canvas to the right of the input source. ![Web Service Consumer Connector Operations](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/web-service-consumer-operation.png) Figure 1. Web Service Consumer Connector Operations ## Configure a Global Element for the Connector When you configure a connector, it’s best to configure a global element that all instances of that connector in the app can use. To consume a SOAP web service operation, you need to create a configuration that points to the service that you want to consume. To configure the global element for Web Service Consumer Connector, follow these steps: 1. Select the name of the connector in the Studio canvas. 2. In the **Basic Settings** section of the **General** tab, click the plus sign (+) next to the **Connector configuration** field to access the global element configuration fields. 3. In the **Connection** section of the **General** tab, configure the following parameters: - **WSDL location** The remote or local WSDL file URL - **Service** The service name - **Port** The port name - **Address** The address of the web server to dispatch requests if the **Service** and **Port** parameters did not automatically provide this value. Note that the **WSDL location**, **Service**, and **Port** parameters are mandatory for the configuration to be valid. The following example shows how to configure the global element to get a list of flights by airline: ![Web Service Consumer Global Element](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/web-service-consumer-global-element.png) Figure 2. Web Service Consumer Global Element In the **Configuration XML** tab, the XML looks like this: ```xml ``` ## Configure Consume Operation After you configure a global element for Web Service Consumer Connector, configure the Consume operation parameters, such as **Operation**, **Message** (**Body, Headers, Attachments**) and so on. Additionally, learn about the output of the Consume operation and metadata attributes used to dispatch messages. ### Parameters The Consume operation has two main parameters: - **Operation** Defines which SOAP operation of the web service to invoke. During the design phase, the parameter defines the input and output types for the Consume operation. The types will change depending on which operation you choose. - **Message** A representation of `SOAP:ENVELOP` composed of three optional parameters: - **Body** The XML body to include in the SOAP message, with all the required parameters, or `null` if no parameters are required - **Headers** The XML headers to include in the SOAP message - **Attachments** The attachments to include in the SOAP request To configure these parameters for the Consume operation, follow these steps: 1. Select the name of the connector in the Studio canvas. 2. In the **General** section of the Consume operation, define **Operation**, and in the **Message** section, define **Body**, **Headers**, and **Attachments** fields: ![Configure Consume Operation](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/web-service-consumer-configure-consume.png) Figure 3. Configure Consume Operation In the **Configuration XML** tab, a basic configuration for the Consume operation looks like this: ```xml #[payload] ``` #### Body Parameter The `body` parameter is the main part of the SOAP message. It accepts embedded DataWeave script values so expects that you can construct the XML request without having a side effect on the message or having to use multiple components to create the request. Some characteristics of the parameter include: - The default value is `#[payload]`, based on the assumption that the incoming payload is the XML entity ready to ship to the service. - If the body is not valid XML, or if the request cannot be created for some reason, you get a `WSC:BAD_REQUEST` error. - If you don’t provide body content, the Web Service Consumer Connector attempts to generate one, and this works only for cases where no XML entity is expected in the body. - Some web services require to append the XML prolog tag into the envelope’s body XML content, which contains the version and encoding information that identifies the document as being XML. The following example shows a DataWeave expression inside the `body` parameter, and how to force the Web Service Consumer Connector to dispatch any payload by enabling the XML prolog option: 1. Select the name of the connector in the Studio canvas. 2. In the **Body** parameter field of the **General** tab, add the DataWeave expression. 3. In the **Message Customization** section of the **Advanced** tab, enable the option **Force XML Prolog into body** like this: ![Configure XML Prolog into Body](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/web-service-consumer-xmlprolog.png) Figure 4. Configure XML Prolog into Body In the **Configuration XML** tab, the XML looks like this: ```xml #[ %dw 2.0 output application/xml ns con http://service.soap.clients.namespace/ --- con#clients: { client: { name: "admin1", lastname: "textpassword1" }, client: { name: "admin2", lastname: "textpassword2" } }] ``` #### Headers Parameter The `headers` parameter contains application-specific information about the SOAP message, such as authentication, payment, and so on. The parameter is an XML entity, that accepts an embedded DataWeave script as its value. The following XML example shows a DataWeave expression inside the `headers` parameter: ```xml #[payload] #[ %dw 2.0 output application/xml ns con http://service.soap.clients.namespace/ --- "headers": { con#user: "admin", con#pass: "textpassword" }] ``` Note that inside the DW script, the root must be `"headers"`, otherwise, the following error returns while running the application: `Invalid input headers XML: It must be an xml with the root tag named \'headers\'`. #### Attachments Parameter The `attachments` parameter enables you to bind attachments to the SOAP message. To create attachments for transport over SOAP, declare a DataWeave script in which each entry represents an attachment and the entry value provides the content of the attachment. The following XML example shows a DataWeave expression inside the `attachments` parameter that declares a new attachment called `clientsJson`. The attachment value content is stored in the `jsonFile` variable. This variable can be set from a `file:read` operation: ```xml #[payload] #[{ clientsJson: vars.jsonFile } ] ``` ### Output The output of the Consume operation represents an incoming SOAP message that contains the same elements that the `Message` parameter has, and you can access each part of it. The following XML example stores: - The content of the body in a `soap.body` variable - The content of the header called `auth` in a `soap.header.auth` variable - The content of an attachment called `json` in a `soap.attachment.json` variable ```xml #[payload] ``` ### Attributes When your app consumes a web service operation, you might be interested not only in the response content but also in the metadata of the underlying transport used to dispatch the messages. For example, when you use HTTP, attributes carry HTTP headers bound to the HTTP request (`content-length`, `status`, and so on). The Web Service Consumer Connector uses Mule message attributes to access this information. ## View the App Log To check for problems, you can view the app log as follows: - If you’re running the app from Anypoint Platform, the output is visible in the Anypoint Studio console window. - If you’re running the app using Mule from the command line, the app log is visible in your OS console. Unless the log file path is customized in the app’s log file (`log4j2.xml`), you can also view the app log in the default location `MULE_HOME/logs/.log`. ## Next Step After you configure a global element and connection information, configure the other fields for the connector. See [Additional Configuration Information](https://docs.mulesoft.com/web-service-consumer-connector/2.0/web-service-consumer-config-topics) for more configuration steps. ## See Also - [How to set SOAP headers in Web Service Consumer in Mule 4](https://help.salesforce.com/s/articleView?id=001114743&type=1) - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [Web Service Consumer Reference](https://docs.mulesoft.com/web-service-consumer-connector/2.0/web-service-consumer-reference) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 2.1 --- # Using Anypoint Studio to Configure Web Service Consumer 2.1 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and configuration files. To add and configure a connector in Studio: 1. [Create a Mule project](#create-mule-project). 2. [Add the connector to your Mule project](#add-connector-to-project). 3. [Configure a source for the connector’s flow](#configure-input-source). 4. [Add a connector operation to the flow](#add-connector-operation). 5. [Configure a global element for the connector](#configure-global-element). 6. [Configure the Consume operation](#configure-other-fields). When you run the connector, you can view the app log to check for problems, as described in [View the App Log](#view-app-log). If you are new to configuring connectors in Studio, see [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio). If, after reading this topic, you need additional information about the connector fields, see the [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/2.1/web-service-consumer-reference). ## Create a Mule Project In Studio, create a new Mule project in which to add and configure the connector: 1. In Studio, select **File > New > Mule Project**. 2. Enter a name for your Mule project and click **Finish**. ## Add the Connector to Your Mule Project Add Web Service Consumer Connector to your Mule project to automatically populate the XML code with the connector’s namespace and schema location and add the required dependencies to the project’s `pom.xml` file: 1. In the **Mule Palette** view, click **(X) Search in Exchange**. 2. In **Add Dependencies to Project**, type `web service consumer` in the search field. 3. Click **Web Service Consumer** in **Available modules**. 4. Click **Add**. 5. Click **Finish**. Adding a connector to a Mule project in Studio does not make that connector available to other projects in your Studio workspace. ## Configure a Source An input source initiates a flow when a specified condition is met. For example, to configure HTTP **Listener**, follow these steps: 1. In the **Mule Palette** view, select **HTTP** > **Listener**. 2. Drag **Listener** to the Studio canvas. 3. On the **Listener** configuration screen, optionally change the value of the **Display Name** field. 4. Specify a value for the **Path** field. 5. Click the plus sign (**+**) next to the **Connector configuration** field to configure a global element that can be used by all instances of `HTTP Listener` in the app. 6. On the **General** tab, specify connection information. 7. On the **TLS** tab, optionally specify TLS information. 8. On the **Advanced** tab, optionally specify reconnection information, including a reconnection strategy. 9. Click **Test Connection** to confirm that Mule can connect with the specific server. 10. Click **OK**. ## Add a Connector Operation to the Flow When you add a connector operation to your flow, you immediately define a specific operation for that connector to perform. To add the Consume operation to Web Service Consumer Connector, follow these steps: 1. In the **Mule Palette** view, select **Web Service Consumer** and then select the **Consume** operation. 2. Drag the operation onto the Studio canvas to the right of the input source. ![Web Service Consumer Connector Operations](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/web-service-consumer-operation.png) Figure 1. Web Service Consumer Connector Operations ## Configure a Global Element for the Connector When you configure a connector, it’s best to configure a global element that all instances of that connector in the app can use. To consume a SOAP web service operation, you need to create a configuration that points to the service that you want to consume. To configure the global element for Web Service Consumer Connector, follow these steps: 1. Select the name of the connector in the Studio canvas. 2. In the **Basic Settings** section of the **General** tab, click the plus sign (+) next to the **Connector configuration** field to access the global element configuration fields. 3. In the **Connection** section of the **General** tab, configure the following parameters: - **WSDL location** The remote or local WSDL file URL - **Service** The service name - **Port** The port name - **Address** The address of the web server to dispatch requests if the **Service** and **Port** parameters did not automatically provide this value. Note that the **WSDL location**, **Service**, and **Port** parameters are mandatory for the configuration to be valid. The following example shows how to configure the global element to get a list of flights by airline: ![Web Service Consumer Global Element](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/web-service-consumer-global-element.png) Figure 2. Web Service Consumer Global Element In the **Configuration XML** tab, the XML looks like this: ```xml ``` ## Configure Consume Operation After you configure a global element for Web Service Consumer Connector, configure the Consume operation parameters, such as **Operation**, **Message** (**Body, Headers, Attachments**) and so on. Additionally, learn about the output of the Consume operation and metadata attributes used to dispatch messages. ### Parameters The Consume operation has two main parameters: - **Operation** Defines which SOAP operation of the web service to invoke. During the design phase, the parameter defines the input and output types for the Consume operation. The types will change depending on which operation you choose. - **Message** A representation of `SOAP:ENVELOP` composed of three optional parameters: - **Body** The XML body to include in the SOAP message, with all the required parameters, or `null` if no parameters are required - **Headers** The XML headers to include in the SOAP message - **Attachments** The attachments to include in the SOAP request To configure these parameters for the Consume operation, follow these steps: 1. Select the name of the connector in the Studio canvas. 2. In the **General** section of the Consume operation, define **Operation**, and in the **Message** section, define **Body**, **Headers**, and **Attachments** fields: ![Configure Consume Operation](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/web-service-consumer-configure-consume.png) Figure 3. Configure Consume Operation In the **Configuration XML** tab, a basic configuration for the Consume operation looks like this: ```xml #[payload] ``` #### Body Parameter The `body` parameter is the main part of the SOAP message. It accepts embedded DataWeave script values so expects that you can construct the XML request without having a side effect on the message or having to use multiple components to create the request. Some characteristics of the parameter include: - The default value is `#[payload]`, based on the assumption that the incoming payload is the XML entity ready to ship to the service. - If the body is not valid XML, or if the request cannot be created for some reason, you get a `WSC:BAD_REQUEST` error. - If you don’t provide body content, the Web Service Consumer Connector attempts to generate one, and this works only for cases where no XML entity is expected in the body. - Some web services require to append the XML prolog tag into the envelope’s body XML content, which contains the version and encoding information that identifies the document as being XML. The following example shows a DataWeave expression inside the `body` parameter, and how to force the Web Service Consumer Connector to dispatch any payload by enabling the XML prolog option: 1. Select the name of the connector in the Studio canvas. 2. In the **Body** parameter field of the **General** tab, add the DataWeave expression. 3. In the **Message Customization** section of the **Advanced** tab, enable the option **Force XML Prolog into body** like this: ![Configure XML Prolog into Body](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/web-service-consumer-xmlprolog.png) Figure 4. Configure XML Prolog into Body In the **Configuration XML** tab, the XML looks like this: ```xml #[ %dw 2.0 output application/xml ns con http://service.soap.clients.namespace/ --- con#clients: { client: { name: "admin1", lastname: "textpassword1" }, client: { name: "admin2", lastname: "textpassword2" } }] ``` #### Headers Parameter The `headers` parameter contains application-specific information about the SOAP message, such as authentication, payment, and so on. The parameter is an XML entity, that accepts an embedded DataWeave script as its value. The following XML example shows a DataWeave expression inside the `headers` parameter: ```xml #[payload] #[ %dw 2.0 output application/xml ns con http://service.soap.clients.namespace/ --- "headers": { con#user: "admin", con#pass: "textpassword" }] ``` Note that inside the DW script, the root must be `"headers"`, otherwise, the following error returns while running the application: `Invalid input headers XML: It must be an xml with the root tag named \'headers\'`. #### Attachments Parameter The `attachments` parameter enables you to bind attachments to the SOAP message. To create attachments for transport over SOAP, declare a DataWeave script in which each entry represents an attachment and the entry value provides the content of the attachment. The following XML example shows a DataWeave expression inside the `attachments` parameter that declares a new attachment called `clientsJson`. The attachment value content is stored in the `jsonFile` variable. This variable can be set from a `file:read` operation: ```xml #[payload] #[{ clientsJson: vars.jsonFile } ] ``` ### Output The output of the Consume operation represents an incoming SOAP message that contains the same elements that the `Message` parameter has, and you can access each part of it. The following XML example stores: - The content of the body in a `soap.body` variable - The content of the header called `auth` in a `soap.header.auth` variable - The content of an attachment called `json` in a `soap.attachment.json` variable ```xml #[payload] ``` ### Attributes When your app consumes a web service operation, you might be interested not only in the response content but also in the metadata of the underlying transport used to dispatch the messages. For example, when you use HTTP, attributes carry HTTP headers bound to the HTTP request (`content-length`, `status`, and so on). The Web Service Consumer Connector uses Mule message attributes to access this information. ## View the App Log To check for problems, you can view the app log as follows: - If you’re running the app from Anypoint Platform, the output is visible in the Anypoint Studio console window. - If you’re running the app using Mule from the command line, the app log is visible in your OS console. Unless the log file path is customized in the app’s log file (`log4j2.xml`), you can also view the app log in the default location `MULE_HOME/logs/.log`. ## Next Step After you configure a global element and connection information, configure the other fields for the connector. See [Additional Configuration Information](https://docs.mulesoft.com/web-service-consumer-connector/2.1/web-service-consumer-config-topics) for more configuration steps. ## See Also - [How to set SOAP headers in Web Service Consumer in Mule 4](https://help.salesforce.com/s/articleView?id=001114743&type=1) - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [Web Service Consumer Reference](https://docs.mulesoft.com/web-service-consumer-connector/2.1/web-service-consumer-reference) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 2.2 is-latest-version: true --- # Using Anypoint Studio to Configure Web Service Consumer 2.2 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and configuration files. To add and configure a connector in Studio: 1. [Create a Mule project](#create-mule-project). 2. [Add the connector to your Mule project](#add-connector-to-project). 3. [Configure a source for the connector’s flow](#configure-input-source). 4. [Add a connector operation to the flow](#add-connector-operation). 5. [Configure a global element for the connector](#configure-global-element). 6. [Configure the Consume operation](#configure-other-fields). When you run the connector, you can view the app log to check for problems, as described in [View the App Log](#view-app-log). If you are new to configuring connectors in Studio, see [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio). If, after reading this topic, you need additional information about the connector fields, see the [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/latest/web-service-consumer-reference). ## Create a Mule Project In Studio, create a new Mule project in which to add and configure the connector: 1. In Studio, select **File > New > Mule Project**. 2. Enter a name for your Mule project and click **Finish**. ## Add the Connector to Your Mule Project Add Web Service Consumer Connector to your Mule project to automatically populate the XML code with the connector’s namespace and schema location and add the required dependencies to the project’s `pom.xml` file: 1. In the **Mule Palette** view, click **(X) Search in Exchange**. 2. In **Add Dependencies to Project**, type `web service consumer` in the search field. 3. Click **Web Service Consumer** in **Available modules**. 4. Click **Add**. 5. Click **Finish**. Adding a connector to a Mule project in Studio does not make that connector available to other projects in your Studio workspace. ## Configure a Source An input source initiates a flow when a specified condition is met. For example, to configure HTTP **Listener**, follow these steps: 1. In the **Mule Palette** view, select **HTTP** > **Listener**. 2. Drag **Listener** to the Studio canvas. 3. On the **Listener** configuration screen, optionally change the value of the **Display Name** field. 4. Specify a value for the **Path** field. 5. Click the plus sign (**+**) next to the **Connector configuration** field to configure a global element that can be used by all instances of `HTTP Listener` in the app. 6. On the **General** tab, specify connection information. 7. On the **TLS** tab, optionally specify TLS information. 8. On the **Advanced** tab, optionally specify reconnection information, including a reconnection strategy. 9. Click **Test Connection** to confirm that Mule can connect with the specific server. 10. Click **OK**. ## Add a Connector Operation to the Flow When you add a connector operation to your flow, you immediately define a specific operation for that connector to perform. To add the Consume operation to Web Service Consumer Connector, follow these steps: 1. In the **Mule Palette** view, select **Web Service Consumer** and then select the **Consume** operation. 2. Drag the operation onto the Studio canvas to the right of the input source. ![Web Service Consumer Connector Operations](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/web-service-consumer-operation.png) Figure 1. Web Service Consumer Connector Operations ## Configure a Global Element for the Connector When you configure a connector, it’s best to configure a global element that all instances of that connector in the app can use. To consume a SOAP web service operation, you need to create a configuration that points to the service that you want to consume. To configure the global element for Web Service Consumer Connector, follow these steps: 1. Select the name of the connector in the Studio canvas. 2. In the **Basic Settings** section of the **General** tab, click the plus sign (+) next to the **Connector configuration** field to access the global element configuration fields. 3. In the **Connection** section of the **General** tab, configure the following parameters: - **WSDL location** The remote or local WSDL file URL - **Service** The service name - **Port** The port name - **Address** The address of the web server to dispatch requests if the **Service** and **Port** parameters did not automatically provide this value. Note that the **WSDL location**, **Service**, and **Port** parameters are mandatory for the configuration to be valid. The following example shows how to configure the global element to get a list of flights by airline: ![Web Service Consumer Global Element](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/web-service-consumer-global-element.png) Figure 2. Web Service Consumer Global Element In the **Configuration XML** tab, the XML looks like this: ```xml ``` ## Configure Consume Operation After you configure a global element for Web Service Consumer Connector, configure the Consume operation parameters, such as **Operation**, **Message** (**Body, Headers, Attachments**) and so on. Additionally, learn about the output of the Consume operation and metadata attributes used to dispatch messages. ### Parameters The Consume operation has two main parameters: - **Operation** Defines which SOAP operation of the web service to invoke. During the design phase, the parameter defines the input and output types for the Consume operation. The types will change depending on which operation you choose. - **Message** A representation of `SOAP:ENVELOP` composed of three optional parameters: - **Body** The XML body to include in the SOAP message, with all the required parameters, or `null` if no parameters are required - **Headers** The XML headers to include in the SOAP message - **Attachments** The attachments to include in the SOAP request To configure these parameters for the Consume operation, follow these steps: 1. Select the name of the connector in the Studio canvas. 2. In the **General** section of the Consume operation, define **Operation**, and in the **Message** section, define **Body**, **Headers**, and **Attachments** fields: ![Configure Consume Operation](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/web-service-consumer-configure-consume.png) Figure 3. Configure Consume Operation In the **Configuration XML** tab, a basic configuration for the Consume operation looks like this: ```xml #[payload] ``` #### Body Parameter The `body` parameter is the main part of the SOAP message. It accepts embedded DataWeave script values so expects that you can construct the XML request without having a side effect on the message or having to use multiple components to create the request. Some characteristics of the parameter include: - The default value is `#[payload]`, based on the assumption that the incoming payload is the XML entity ready to ship to the service. - If the body is not valid XML, or if the request cannot be created for some reason, you get a `WSC:BAD_REQUEST` error. - If you don’t provide body content, the Web Service Consumer Connector attempts to generate one, and this works only for cases where no XML entity is expected in the body. - Some web services require to append the XML prolog tag into the envelope’s body XML content, which contains the version and encoding information that identifies the document as being XML. The following example shows a DataWeave expression inside the `body` parameter, and how to force the Web Service Consumer Connector to dispatch any payload by enabling the XML prolog option: 1. Select the name of the connector in the Studio canvas. 2. In the **Body** parameter field of the **General** tab, add the DataWeave expression. 3. In the **Message Customization** section of the **Advanced** tab, enable the option **Force XML Prolog into body** like this: ![Configure XML Prolog into Body](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/web-service-consumer-xmlprolog.png) Figure 4. Configure XML Prolog into Body In the **Configuration XML** tab, the XML looks like this: ```xml #[ %dw 2.0 output application/xml ns con http://service.soap.clients.namespace/ --- con#clients: { client: { name: "admin1", lastname: "textpassword1" }, client: { name: "admin2", lastname: "textpassword2" } }] ``` #### Headers Parameter The `headers` parameter contains application-specific information about the SOAP message, such as authentication, payment, and so on. The parameter is an XML entity, that accepts an embedded DataWeave script as its value. The following XML example shows a DataWeave expression inside the `headers` parameter: ```xml #[payload] #[ %dw 2.0 output application/xml ns con http://service.soap.clients.namespace/ --- "headers": { con#user: "admin", con#pass: "textpassword" }] ``` Note that inside the DW script, the root must be `"headers"`, otherwise, the following error returns while running the application: `Invalid input headers XML: It must be an xml with the root tag named \'headers\'`. #### Attachments Parameter The `attachments` parameter enables you to bind attachments to the SOAP message. To create attachments for transport over SOAP, declare a DataWeave script in which each entry represents an attachment and the entry value provides the content of the attachment. The following XML example shows a DataWeave expression inside the `attachments` parameter that declares a new attachment called `clientsJson`. The attachment value content is stored in the `jsonFile` variable. This variable can be set from a `file:read` operation: ```xml #[payload] #[{ clientsJson: vars.jsonFile } ] ``` ### Output The output of the Consume operation represents an incoming SOAP message that contains the same elements that the `Message` parameter has, and you can access each part of it. The following XML example stores: - The content of the body in a `soap.body` variable - The content of the header called `auth` in a `soap.header.auth` variable - The content of an attachment called `json` in a `soap.attachment.json` variable ```xml #[payload] ``` ### Attributes When your app consumes a web service operation, you might be interested not only in the response content but also in the metadata of the underlying transport used to dispatch the messages. For example, when you use HTTP, attributes carry HTTP headers bound to the HTTP request (`content-length`, `status`, and so on). The Web Service Consumer Connector uses Mule message attributes to access this information. ## View the App Log To check for problems, you can view the app log as follows: - If you’re running the app from Anypoint Platform, the output is visible in the Anypoint Studio console window. - If you’re running the app using Mule from the command line, the app log is visible in your OS console. Unless the log file path is customized in the app’s log file (`log4j2.xml`), you can also view the app log in the default location `MULE_HOME/logs/.log`. ## Next Step After you configure a global element and connection information, configure the other fields for the connector. See [Additional Configuration Information](https://docs.mulesoft.com/web-service-consumer-connector/latest/web-service-consumer-config-topics) for more configuration steps. ## See Also - [How to set SOAP headers in Web Service Consumer in Mule 4](https://help.salesforce.com/s/articleView?id=001114743&type=1) - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [Web Service Consumer Reference](https://docs.mulesoft.com/web-service-consumer-connector/latest/web-service-consumer-reference) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 1.11 --- # Web Service Consumer - Example 1 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following example shows how to transform a variable value into XML and pass that value to Anypoint Connector for Web Service Consumer (Web Service Consumer Connector), which subsequently consumes a web service: ![Web Service Consumer Example Flow in Studio Canvas](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/web-service-consumer-example1.png) ## Create the Mule App in Anypoint Studio To create the flow in Anypoint Studio: 1. In the **Mule Palette** view, select **Core** > **Scheduler**. 2. Drag the **Scheduler** component to the Studio canvas. The **Scheduler** component initiates a flow when a time-based condition is met. 3. Set the **Display Name** field to `Scheduler`. 4. Set **Scheduling Strategy** to `Fixed Frequency`, **Frequency** to `1000`, **Start delay** to `0` and **Time unit** to `MILLISECONDS (Default)`. In Studio, the **Scheduler** configuration looks like this: ![Scheduler Configuration](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/web-service-consumer-example2.png) Figure 1. Scheduler Configuration 5. Drag a **Set Variable** component onto the canvas, to the right of the **Scheduler** component. The **Set Variable** component creates the variable to be transformed into XML later in the flow. 6. Set the **Display Name** field to `Set Variable`. 7. Set **Name** to `variableSample` and **Value** to `test`. In Studio, the **Set Variable** configuration looks like this: ![Set Variable Configuration](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/web-service-consumer-example3.png) Figure 2. Set Variable Configuration 8. Drag a **Transform Message** component onto the canvas, to the right of the **Set Variable** component. The **Transform Message** component transforms the variable value into XML. 9. In the **Output** field of the **Transform Message** component configuration, set a DataWeave expression that: - Transforms the variable value output to `application/xml`. - Defines the name of the web service operation that the Web Service Consumer Connector aims to invoke by `attachOperation`. DataWeave Expression ```xml %dw 2.0 output application/xml ns con http://service.soap.service.mule.org/ --- con#attachOperation: { text: vars.variableSample } ``` In Studio, the **Transform Message** configuration looks like this: ![Transform Message Configuration](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/web-service-consumer-example4.png) Figure 3. Transform Message Configuration 10. Drag the **Consume** operation onto the canvas, to the right of the **Transform Message** component. 11. Set the **Display Name** field to `Consume`. 12. Set **Operation** to `attachOperation` and the **Body** message to `payload`. 13. In the **Message Customization** section of the **Advanced** tab, enable the option **Force XML Prolog into body** to append the XML prolog to the content of the envelope’s body XML. In Studio, the **Consume** operation configuration looks like this: ![Consume Operation Configuration](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/web-service-consumer-example5.png) Figure 4. Consume Operation Configuration In Studio, the **XML Prolog** configuration looks like this: ![Configure XML Prolog into Body](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/web-service-consumer-xmlprolog.png) Figure 5. Configure XML Prolog into Body 14. On the **General** tab, click the plus sign (+) next to the **Connector configuration** field to access the **Global Element Properties** configuration. 15. On the **Connection** section of the **General** tab, configure the following parameters: - **WSDL location** The remote or local WSDL file URL - **Service** The service name - **Port** The port name - **Address** The address of the web server to dispatch requests but if the **Service** and **Port** parameters don’t auto-populate the web server address, you must manually provide the correct **Address**. 16. Click **OK**. In Studio, the **Global Element Properties** configuration looks like this: ![Web Service Consumer Configuration](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/web-service-consumer-example6.png) Figure 6. Web Service Consumer Configuration 17. Save your changes in Studio. 18. Deploy the application. ## XML for Consuming a Web Service Paste this code into the Studio XML editor to quickly load the flow for this example into your Mule app: ```xml ``` --- product: Web Service Consumer Connector version: 1.12 --- # Web Service Consumer - Example 1 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following example shows how to transform a variable value into XML and pass that value to Anypoint Connector for Web Service Consumer (Web Service Consumer Connector), which subsequently consumes a web service: ![Web Service Consumer Example Flow in Studio Canvas](/mulesoft/current/en-us/web-service-consumer-connector/1.12/_images/web-service-consumer-example1.png) ## Create the Mule App in Anypoint Studio To create the flow in Anypoint Studio: 1. In the **Mule Palette** view, select **Core** > **Scheduler**. 2. Drag the **Scheduler** component to the Studio canvas. The **Scheduler** component initiates a flow when a time-based condition is met. 3. Set the **Display Name** field to `Scheduler`. 4. Set **Scheduling Strategy** to `Fixed Frequency`, **Frequency** to `1000`, **Start delay** to `0` and **Time unit** to `MILLISECONDS (Default)`. In Studio, the **Scheduler** configuration looks like this: ![Scheduler Configuration](/mulesoft/current/en-us/web-service-consumer-connector/1.12/_images/web-service-consumer-example2.png) Figure 1. Scheduler Configuration 5. Drag a **Set Variable** component onto the canvas, to the right of the **Scheduler** component. The **Set Variable** component creates the variable to be transformed into XML later in the flow. 6. Set the **Display Name** field to `Set Variable`. 7. Set **Name** to `variableSample` and **Value** to `test`. In Studio, the **Set Variable** configuration looks like this: ![Set Variable Configuration](/mulesoft/current/en-us/web-service-consumer-connector/1.12/_images/web-service-consumer-example3.png) Figure 2. Set Variable Configuration 8. Drag a **Transform Message** component onto the canvas, to the right of the **Set Variable** component. The **Transform Message** component transforms the variable value into XML. 9. In the **Output** field of the **Transform Message** component configuration, set a DataWeave expression that: - Transforms the variable value output to `application/xml`. - Defines the name of the web service operation that the Web Service Consumer Connector aims to invoke by `attachOperation`. DataWeave Expression ```xml %dw 2.0 output application/xml ns con http://service.soap.service.mule.org/ --- con#attachOperation: { text: vars.variableSample } ``` In Studio, the **Transform Message** configuration looks like this: ![Transform Message Configuration](/mulesoft/current/en-us/web-service-consumer-connector/1.12/_images/web-service-consumer-example4.png) Figure 3. Transform Message Configuration 10. Drag the **Consume** operation onto the canvas, to the right of the **Transform Message** component. 11. Set the **Display Name** field to `Consume`. 12. Set **Operation** to `attachOperation` and the **Body** message to `payload`. 13. In the **Message Customization** section of the **Advanced** tab, enable the option **Force XML Prolog into body** to append the XML prolog to the content of the envelope’s body XML. In Studio, the **Consume** operation configuration looks like this: ![Consume Operation Configuration](/mulesoft/current/en-us/web-service-consumer-connector/1.12/_images/web-service-consumer-example5.png) Figure 4. Consume Operation Configuration In Studio, the **XML Prolog** configuration looks like this: ![Configure XML Prolog into Body](/mulesoft/current/en-us/web-service-consumer-connector/1.12/_images/web-service-consumer-xmlprolog.png) Figure 5. Configure XML Prolog into Body 14. On the **General** tab, click the plus sign (+) next to the **Connector configuration** field to access the **Global Element Properties** configuration. 15. On the **Connection** section of the **General** tab, configure the following parameters: - **WSDL location** The remote or local WSDL file URL - **Service** The service name - **Port** The port name - **Address** The address of the web server to dispatch requests but if the **Service** and **Port** parameters don’t auto-populate the web server address, you must manually provide the correct **Address**. 16. Click **OK**. In Studio, the **Global Element Properties** configuration looks like this: ![Web Service Consumer Configuration](/mulesoft/current/en-us/web-service-consumer-connector/1.12/_images/web-service-consumer-example6.png) Figure 6. Web Service Consumer Configuration 17. Save your changes in Studio. 18. Deploy the application. ## XML for Consuming a Web Service Paste this code into the Studio XML editor to quickly load the flow for this example into your Mule app: ```xml ``` --- product: Web Service Consumer Connector version: 2.0 --- # Web Service Consumer - Example 1 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following example shows how to transform a variable value into XML and pass that value to Anypoint Connector for Web Service Consumer (Web Service Consumer Connector), which subsequently consumes a web service: ![Web Service Consumer Example Flow in Studio Canvas](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/web-service-consumer-example1.png) ## Create the Mule App in Anypoint Studio To create the flow in Anypoint Studio: 1. In the **Mule Palette** view, select **Core** > **Scheduler**. 2. Drag the **Scheduler** component to the Studio canvas. The **Scheduler** component initiates a flow when a time-based condition is met. 3. Set the **Display Name** field to `Scheduler`. 4. Set **Scheduling Strategy** to `Fixed Frequency`, **Frequency** to `1000`, **Start delay** to `0` and **Time unit** to `MILLISECONDS (Default)`. In Studio, the **Scheduler** configuration looks like this: ![Scheduler Configuration](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/web-service-consumer-example2.png) Figure 1. Scheduler Configuration 5. Drag a **Set Variable** component onto the canvas, to the right of the **Scheduler** component. The **Set Variable** component creates the variable to be transformed into XML later in the flow. 6. Set the **Display Name** field to `Set Variable`. 7. Set **Name** to `variableSample` and **Value** to `test`. In Studio, the **Set Variable** configuration looks like this: ![Set Variable Configuration](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/web-service-consumer-example3.png) Figure 2. Set Variable Configuration 8. Drag a **Transform Message** component onto the canvas, to the right of the **Set Variable** component. The **Transform Message** component transforms the variable value into XML. 9. In the **Output** field of the **Transform Message** component configuration, set a DataWeave expression that: - Transforms the variable value output to `application/xml`. - Defines the name of the web service operation that the Web Service Consumer Connector aims to invoke by `attachOperation`. DataWeave Expression ```xml %dw 2.0 output application/xml ns con http://service.soap.service.mule.org/ --- con#attachOperation: { text: vars.variableSample } ``` In Studio, the **Transform Message** configuration looks like this: ![Transform Message Configuration](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/web-service-consumer-example4.png) Figure 3. Transform Message Configuration 10. Drag the **Consume** operation onto the canvas, to the right of the **Transform Message** component. 11. Set the **Display Name** field to `Consume`. 12. Set **Operation** to `attachOperation` and the **Body** message to `payload`. 13. In the **Message Customization** section of the **Advanced** tab, enable the option **Force XML Prolog into body** to append the XML prolog to the content of the envelope’s body XML. In Studio, the **Consume** operation configuration looks like this: ![Consume Operation Configuration](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/web-service-consumer-example5.png) Figure 4. Consume Operation Configuration In Studio, the **XML Prolog** configuration looks like this: ![Configure XML Prolog into Body](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/web-service-consumer-xmlprolog.png) Figure 5. Configure XML Prolog into Body 14. On the **General** tab, click the plus sign (+) next to the **Connector configuration** field to access the **Global Element Properties** configuration. 15. On the **Connection** section of the **General** tab, configure the following parameters: - **WSDL location** The remote or local WSDL file URL - **Service** The service name - **Port** The port name - **Address** The address of the web server to dispatch requests but if the **Service** and **Port** parameters don’t auto-populate the web server address, you must manually provide the correct **Address**. 16. Click **OK**. In Studio, the **Global Element Properties** configuration looks like this: ![Web Service Consumer Configuration](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/web-service-consumer-example6.png) Figure 6. Web Service Consumer Configuration 17. Save your changes in Studio. 18. Deploy the application. ## XML for Consuming a Web Service Paste this code into the Studio XML editor to quickly load the flow for this example into your Mule app: ```xml ``` --- product: Web Service Consumer Connector version: 2.1 --- # Web Service Consumer - Example 1 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following example shows how to transform a variable value into XML and pass that value to Anypoint Connector for Web Service Consumer (Web Service Consumer Connector), which subsequently consumes a web service: ![Web Service Consumer Example Flow in Studio Canvas](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/web-service-consumer-example1.png) ## Create the Mule App in Anypoint Studio To create the flow in Anypoint Studio: 1. In the **Mule Palette** view, select **Core** > **Scheduler**. 2. Drag the **Scheduler** component to the Studio canvas. The **Scheduler** component initiates a flow when a time-based condition is met. 3. Set the **Display Name** field to `Scheduler`. 4. Set **Scheduling Strategy** to `Fixed Frequency`, **Frequency** to `1000`, **Start delay** to `0` and **Time unit** to `MILLISECONDS (Default)`. In Studio, the **Scheduler** configuration looks like this: ![Scheduler Configuration](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/web-service-consumer-example2.png) Figure 1. Scheduler Configuration 5. Drag a **Set Variable** component onto the canvas, to the right of the **Scheduler** component. The **Set Variable** component creates the variable to be transformed into XML later in the flow. 6. Set the **Display Name** field to `Set Variable`. 7. Set **Name** to `variableSample` and **Value** to `test`. In Studio, the **Set Variable** configuration looks like this: ![Set Variable Configuration](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/web-service-consumer-example3.png) Figure 2. Set Variable Configuration 8. Drag a **Transform Message** component onto the canvas, to the right of the **Set Variable** component. The **Transform Message** component transforms the variable value into XML. 9. In the **Output** field of the **Transform Message** component configuration, set a DataWeave expression that: - Transforms the variable value output to `application/xml`. - Defines the name of the web service operation that the Web Service Consumer Connector aims to invoke by `attachOperation`. DataWeave Expression ```xml %dw 2.0 output application/xml ns con http://service.soap.service.mule.org/ --- con#attachOperation: { text: vars.variableSample } ``` In Studio, the **Transform Message** configuration looks like this: ![Transform Message Configuration](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/web-service-consumer-example4.png) Figure 3. Transform Message Configuration 10. Drag the **Consume** operation onto the canvas, to the right of the **Transform Message** component. 11. Set the **Display Name** field to `Consume`. 12. Set **Operation** to `attachOperation` and the **Body** message to `payload`. 13. In the **Message Customization** section of the **Advanced** tab, enable the option **Force XML Prolog into body** to append the XML prolog to the content of the envelope’s body XML. In Studio, the **Consume** operation configuration looks like this: ![Consume Operation Configuration](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/web-service-consumer-example5.png) Figure 4. Consume Operation Configuration In Studio, the **XML Prolog** configuration looks like this: ![Configure XML Prolog into Body](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/web-service-consumer-xmlprolog.png) Figure 5. Configure XML Prolog into Body 14. On the **General** tab, click the plus sign (+) next to the **Connector configuration** field to access the **Global Element Properties** configuration. 15. On the **Connection** section of the **General** tab, configure the following parameters: - **WSDL location** The remote or local WSDL file URL - **Service** The service name - **Port** The port name - **Address** The address of the web server to dispatch requests but if the **Service** and **Port** parameters don’t auto-populate the web server address, you must manually provide the correct **Address**. 16. Click **OK**. In Studio, the **Global Element Properties** configuration looks like this: ![Web Service Consumer Configuration](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/web-service-consumer-example6.png) Figure 6. Web Service Consumer Configuration 17. Save your changes in Studio. 18. Deploy the application. ## XML for Consuming a Web Service Paste this code into the Studio XML editor to quickly load the flow for this example into your Mule app: ```xml ``` --- product: Web Service Consumer Connector version: 2.2 is-latest-version: true --- # Web Service Consumer - Example 1 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following example shows how to transform a variable value into XML and pass that value to Anypoint Connector for Web Service Consumer (Web Service Consumer Connector), which subsequently consumes a web service: ![Web Service Consumer Example Flow in Studio Canvas](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/web-service-consumer-example1.png) ## Create the Mule App in Anypoint Studio To create the flow in Anypoint Studio: 1. In the **Mule Palette** view, select **Core** > **Scheduler**. 2. Drag the **Scheduler** component to the Studio canvas. The **Scheduler** component initiates a flow when a time-based condition is met. 3. Set the **Display Name** field to `Scheduler`. 4. Set **Scheduling Strategy** to `Fixed Frequency`, **Frequency** to `1000`, **Start delay** to `0` and **Time unit** to `MILLISECONDS (Default)`. In Studio, the **Scheduler** configuration looks like this: ![Scheduler Configuration](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/web-service-consumer-example2.png) Figure 1. Scheduler Configuration 5. Drag a **Set Variable** component onto the canvas, to the right of the **Scheduler** component. The **Set Variable** component creates the variable to be transformed into XML later in the flow. 6. Set the **Display Name** field to `Set Variable`. 7. Set **Name** to `variableSample` and **Value** to `test`. In Studio, the **Set Variable** configuration looks like this: ![Set Variable Configuration](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/web-service-consumer-example3.png) Figure 2. Set Variable Configuration 8. Drag a **Transform Message** component onto the canvas, to the right of the **Set Variable** component. The **Transform Message** component transforms the variable value into XML. 9. In the **Output** field of the **Transform Message** component configuration, set a DataWeave expression that: - Transforms the variable value output to `application/xml`. - Defines the name of the web service operation that the Web Service Consumer Connector aims to invoke by `attachOperation`. DataWeave Expression ```xml %dw 2.0 output application/xml ns con http://service.soap.service.mule.org/ --- con#attachOperation: { text: vars.variableSample } ``` In Studio, the **Transform Message** configuration looks like this: ![Transform Message Configuration](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/web-service-consumer-example4.png) Figure 3. Transform Message Configuration 10. Drag the **Consume** operation onto the canvas, to the right of the **Transform Message** component. 11. Set the **Display Name** field to `Consume`. 12. Set **Operation** to `attachOperation` and the **Body** message to `payload`. 13. In the **Message Customization** section of the **Advanced** tab, enable the option **Force XML Prolog into body** to append the XML prolog to the content of the envelope’s body XML. In Studio, the **Consume** operation configuration looks like this: ![Consume Operation Configuration](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/web-service-consumer-example5.png) Figure 4. Consume Operation Configuration In Studio, the **XML Prolog** configuration looks like this: ![Configure XML Prolog into Body](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/web-service-consumer-xmlprolog.png) Figure 5. Configure XML Prolog into Body 14. On the **General** tab, click the plus sign (+) next to the **Connector configuration** field to access the **Global Element Properties** configuration. 15. On the **Connection** section of the **General** tab, configure the following parameters: - **WSDL location** The remote or local WSDL file URL - **Service** The service name - **Port** The port name - **Address** The address of the web server to dispatch requests but if the **Service** and **Port** parameters don’t auto-populate the web server address, you must manually provide the correct **Address**. 16. Click **OK**. In Studio, the **Global Element Properties** configuration looks like this: ![Web Service Consumer Configuration](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/web-service-consumer-example6.png) Figure 6. Web Service Consumer Configuration 17. Save your changes in Studio. 18. Deploy the application. ## XML for Consuming a Web Service Paste this code into the Studio XML editor to quickly load the flow for this example into your Mule app: ```xml ``` --- product: Web Service Consumer Connector version: 1.11 --- # Web Service Consumer - Example 2 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following example lists an inventory of t-shirts and Web Service Consumer Connector returns if there is an error such as `BAD_RESPONSE` or `EMPTY_RESPONSE`. ![Web Service Consumer Example flow in Studio canvas](/mulesoft/current/en-us/web-service-consumer-connector/1.11/_images/wsc-example-2.png) ## XML for Consuming a Web Service Paste this code into the Studio XML editor to quickly load the flow for this example into your Mule app: ```xml #[payload] #[attributes.protocolHeaders default {}] #[payload] #[attributes.protocolHeaders default {}] #[payload] #[ %dw 2.0 output application/java --- { headers: attributes.headers, method: attributes.method, queryString: attributes.queryString }] ``` --- product: Web Service Consumer Connector version: 1.12 --- # Web Service Consumer - Example 2 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following example lists an inventory of t-shirts and Web Service Consumer Connector returns if there is an error such as `BAD_RESPONSE` or `EMPTY_RESPONSE`. ![Web Service Consumer Example flow in Studio canvas](/mulesoft/current/en-us/web-service-consumer-connector/1.12/_images/wsc-example-2.png) ## XML for Consuming a Web Service Paste this code into the Studio XML editor to quickly load the flow for this example into your Mule app: ```xml #[payload] #[attributes.protocolHeaders default {}] #[payload] #[attributes.protocolHeaders default {}] #[payload] #[ %dw 2.0 output application/java --- { headers: attributes.headers, method: attributes.method, queryString: attributes.queryString }] ``` --- product: Web Service Consumer Connector version: 2.0 --- # Web Service Consumer - Example 2 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following example lists an inventory of t-shirts and Web Service Consumer Connector returns if there is an error such as `BAD_RESPONSE` or `EMPTY_RESPONSE`. ![Web Service Consumer Example flow in Studio canvas](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/wsc-example-2.png) ## XML for Consuming a Web Service Paste this code into the Studio XML editor to quickly load the flow for this example into your Mule app: ```xml #[payload] #[attributes.protocolHeaders default {}] #[payload] #[attributes.protocolHeaders default {}] #[payload] #[ %dw 2.0 output application/java --- { headers: attributes.headers, method: attributes.method, queryString: attributes.queryString }] ``` --- product: Web Service Consumer Connector version: 2.1 --- # Web Service Consumer - Example 2 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following example lists an inventory of t-shirts and Web Service Consumer Connector returns if there is an error such as `BAD_RESPONSE` or `EMPTY_RESPONSE`. ![Web Service Consumer Example flow in Studio canvas](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/wsc-example-2.png) ## XML for Consuming a Web Service Paste this code into the Studio XML editor to quickly load the flow for this example into your Mule app: ```xml #[payload] #[attributes.protocolHeaders default {}] #[payload] #[attributes.protocolHeaders default {}] #[payload] #[ %dw 2.0 output application/java --- { headers: attributes.headers, method: attributes.method, queryString: attributes.queryString }] ``` --- product: Web Service Consumer Connector version: 2.2 is-latest-version: true --- # Web Service Consumer - Example 2 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following example lists an inventory of t-shirts and Web Service Consumer Connector returns if there is an error such as `BAD_RESPONSE` or `EMPTY_RESPONSE`. ![Web Service Consumer Example flow in Studio canvas](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/wsc-example-2.png) ## XML for Consuming a Web Service Paste this code into the Studio XML editor to quickly load the flow for this example into your Mule app: ```xml #[payload] #[attributes.protocolHeaders default {}] #[payload] #[attributes.protocolHeaders default {}] #[payload] #[ %dw 2.0 output application/java --- { headers: attributes.headers, method: attributes.method, queryString: attributes.queryString }] ``` --- 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 `` is under the Web Service Consumer configuration ``: ```xml ``` ## 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 ``` ## 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 ``` ## 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 ``` ## 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) --- product: Web Service Consumer Connector version: 1.12 --- # 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.12/_images/web-service-consumer-configure-transport.png) In the **Configuration XML** tab, the reference of the HTTP Requester configuration `` is under the Web Service Consumer configuration ``: ```xml ``` ## 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.12/_images/web-service-consumer-configure-wsecurity.png) In the **Configuration XML** tab, configuring Web Service Security looks like this: ```xml ``` ## 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.12/_images/web-service-consumer-emptyresponse.png) In the **Configuration XML** tab, the configuration looks like this: ```xml ``` ## 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 ``` ## See Also - [Salesforce Help](https://help.salesforce.com) - [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/1.12/web-service-consumer-reference) --- product: Web Service Consumer Connector version: 2.0 --- # 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/2.0/_images/web-service-consumer-configure-transport.png) In the **Configuration XML** tab, the reference of the HTTP Requester configuration `` is under the Web Service Consumer configuration ``: ```xml ``` ### Handling SOAP Faults with Custom HTTP Configurations When using a custom HTTP Request configuration as your transport, the HTTP requester’s default behavior is to treat status codes like `500 Internal Server Error` as failures. Because many SOAP services return `SOAP Faults` with a 500 status code, the custom transport may throw an `HTTP:INTERNAL_SERVER_ERROR` before the Web Service Consumer Connector can parse the SOAP body. To ensure that the Web Service Consumer Connector correctly receives and processes the SOAP Fault, you must configure the **Response validator** in your HTTP Request configuration to accept a broader range of status codes, typically `100..500`. The following example illustrates how to capture the SOAP Fault when Web Service Consumer Connector uses custom HTTP Requester configuration: 1. In the **HTTP Request configuration** window, navigate to the **Settings** tab. 2. In the **Response options** section, set the **Response validator** field to `Success status code validator`. 3. In the **Values** field, enter `100..500`. In Studio, configuring the response validator for custom HTTP transport looks like this: ![Configure HTTP Response Validator](/mulesoft/current/en-us/web-service-consumer-connector/2.0/_images/web-service-consumer-configure-response-validator.png) In the **Configuration XML** tab, the configuration looks like this: ```xml ``` ## 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/2.0/_images/web-service-consumer-configure-wsecurity.png) In the **Configuration XML** tab, configuring Web Service Security looks like this: ```xml ``` ## 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/2.0/_images/web-service-consumer-emptyresponse.png) In the **Configuration XML** tab, the configuration looks like this: ```xml ``` ## 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 ``` ## See Also - [Salesforce Help](https://help.salesforce.com) - [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/2.0/web-service-consumer-reference) --- product: Web Service Consumer Connector version: 2.1 --- # 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/2.1/_images/web-service-consumer-configure-transport.png) In the **Configuration XML** tab, the reference of the HTTP Requester configuration `` is under the Web Service Consumer configuration ``: ```xml ``` ### Handling SOAP Faults with Custom HTTP Configurations When using a custom HTTP Request configuration as your transport, the HTTP requester’s default behavior is to treat status codes like `500 Internal Server Error` as failures. Because many SOAP services return `SOAP Faults` with a 500 status code, the custom transport may throw an `HTTP:INTERNAL_SERVER_ERROR` before the Web Service Consumer Connector can parse the SOAP body. To ensure that the Web Service Consumer Connector correctly receives and processes the SOAP Fault, you must configure the **Response validator** in your HTTP Request configuration to accept a broader range of status codes, typically `100..500`. The following example illustrates how to capture the SOAP Fault when Web Service Consumer Connector uses custom HTTP Requester configuration: 1. In the **HTTP Request configuration** window, navigate to the **Settings** tab. 2. In the **Response options** section, set the **Response validator** field to `Success status code validator`. 3. In the **Values** field, enter `100..500`. In Studio, configuring the response validator for custom HTTP transport looks like this: ![Configure HTTP Response Validator](/mulesoft/current/en-us/web-service-consumer-connector/2.1/_images/web-service-consumer-configure-response-validator.png) In the **Configuration XML** tab, the configuration looks like this: ```xml ``` ## 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/2.1/_images/web-service-consumer-configure-wsecurity.png) In the **Configuration XML** tab, configuring Web Service Security looks like this: ```xml ``` ## 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/2.1/_images/web-service-consumer-emptyresponse.png) In the **Configuration XML** tab, the configuration looks like this: ```xml ``` ## 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 ``` ## See Also - [Salesforce Help](https://help.salesforce.com) - [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/2.1/web-service-consumer-reference) --- product: Web Service Consumer Connector version: 2.2 is-latest-version: true --- # 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/latest/_images/web-service-consumer-configure-transport.png) In the **Configuration XML** tab, the reference of the HTTP Requester configuration `` is under the Web Service Consumer configuration ``: ```xml ``` ### Handling SOAP Faults with Custom HTTP Configurations When using a custom HTTP Request configuration as your transport, the HTTP requester’s default behavior is to treat status codes like `500 Internal Server Error` as failures. Because many SOAP services return `SOAP Faults` with a 500 status code, the custom transport may throw an `HTTP:INTERNAL_SERVER_ERROR` before the Web Service Consumer Connector can parse the SOAP body. To ensure that the Web Service Consumer Connector correctly receives and processes the SOAP Fault, you must configure the **Response validator** in your HTTP Request configuration to accept a broader range of status codes, typically `100..500`. The following example illustrates how to capture the SOAP Fault when Web Service Consumer Connector uses custom HTTP Requester configuration: 1. In the **HTTP Request configuration** window, navigate to the **Settings** tab. 2. In the **Response options** section, set the **Response validator** field to `Success status code validator`. 3. In the **Values** field, enter `100..500`. In Studio, configuring the response validator for custom HTTP transport looks like this: ![Configure HTTP Response Validator](/mulesoft/current/en-us/web-service-consumer-connector/latest/_images/web-service-consumer-configure-response-validator.png) In the **Configuration XML** tab, the configuration looks like this: ```xml ``` ## 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/latest/_images/web-service-consumer-configure-wsecurity.png) In the **Configuration XML** tab, configuring Web Service Security looks like this: ```xml ``` ## 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/latest/_images/web-service-consumer-emptyresponse.png) In the **Configuration XML** tab, the configuration looks like this: ```xml ``` ## 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 ``` ## See Also - [Salesforce Help](https://help.salesforce.com) - [Web Service Consumer Connector Reference](https://docs.mulesoft.com/web-service-consumer-connector/latest/web-service-consumer-reference) --- product: Web Service Consumer Connector version: 1.11 --- # Web Service Consumer Connector 1.11 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for Web Service Consumer (Web Service Consumer Connector) consumes a SOAP web service from a Mule app to acquire data from an external source. In many cases, you can use Anypoint Connector for Workday (Workday Connector) or Anypoint Connector for ServiceNow (ServiceNow Connector) to connect to a service provider, however, when no connector is available for a specific web service, the easiest way to consume the service is to use the Web Service Consumer Connector. The main features of the connector include: - Ability to consume DOC literal web services - Use of SOAP multipart messages - Use of SOAP headers - Support for a DataSense for SOAP headers, SOAP body, and attachments - Use of embedded DataWeave transformations inside the operation - Support for a unified experience for SOAP with attachments and MTOM handling - Custom HTTP configuration as a transport - Support for Web Service Security (WS Security) > [!NOTE] Web Service Consumer Connector doesn’t support RPC WSDLs (Remote procedure call Web > Service Descripting Language). ## Before You Begin To use this connector, you must be familiar with: - SOAP and WSDLs - Anypoint Connectors - Mule runtime engine (Mule) - Elements in a Mule flow - Global elements - DataWeave - Creating a Mule app using Anypoint Studio Before creating an app, you must have access to Anypoint Studio. ## Next Step After you complete the prerequisites, you are ready to create an app and configure the connector using [Anypoint Studio](https://docs.mulesoft.com/web-service-consumer-connector/1.11/web-service-consumer-studio). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Use Exchange to Discover Connectors, Templates, and Examples](https://docs.mulesoft.com/connectors/introduction/intro-use-exchange) - [Web Service Consumer in Exchange](https://anypoint.mulesoft.com/exchange/org.mule.connectors/mule-wsc-connector/) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 1.12 --- # Web Service Consumer Connector 1.12 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for Web Service Consumer (Web Service Consumer Connector) consumes a SOAP web service from a Mule app to acquire data from an external source. In many cases, you can use Anypoint Connector for Workday (Workday Connector) or Anypoint Connector for ServiceNow (ServiceNow Connector) to connect to a service provider, however, when no connector is available for a specific web service, the easiest way to consume the service is to use the Web Service Consumer Connector. The main features of the connector include: - Ability to consume DOC literal web services - Use of SOAP multipart messages - Use of SOAP headers - Support for a DataSense for SOAP headers, SOAP body, and attachments - Use of embedded DataWeave transformations inside the operation - Support for a unified experience for SOAP with attachments and MTOM handling - Custom HTTP configuration as a transport - Support for Web Service Security (WS Security) > [!NOTE] Web Service Consumer Connector doesn’t support RPC WSDLs (Remote procedure call Web > Service Descripting Language). ## Before You Begin To use this connector, you must be familiar with: - SOAP and WSDLs - Anypoint Connectors - Mule runtime engine (Mule) - Elements in a Mule flow - Global elements - DataWeave - Creating a Mule app using Anypoint Studio Before creating an app, you must have access to Anypoint Studio. ## Next Step After you complete the prerequisites, you are ready to create an app and configure the connector using [Anypoint Studio](https://docs.mulesoft.com/web-service-consumer-connector/1.12/web-service-consumer-studio). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Use Exchange to Discover Connectors, Templates, and Examples](https://docs.mulesoft.com/connectors/introduction/intro-use-exchange) - [Web Service Consumer in Exchange](https://anypoint.mulesoft.com/exchange/org.mule.connectors/mule-wsc-connector/) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 1.12 --- # Web Service Consumer Connector 1.12 Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for Web Service Consumer (Web Service Consumer Connector) consumes a SOAP Web service to acquire data from an external source. Release Notes: [Web Service Consumer Release Notes](https://docs.mulesoft.com/release-notes/connector/connector-wsc) ## Configurations --- ### Config Default configuration #### Parameters
NameTypeDescriptionDefault ValueRequired

Name

String

Name for this configuration. Connectors reference the configuration with this name.

x

Connection

The connection types to provide to this configuration.

x

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

#### Connection Types ##### Connection ConnectionProvider that returns instances of WscSoapClient. ###### Parameters
NameTypeDescriptionDefault ValueRequired

Soap Version

Enumeration, one of:

  • SOAP11

  • SOAP12

The soap version of the WSDL.

SOAP11

Mtom Enabled

Boolean

If should use the MTOM protocol to manage the attachments or not.

false

Encoding

String

Default character encoding to use in all the messages. If not specified, the default charset in the mule configuration will be used

Transport Configuration

The transport configuration used to dispatch the SOAP messages.

Wsdl Location

String

The WSDL file URL remote or local.

x

Service

String

The service name.

x

Port

String

The port name.

x

Address

String

The address of the web service.

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy

Sign Security Strategy

A sign WSS configuration

Verify Signature Security Strategy

A verify signature WSS configuration

Username Token Security Strategy

A usernameToken WSS configuration

Outgoing Timestamp Security Strategy

A timestamp WSS configuration

Decrypt Security Strategy

A decrypt WSS configuration

Encrypt Security Strategy

an encrypt WSS configuration

Incoming Timestamp Security Strategy

A timestamp verification WSS configuration

Must Understand

Boolean

Whether mustUnderstand attribute in wsse:Security header is true or false. Defaults to true TODO (W-11800462): For the next major (v2.0.0) the default value should be false to match the SOAP protocol standard.

true

Actor

String

A SOAP message may travel from a sender to a receiver by passing different endpoints along the message path. The SOAP actor attribute is used to address the wsse:Security header to a specific endpoint. This parameter values must be a URI.

Security Headers Order

Enumeration, one of:

  • TimestampAtEnd

  • TimestampAtStart

Select the order of outgoing WS-Security tags.

## Supported Operations - [Consume](#consume) ## Operations ### Consume `` Consumes an operation from a SOAP Web Service. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Operation

String

The name of the web service operation that aims to invoke.

x

Body

Binary

The XML body to include in the SOAP message, with all the required parameters, or null if no params are required.

#[payload]

Headers

Binary

The XML headers to include in the SOAP message.

Attachments

Object

The attachments to include in the SOAP request.

Headers

Object

A group of transport headers that will be bounded with the transport request.

Force XML Prolog into body

Boolean

If true, the XML Prolog statement will be appended to the request’s body.

false

Target Variable

String

Name of the variable that storesoperation’s output will be placed

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

#### Output

Type

SOAP Output Envelope

Attributes Type

### For Configurations - [Config](#config) #### Throws - WSC:SOAP\_FAULT - WSC:EMPTY\_RESPONSE - WSC:TIMEOUT - WSC:BAD\_RESPONSE - WSC:BAD\_REQUEST - WSC:CONNECTIVITY - WSC:CANNOT\_DISPATCH - WSC:RETRY\_EXHAUSTED - WSC:INVALID\_WSDL - WSC:ENCODING ## Types ### Reconnection Configures a reconnection strategy for an operation.
FieldTypeDescriptionDefault ValueRequired

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Reconnection Strategy

Reconnection strategy to use.

### Reconnect
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often to attempt to reconnect, in milliseconds.

Count

Number

How many reconnection attempts the Mule app can make.

### Reconnect Forever
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often to attempt to reconnect, in milliseconds.

### WSS Sign Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Key Store Configuration

The keystore to use when signing the message.

x

Sign Algorithm Configuration

The algorithms to use on the signing.

### WSS Key Store Configuration
FieldTypeDescriptionDefault ValueRequired

Key Store Path

String

x

Alias

String

x

Password

String

Password to authenticate against the proxy server.

x

Key Password

String

Type

String

jks

### WSS Sign Configuration Adapter
FieldTypeDescriptionDefault ValueRequired

Signature Key Identifier

Enumeration, one of:

  • ISSUER_SERIAL

  • DIRECT_REFERENCE

  • X509_KEY_IDENTIFIER

  • THUMBPRINT

  • SKI_KEY_IDENTIFIER

  • KEY_VALUE

ISSUER_SERIAL

Signature Algorithm

Enumeration, one of:

  • RSAwithSHA256

  • ECDSAwithSHA256

  • DSAwithSHA1

  • RSAwithSHA1

  • RSAwithSHA224

  • RSAwithSHA384

  • RSAwithSHA512

  • ECDSAwithSHA1

  • ECDSAwithSHA224

  • ECDSAwithSHA384

  • ECDSAwithSHA512

  • DSAwithSHA256

Signature Digest Algorithm

Enumeration, one of:

  • SHA1

  • SHA256

  • SHA224

  • SHA384

  • SHA512

SHA1

Signature C14n Algorithm

Enumeration, one of:

  • CanonicalXML_1_0

  • CanonicalXML_1_1

  • ExclusiveXMLCanonicalization_1_0

ExclusiveXMLCanonicalization_1_0

Wss Parts

Array of WSS Part

### WSS Part
FieldTypeDescriptionDefault ValueRequired

Encode

Enumeration, one of:

  • ELEMENT

  • CONTENT

CONTENT

Namespace

String

x

Localname

String

x

### WSS Verify Signature Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Trust Store Configuration

The truststore to use to verify the signature.

### WSS Trust Store Configuration
FieldTypeDescriptionDefault ValueRequired

Trust Store Path

String

x

Password

String

Password to authenticate against the proxy server.

x

Type

String

jks

### Wss Username Token Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Username

String

The username required to authenticate with the service.

x

Password

String

The password for the provided username required to authenticate with the service.

x

Password Type

Enumeration, one of:

  • DIGEST

  • TEXT

A #password parameter.

TEXT

Add Nonce

Boolean

Specifies a if a cryptographically random nonce should be added to the message.

false

Add Created

Boolean

Specifies if a timestamp should be created to indicate the creation time of the message.

false

### WSS Timestamp Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Time To Live

Number

The time difference between creation and expiry time in the time unit specified in timeToLiveUnit. After this time the message is invalid.

This parameter values must be greater or equal to 1 second (or similar in other unit). Values lower than 1 second will end up
in 1 second timestamp.

60

Time To Live Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A #timeToLive parameter.

Defaults to SECONDS

SECONDS

### WSS Decrypt Security Strategy
FieldTypeDescriptionDefault ValueRequired

Key Store Configuration

The keystore to use when decrypting the message.

x

### WSS Encrypt Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Key Store Configuration

The keystore to use when encrypting the message.

x

Encryption Algorithms Configuration

### WSS Encryption Algorithms Configuration
FieldTypeDescriptionDefault ValueRequired

Encryption Key Identifier

Enumeration, one of:

  • ISSUER_SERIAL

  • DIRECT_REFERENCE

  • X509_KEY_IDENTIFIER

  • THUMBPRINT

  • SKI_KEY_IDENTIFIER

  • ENCRYPTED_KEY_SHA1

  • EMBEDDED_KEY_NAME

ISSUER_SERIAL

Encryption Sym Algorithm

Enumeration, one of:

  • TRIPLE_DES

  • AES_128

  • AES_256

  • AES_192

  • AES_128_GCM

  • AES_192_GCM

  • AES_256_GCM

AES_128

Encryption Key Transport Algorithm

Enumeration, one of:

  • KEYTRANSPORT_RSA15

  • KEYTRANSPORT_RSAOAEP

  • KEYTRANSPORT_RSAOAEP_XENC11

KEYTRANSPORT_RSAOAEP

Encryption Digest Algorithm

Enumeration, one of:

  • SHA1

  • SHA256

  • SHA384

  • SHA512

SHA1

Wss Part Adapters

Array of WSS Part

### WSS Incoming Timestamp Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Future Time To Live

Number

Specifies the time in the future within which the Created time of an incoming Timestamp is valid. The default value is "60", to avoid problems where clocks are slightly askew. To reject all future-created Timestamps, set this value to "0".

60

Future Time To Live Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A #futureTimeToLive parameter.

Defaults to SECONDS

SECONDS

### Expiration Policy Configures an expiration policy strategy.
FieldTypeDescriptionDefault ValueRequired

Max Idle Time

Number

Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Idle Time field.

### SOAP Output Envelope
FieldTypeDescriptionDefault ValueRequired

Attachments

Object

Body

Binary

Headers

Object

Map of HTTP headers in the message.

### SOAP Attributes
FieldTypeDescriptionDefault ValueRequired

Protocol Headers

Object

The protocol headers bundled in the response.

x

Additional Transport Data

Object

The additional transport data bundled in the response.

x

### HTTP Transport Configuration
FieldTypeDescriptionDefault ValueRequired

Requester Config

String

x

### Default HTTP Transport Configuration
FieldTypeDescriptionDefault ValueRequired

Timeout

Number

5000

--- product: Web Service Consumer Connector version: 2.0 --- # Web Service Consumer Connector 2.0 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for Web Service Consumer (Web Service Consumer Connector) consumes a SOAP web service from a Mule app to acquire data from an external source. In many cases, you can use Anypoint Connector for Workday (Workday Connector) or Anypoint Connector for ServiceNow (ServiceNow Connector) to connect to a service provider, however, when no connector is available for a specific web service, the easiest way to consume the service is to use the Web Service Consumer Connector. The main features of the connector include: - Ability to consume DOC literal web services - Use of SOAP multipart messages - Use of SOAP headers - Support for a DataSense for SOAP headers, SOAP body, and attachments - Use of embedded DataWeave transformations inside the operation - Support for a unified experience for SOAP with attachments and MTOM handling - Custom HTTP configuration as a transport - Support for Web Service Security (WS Security) > [!NOTE] Web Service Consumer Connector doesn’t support RPC WSDLs (Remote procedure call Web > Service Descripting Language). ## Before You Begin To use this connector, you must be familiar with: - SOAP and WSDLs - Anypoint Connectors - Mule runtime engine (Mule) - Elements in a Mule flow - Global elements - DataWeave - Creating a Mule app using Anypoint Studio Before creating an app, you must have access to Anypoint Studio. ## Next Step After you complete the prerequisites, you are ready to create an app and configure the connector using [Anypoint Studio](https://docs.mulesoft.com/web-service-consumer-connector/2.0/web-service-consumer-studio). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Use Exchange to Discover Connectors, Templates, and Examples](https://docs.mulesoft.com/connectors/introduction/intro-use-exchange) - [Web Service Consumer in Exchange](https://anypoint.mulesoft.com/exchange/org.mule.connectors/mule-wsc-connector/) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 2.0 --- # Web Service Consumer Connector 2.0 Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for Web Service Consumer (Web Service Consumer Connector) consumes a SOAP Web service to acquire data from an external source. Release Notes: [Web Service Consumer Release Notes](https://docs.mulesoft.com/release-notes/connector/connector-wsc) ## Configurations --- ### Config Default configuration #### Parameters
NameTypeDescriptionDefault ValueRequired

Name

String

Name for this configuration. Connectors reference the configuration with this name.

x

Connection

The connection types to provide to this configuration.

x

Name

String

The identifier of this element used to reference it in other components.

x

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

#### Connection Types ##### Connection ConnectionProvider that returns instances of WscSoapClient. ###### Parameters
NameTypeDescriptionDefault ValueRequired

Soap Version

Enumeration, one of:

  • SOAP11

  • SOAP12

The soap version of the WSDL.

SOAP11

Mtom Enabled

Boolean

If should use the MTOM protocol to manage the attachments or not.

false

Encoding

String

Default character encoding to use in all the messages. If not specified, the default charset in the mule configuration will be used

Transport Configuration

The transport configuration used to dispatch the SOAP messages.

Wsdl Location

String

The WSDL file URL remote or local.

x

Service

String

The service name.

x

Port

String

The port name.

x

Address

String

The address of the web service.

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy

Sign Security Strategy

A sign WSS configuration

Verify Signature Security Strategy

A verify signature WSS configuration

Username Token Security Strategy

A usernameToken WSS configuration

Outgoing Timestamp Security Strategy

A timestamp WSS configuration

Decrypt Security Strategy

A decrypt WSS configuration

Encrypt Security Strategy

an encrypt WSS configuration

Incoming Timestamp Security Strategy

A timestamp verification WSS configuration

Must Understand

Boolean

Whether mustUnderstand attribute in wsse:Security header is true or false. Defaults to true TODO (W-11800462): For the next major (v2.0.0) the default value should be false to match the SOAP protocol standard.

true

Actor

String

A SOAP message may travel from a sender to a receiver by passing different endpoints along the message path. The SOAP actor attribute is used to address the wsse:Security header to a specific endpoint. This parameter values must be a URI.

Security Headers Order

Enumeration, one of:

  • TimestampAtEnd

  • TimestampAtStart

Select the order of outgoing WS-Security tags.

## Supported Operations - [Consume](#consume) ## Operations ### Consume `` Consumes an operation from a SOAP Web Service. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Operation

String

The name of the web service operation that aims to invoke.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Body

Binary

The XML body to include in the SOAP message, with all the required parameters, or null if no params are required.

#[payload]

Headers

Binary

The XML headers to include in the SOAP message.

Attachments

Object

The attachments to include in the SOAP request.

Headers

Object

A group of transport headers that will be bounded with the transport request.

Force XML Prolog into body

Boolean

If true, the XML Prolog statement will be appended to the request’s body.

false

Target Variable

String

Name of the variable that storesoperation’s output will be placed

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

Reconnection Strategy

Retry strategy in case of connectivity errors.

#### Output

Type

SOAP Output Envelope

Attributes Type

### For Configurations - [Config](#config) #### Throws - WSC:SOAP\_FAULT - WSC:EMPTY\_RESPONSE - WSC:TIMEOUT - WSC:BAD\_RESPONSE - WSC:BAD\_REQUEST - WSC:CONNECTIVITY - WSC:CANNOT\_DISPATCH - WSC:RETRY\_EXHAUSTED - WSC:INVALID\_WSDL - WSC:ENCODING ## Types ### Reconnection Configures a reconnection strategy for an operation.
FieldTypeDescriptionDefault ValueRequired

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Reconnection Strategy

Reconnection strategy to use.

### Reconnect
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often to attempt to reconnect, in milliseconds.

Blocking

Boolean

If false, the reconnection strategy runs in a separate, non-blocking thread.

Count

Number

How many reconnection attempts the Mule app can make.

### Reconnect Forever
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often to attempt to reconnect, in milliseconds.

Blocking

Boolean

If false, the reconnection strategy runs in a separate, non-blocking thread.

### WSS Sign Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Key Store Configuration

The keystore to use when signing the message.

x

Sign Algorithm Configuration

The algorithms to use on the signing.

### WSS Key Store Configuration
FieldTypeDescriptionDefault ValueRequired

Key Store Path

String

x

Alias

String

x

Password

String

Password to authenticate against the proxy server.

x

Key Password

String

Type

String

jks

### WSS Sign Configuration Adapter
FieldTypeDescriptionDefault ValueRequired

Signature Key Identifier

Enumeration, one of:

  • ISSUER_SERIAL

  • DIRECT_REFERENCE

  • X509_KEY_IDENTIFIER

  • THUMBPRINT

  • SKI_KEY_IDENTIFIER

  • KEY_VALUE

ISSUER_SERIAL

Signature Algorithm

Enumeration, one of:

  • RSAwithSHA256

  • ECDSAwithSHA256

  • DSAwithSHA1

  • RSAwithSHA1

  • RSAwithSHA224

  • RSAwithSHA384

  • RSAwithSHA512

  • ECDSAwithSHA1

  • ECDSAwithSHA224

  • ECDSAwithSHA384

  • ECDSAwithSHA512

  • DSAwithSHA256

Signature Digest Algorithm

Enumeration, one of:

  • SHA1

  • SHA256

  • SHA224

  • SHA384

  • SHA512

SHA1

Signature C14n Algorithm

Enumeration, one of:

  • CanonicalXML_1_0

  • CanonicalXML_1_1

  • ExclusiveXMLCanonicalization_1_0

ExclusiveXMLCanonicalization_1_0

Wss Parts

Array of WSS Part

### WSS Part
FieldTypeDescriptionDefault ValueRequired

Encode

Enumeration, one of:

  • ELEMENT

  • CONTENT

CONTENT

Namespace

String

x

Localname

String

x

### WSS Verify Signature Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Trust Store Configuration

The truststore to use to verify the signature.

### WSS Trust Store Configuration
FieldTypeDescriptionDefault ValueRequired

Trust Store Path

String

x

Password

String

Password to authenticate against the proxy server.

x

Type

String

jks

### Wss Username Token Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Username

String

The username required to authenticate with the service.

x

Password

String

The password for the provided username required to authenticate with the service.

x

Password Type

Enumeration, one of:

  • DIGEST

  • TEXT

A #password parameter.

TEXT

Add Nonce

Boolean

Specifies a if a cryptographically random nonce should be added to the message.

false

Add Created

Boolean

Specifies if a timestamp should be created to indicate the creation time of the message.

false

### WSS Timestamp Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Time To Live

Number

The time difference between creation and expiry time in the time unit specified in timeToLiveUnit. After this time the message is invalid.

This parameter values must be greater or equal to 1 second (or similar in other unit). Values lower than 1 second will end up
in 1 second timestamp.

60

Time To Live Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A #timeToLive parameter.

Defaults to SECONDS

SECONDS

### WSS Decrypt Security Strategy
FieldTypeDescriptionDefault ValueRequired

Key Store Configuration

The keystore to use when decrypting the message.

x

### WSS Encrypt Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Key Store Configuration

The keystore to use when encrypting the message.

x

Encryption Algorithms Configuration

### WSS Encryption Algorithms Configuration
FieldTypeDescriptionDefault ValueRequired

Encryption Key Identifier

Enumeration, one of:

  • ISSUER_SERIAL

  • DIRECT_REFERENCE

  • X509_KEY_IDENTIFIER

  • THUMBPRINT

  • SKI_KEY_IDENTIFIER

  • ENCRYPTED_KEY_SHA1

  • EMBEDDED_KEY_NAME

ISSUER_SERIAL

Encryption Sym Algorithm

Enumeration, one of:

  • TRIPLE_DES

  • AES_128

  • AES_256

  • AES_192

  • AES_128_GCM

  • AES_192_GCM

  • AES_256_GCM

AES_128

Encryption Key Transport Algorithm

Enumeration, one of:

  • KEYTRANSPORT_RSA15

  • KEYTRANSPORT_RSAOAEP

  • KEYTRANSPORT_RSAOAEP_XENC11

KEYTRANSPORT_RSAOAEP

Encryption Digest Algorithm

Enumeration, one of:

  • SHA1

  • SHA256

  • SHA384

  • SHA512

SHA1

Wss Part Adapters

Array of WSS Part

### WSS Incoming Timestamp Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Future Time To Live

Number

Specifies the time in the future within which the Created time of an incoming Timestamp is valid. The default value is "60", to avoid problems where clocks are slightly askew. To reject all future-created Timestamps, set this value to "0".

60

Future Time To Live Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A #futureTimeToLive parameter.

Defaults to SECONDS

SECONDS

### Expiration Policy Configures an expiration policy strategy.
FieldTypeDescriptionDefault ValueRequired

Max Idle Time

Number

Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Idle Time field.

### SOAP Output Envelope
FieldTypeDescriptionDefault ValueRequired

Attachments

Object

Body

Binary

Headers

Object

Map of HTTP headers in the message.

### SOAP Attributes
FieldTypeDescriptionDefault ValueRequired

Protocol Headers

Object

The protocol headers bundled in the response.

x

Additional Transport Data

Object

The additional transport data bundled in the response.

x

### Error Mapping
FieldTypeDescriptionDefault ValueRequired

Source

Enumeration, one of:

  • ANY

  • REDELIVERY_EXHAUSTED

  • TRANSFORMATION

  • EXPRESSION

  • SECURITY

  • CLIENT_SECURITY

  • SERVER_SECURITY

  • ROUTING

  • CONNECTIVITY

  • RETRY_EXHAUSTED

  • TIMEOUT

Source of the error.

Target

String

Target of the error.

x

### HTTP Transport Configuration
FieldTypeDescriptionDefault ValueRequired

Requester Config

String

x

### Default HTTP Transport Configuration
FieldTypeDescriptionDefault ValueRequired

Timeout

Number

5000

--- product: Web Service Consumer Connector version: 2.1 --- # Web Service Consumer Connector 2.1 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for Web Service Consumer (Web Service Consumer Connector) consumes a SOAP web service from a Mule app to acquire data from an external source. In many cases, you can use Anypoint Connector for Workday (Workday Connector) or Anypoint Connector for ServiceNow (ServiceNow Connector) to connect to a service provider, however, when no connector is available for a specific web service, the easiest way to consume the service is to use the Web Service Consumer Connector. The main features of the connector include: - Ability to consume DOC literal web services - Use of SOAP multipart messages - Use of SOAP headers - Support for a DataSense for SOAP headers, SOAP body, and attachments - Use of embedded DataWeave transformations inside the operation - Support for a unified experience for SOAP with attachments and MTOM handling - Custom HTTP configuration as a transport - Support for Web Service Security (WS Security) > [!NOTE] Web Service Consumer Connector doesn’t support RPC WSDLs (Remote procedure call Web > Service Descripting Language). ## Before You Begin To use this connector, you must be familiar with: - SOAP and WSDLs - Anypoint Connectors - Mule runtime engine (Mule) - Elements in a Mule flow - Global elements - DataWeave - Creating a Mule app using Anypoint Studio Before creating an app, you must have access to Anypoint Studio. ## Next Step After you complete the prerequisites, you are ready to create an app and configure the connector using [Anypoint Studio](https://docs.mulesoft.com/web-service-consumer-connector/2.1/web-service-consumer-studio). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Use Exchange to Discover Connectors, Templates, and Examples](https://docs.mulesoft.com/connectors/introduction/intro-use-exchange) - [Web Service Consumer in Exchange](https://anypoint.mulesoft.com/exchange/org.mule.connectors/mule-wsc-connector/) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 2.1 --- # Web Service Consumer Connector 2.1 Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for Web Service Consumer (Web Service Consumer Connector) consumes a SOAP Web service to acquire data from an external source. Release Notes: [Web Service Consumer Release Notes](https://docs.mulesoft.com/release-notes/connector/connector-wsc) ## Configurations --- ### Config Default configuration #### Parameters
NameTypeDescriptionDefault ValueRequired

Name

String

Name for this configuration. Connectors reference the configuration with this name.

x

Connection

The connection types to provide to this configuration.

x

Name

String

The identifier of this element used to reference it in other components.

x

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

#### Connection Types ##### Connection ConnectionProvider that returns instances of WscSoapClient. ###### Parameters
NameTypeDescriptionDefault ValueRequired

Soap Version

Enumeration, one of:

  • SOAP11

  • SOAP12

The soap version of the WSDL.

SOAP11

Mtom Enabled

Boolean

If should use the MTOM protocol to manage the attachments or not.

false

Encoding

String

Default character encoding to use in all the messages. If not specified, the default charset in the mule configuration will be used

Transport Configuration

The transport configuration used to dispatch the SOAP messages.

Wsdl Location

String

The WSDL file URL remote or local.

x

Service

String

The service name.

x

Port

String

The port name.

x

Address

String

The address of the web service.

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy

Sign Security Strategy

A sign WSS configuration

Verify Signature Security Strategy

A verify signature WSS configuration

Username Token Security Strategy

A usernameToken WSS configuration

Outgoing Timestamp Security Strategy

A timestamp WSS configuration

Decrypt Security Strategy

A decrypt WSS configuration

Encrypt Security Strategy

an encrypt WSS configuration

Incoming Timestamp Security Strategy

A timestamp verification WSS configuration

Must Understand

Boolean

Whether mustUnderstand attribute in wsse:Security header is true or false. Defaults to true TODO (W-11800462): For the next major (v2.0.0) the default value should be false to match the SOAP protocol standard.

true

Actor

String

A SOAP message may travel from a sender to a receiver by passing different endpoints along the message path. The SOAP actor attribute is used to address the wsse:Security header to a specific endpoint. This parameter values must be a URI.

Security Headers Order

Enumeration, one of:

  • TimestampAtEnd

  • TimestampAtStart

Select the order of outgoing WS-Security tags.

## Supported Operations - [Consume](#consume) ## Operations ### Consume `` Consumes an operation from a SOAP Web Service. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Operation

String

The name of the web service operation that aims to invoke.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Body

Binary

The XML body to include in the SOAP message, with all the required parameters, or null if no params are required.

#[payload]

Headers

Binary

The XML headers to include in the SOAP message.

Attachments

Object

The attachments to include in the SOAP request.

Headers

Object

A group of transport headers that will be bounded with the transport request.

Force XML Prolog into body

Boolean

If true, the XML Prolog statement will be appended to the request’s body.

false

Target Variable

String

Name of the variable that storesoperation’s output will be placed

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

Reconnection Strategy

Retry strategy in case of connectivity errors.

#### Output

Type

SOAP Output Envelope

Attributes Type

### For Configurations - [Config](#config) #### Throws - WSC:SOAP\_FAULT - WSC:EMPTY\_RESPONSE - WSC:TIMEOUT - WSC:BAD\_RESPONSE - WSC:BAD\_REQUEST - WSC:CONNECTIVITY - WSC:CANNOT\_DISPATCH - WSC:RETRY\_EXHAUSTED - WSC:INVALID\_WSDL - WSC:ENCODING ## Types ### Reconnection Configures a reconnection strategy for an operation.
FieldTypeDescriptionDefault ValueRequired

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Reconnection Strategy

Reconnection strategy to use.

### Reconnect
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often to attempt to reconnect, in milliseconds.

Blocking

Boolean

If false, the reconnection strategy runs in a separate, non-blocking thread.

Count

Number

How many reconnection attempts the Mule app can make.

### Reconnect Forever
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often to attempt to reconnect, in milliseconds.

Blocking

Boolean

If false, the reconnection strategy runs in a separate, non-blocking thread.

### WSS Sign Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Key Store Configuration

The keystore to use when signing the message.

x

Sign Algorithm Configuration

The algorithms to use on the signing.

### WSS Key Store Configuration
FieldTypeDescriptionDefault ValueRequired

Key Store Path

String

x

Alias

String

x

Password

String

Password to authenticate against the proxy server.

x

Key Password

String

Type

String

jks

### WSS Sign Configuration Adapter
FieldTypeDescriptionDefault ValueRequired

Signature Key Identifier

Enumeration, one of:

  • ISSUER_SERIAL

  • DIRECT_REFERENCE

  • X509_KEY_IDENTIFIER

  • THUMBPRINT

  • SKI_KEY_IDENTIFIER

  • KEY_VALUE

ISSUER_SERIAL

Signature Algorithm

Enumeration, one of:

  • RSAwithSHA256

  • ECDSAwithSHA256

  • DSAwithSHA1

  • RSAwithSHA1

  • RSAwithSHA224

  • RSAwithSHA384

  • RSAwithSHA512

  • ECDSAwithSHA1

  • ECDSAwithSHA224

  • ECDSAwithSHA384

  • ECDSAwithSHA512

  • DSAwithSHA256

Signature Digest Algorithm

Enumeration, one of:

  • SHA1

  • SHA256

  • SHA224

  • SHA384

  • SHA512

SHA1

Signature C14n Algorithm

Enumeration, one of:

  • CanonicalXML_1_0

  • CanonicalXML_1_1

  • ExclusiveXMLCanonicalization_1_0

ExclusiveXMLCanonicalization_1_0

Wss Parts

Array of WSS Part

Expand XOP Include

Enumeration, one of:

  • TRUE

  • FALSE

Configures whether XOP (XML-binary Optimized Packaging) includes are expanded inline within the SOAP message. If set to true, XOP includes are expanded inline. If set to false, XOP includes are not expanded. When not set, WSS4J uses its default behavior.

### WSS Part
FieldTypeDescriptionDefault ValueRequired

Encode

Enumeration, one of:

  • ELEMENT

  • CONTENT

CONTENT

Namespace

String

x

Localname

String

x

### WSS Verify Signature Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Trust Store Configuration

The truststore to use to verify the signature.

### WSS Trust Store Configuration
FieldTypeDescriptionDefault ValueRequired

Trust Store Path

String

x

Password

String

Password to authenticate against the proxy server.

x

Type

String

jks

### Wss Username Token Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Username

String

The username required to authenticate with the service.

x

Password

String

The password for the provided username required to authenticate with the service.

x

Password Type

Enumeration, one of:

  • DIGEST

  • TEXT

A #password parameter.

TEXT

Add Nonce

Boolean

Specifies a if a cryptographically random nonce should be added to the message.

false

Add Created

Boolean

Specifies if a timestamp should be created to indicate the creation time of the message.

false

### WSS Timestamp Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Time To Live

Number

The time difference between creation and expiry time in the time unit specified in timeToLiveUnit. After this time the message is invalid.

This parameter values must be greater or equal to 1 second (or similar in other unit). Values lower than 1 second will end up
in 1 second timestamp.

60

Time To Live Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A #timeToLive parameter.

Defaults to SECONDS

SECONDS

### WSS Decrypt Security Strategy
FieldTypeDescriptionDefault ValueRequired

Key Store Configuration

The keystore to use when decrypting the message.

x

### WSS Encrypt Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Key Store Configuration

The keystore to use when encrypting the message.

x

Encryption Algorithms Configuration

### WSS Encryption Algorithms Configuration
FieldTypeDescriptionDefault ValueRequired

Encryption Key Identifier

Enumeration, one of:

  • ISSUER_SERIAL

  • DIRECT_REFERENCE

  • X509_KEY_IDENTIFIER

  • THUMBPRINT

  • SKI_KEY_IDENTIFIER

  • ENCRYPTED_KEY_SHA1

  • EMBEDDED_KEY_NAME

ISSUER_SERIAL

Encryption Sym Algorithm

Enumeration, one of:

  • TRIPLE_DES

  • AES_128

  • AES_256

  • AES_192

  • AES_128_GCM

  • AES_192_GCM

  • AES_256_GCM

AES_128

Encryption Key Transport Algorithm

Enumeration, one of:

  • KEYTRANSPORT_RSA15

  • KEYTRANSPORT_RSAOAEP

  • KEYTRANSPORT_RSAOAEP_XENC11

KEYTRANSPORT_RSAOAEP

Encryption Digest Algorithm

Enumeration, one of:

  • SHA1

  • SHA256

  • SHA384

  • SHA512

SHA1

Wss Part Adapters

Array of WSS Part

### WSS Incoming Timestamp Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Future Time To Live

Number

Specifies the time in the future within which the Created time of an incoming Timestamp is valid. The default value is "60", to avoid problems where clocks are slightly askew. To reject all future-created Timestamps, set this value to "0".

60

Future Time To Live Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A #futureTimeToLive parameter.

Defaults to SECONDS

SECONDS

### Expiration Policy Configures an expiration policy strategy.
FieldTypeDescriptionDefault ValueRequired

Max Idle Time

Number

Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Idle Time field.

### SOAP Output Envelope
FieldTypeDescriptionDefault ValueRequired

Attachments

Object

Body

Binary

Headers

Object

Map of HTTP headers in the message.

### SOAP Attributes
FieldTypeDescriptionDefault ValueRequired

Protocol Headers

Object

The protocol headers bundled in the response.

x

Additional Transport Data

Object

The additional transport data bundled in the response.

x

### Error Mapping
FieldTypeDescriptionDefault ValueRequired

Source

Enumeration, one of:

  • ANY

  • REDELIVERY_EXHAUSTED

  • TRANSFORMATION

  • EXPRESSION

  • SECURITY

  • CLIENT_SECURITY

  • SERVER_SECURITY

  • ROUTING

  • CONNECTIVITY

  • RETRY_EXHAUSTED

  • TIMEOUT

Source of the error.

Target

String

Target of the error.

x

### HTTP Transport Configuration
FieldTypeDescriptionDefault ValueRequired

Requester Config

String

x

### Default HTTP Transport Configuration
FieldTypeDescriptionDefault ValueRequired

Timeout

Number

5000

--- product: Web Service Consumer Connector version: 2.2 is-latest-version: true --- # Web Service Consumer Connector 2.2 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for Web Service Consumer (Web Service Consumer Connector) consumes a SOAP web service from a Mule app to acquire data from an external source. In many cases, you can use Anypoint Connector for Workday (Workday Connector) or Anypoint Connector for ServiceNow (ServiceNow Connector) to connect to a service provider, however, when no connector is available for a specific web service, the easiest way to consume the service is to use the Web Service Consumer Connector. The main features of the connector include: - Ability to consume DOC literal web services - Use of SOAP multipart messages - Use of SOAP headers - Support for a DataSense for SOAP headers, SOAP body, and attachments - Use of embedded DataWeave transformations inside the operation - Support for a unified experience for SOAP with attachments and MTOM handling - Custom HTTP configuration as a transport - Support for Web Service Security (WS Security) > [!NOTE] Web Service Consumer Connector doesn’t support RPC WSDLs (Remote procedure call Web > Service Descripting Language). ## Before You Begin To use this connector, you must be familiar with: - SOAP and WSDLs - Anypoint Connectors - Mule runtime engine (Mule) - Elements in a Mule flow - Global elements - DataWeave - Creating a Mule app using Anypoint Studio Before creating an app, you must have access to Anypoint Studio. ## Next Step After you complete the prerequisites, you are ready to create an app and configure the connector using [Anypoint Studio](https://docs.mulesoft.com/web-service-consumer-connector/latest/web-service-consumer-studio). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Use Exchange to Discover Connectors, Templates, and Examples](https://docs.mulesoft.com/connectors/introduction/intro-use-exchange) - [Web Service Consumer in Exchange](https://anypoint.mulesoft.com/exchange/org.mule.connectors/mule-wsc-connector/) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 2.2 is-latest-version: true --- # Web Service Consumer Connector 2.2 Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for Web Service Consumer (Web Service Consumer Connector) consumes a SOAP Web service to acquire data from an external source. Release Notes: [Web Service Consumer Release Notes](https://docs.mulesoft.com/release-notes/connector/connector-wsc) ## Configurations --- ### Config Default configuration #### Parameters
NameTypeDescriptionDefault ValueRequired

Name

String

Name for this configuration. Connectors reference the configuration with this name.

x

Connection

The connection types to provide to this configuration.

x

Name

String

The identifier of this element used to reference it in other components.

x

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

#### Connection Types ##### Connection ConnectionProvider that returns instances of WscSoapClient. ###### Parameters
NameTypeDescriptionDefault ValueRequired

Soap Version

Enumeration, one of:

  • SOAP11

  • SOAP12

The soap version of the WSDL.

SOAP11

Mtom Enabled

Boolean

If should use the MTOM protocol to manage the attachments or not.

false

Encoding

String

Default character encoding to use in all the messages. If not specified, the default charset in the mule configuration will be used

Transport Configuration

The transport configuration used to dispatch the SOAP messages.

Wsdl Location

String

The WSDL file URL remote or local.

x

Service

String

The service name.

x

Port

String

The port name.

x

Address

String

The address of the web service.

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy

Sign Security Strategy

A sign WSS configuration

Verify Signature Security Strategy

A verify signature WSS configuration

Username Token Security Strategy

A usernameToken WSS configuration

Outgoing Timestamp Security Strategy

A timestamp WSS configuration

Decrypt Security Strategy

A decrypt WSS configuration

Encrypt Security Strategy

an encrypt WSS configuration

Incoming Timestamp Security Strategy

A timestamp verification WSS configuration

Must Understand

Boolean

Value of the mustUnderstand attribute in WS-Security header.

true

Actor

String

A SOAP message may travel from a sender to a receiver by passing different endpoints along the message path. The SOAP actor attribute is used to address the wsse:Security header to a specific endpoint. This parameter values must be a URI.

Security Headers Order

Enumeration, one of:

  • TimestampAtEnd

  • TimestampAtStart

Select the order of outgoing WS-Security tags.

## Supported Operations - [Consume](#consume) ## Operations ### Consume `` Consumes an operation from a SOAP Web Service. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Operation

String

The name of the web service operation that aims to invoke.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Body

Binary

The XML body to include in the SOAP message, with all the required parameters, or null if no params are required.

#[payload]

Headers

Binary

The XML headers to include in the SOAP message.

Attachments

Object

The attachments to include in the SOAP request.

Headers

Object

A group of transport headers that will be bounded with the transport request.

Force XML Prolog into body

Boolean

If true, the XML Prolog statement will be appended to the request’s body.

false

Target Variable

String

Name of the variable that storesoperation’s output will be placed

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

Reconnection Strategy

Retry strategy in case of connectivity errors.

#### Output

Type

SOAP Output Envelope

Attributes Type

### For Configurations - [Config](#config) #### Throws - WSC:BAD\_REQUEST - WSC:BAD\_RESPONSE - WSC:CANNOT\_DISPATCH - WSC:CONNECTIVITY - WSC:EMPTY\_RESPONSE - WSC:ENCODING - WSC:INVALID\_WSDL - WSC:RETRY\_EXHAUSTED - WSC:SECURITY - WSC:SOAP\_FAULT - WSC:TIMEOUT ## Types ### Reconnection Configures a reconnection strategy for an operation.
FieldTypeDescriptionDefault ValueRequired

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Reconnection Strategy

Reconnection strategy to use.

### Reconnect
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often to attempt to reconnect, in milliseconds.

Blocking

Boolean

If false, the reconnection strategy runs in a separate, non-blocking thread.

Count

Number

How many reconnection attempts the Mule app can make.

### Reconnect Forever
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often to attempt to reconnect, in milliseconds.

Blocking

Boolean

If false, the reconnection strategy runs in a separate, non-blocking thread.

### WSS Sign Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Key Store Configuration

The keystore to use when signing the message.

x

Sign Algorithm Configuration

The algorithms to use on the signing.

### WSS Key Store Configuration
FieldTypeDescriptionDefault ValueRequired

Key Store Path

String

x

Alias

String

x

Password

String

Password to authenticate against the proxy server.

x

Key Password

String

Type

String

jks

### WSS Sign Configuration Adapter
FieldTypeDescriptionDefault ValueRequired

Signature Key Identifier

Enumeration, one of:

  • ISSUER_SERIAL

  • DIRECT_REFERENCE

  • X509_KEY_IDENTIFIER

  • THUMBPRINT

  • SKI_KEY_IDENTIFIER

  • KEY_VALUE

ISSUER_SERIAL

Signature Algorithm

Enumeration, one of:

  • RSAwithSHA256

  • ECDSAwithSHA256

  • DSAwithSHA1

  • RSAwithSHA1

  • RSAwithSHA224

  • RSAwithSHA384

  • RSAwithSHA512

  • ECDSAwithSHA1

  • ECDSAwithSHA224

  • ECDSAwithSHA384

  • ECDSAwithSHA512

  • DSAwithSHA256

Signature Digest Algorithm

Enumeration, one of:

  • SHA1

  • SHA256

  • SHA224

  • SHA384

  • SHA512

SHA1

Signature C14n Algorithm

Enumeration, one of:

  • CanonicalXML_1_0

  • CanonicalXML_1_1

  • ExclusiveXMLCanonicalization_1_0

ExclusiveXMLCanonicalization_1_0

Wss Parts

Array of WSS Part

Expand XOP Include

Enumeration, one of:

  • TRUE

  • FALSE

Configures whether XOP (XML-binary Optimized Packaging) includes are expanded inline within the SOAP message. If set to true, XOP includes are expanded inline. If set to false, XOP includes are not expanded. When not set, WSS4J uses its default behavior.

### WSS Part
FieldTypeDescriptionDefault ValueRequired

Encode

Enumeration, one of:

  • ELEMENT

  • CONTENT

CONTENT

Namespace

String

x

Localname

String

x

### WSS Verify Signature Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Trust Store Configuration

The truststore to use to verify the signature.

### WSS Trust Store Configuration
FieldTypeDescriptionDefault ValueRequired

Trust Store Path

String

x

Password

String

Password to authenticate against the proxy server.

x

Type

String

jks

### Wss Username Token Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Username

String

The username required to authenticate with the service.

x

Password

String

The password for the provided username required to authenticate with the service.

x

Password Type

Enumeration, one of:

  • DIGEST

  • TEXT

A #password parameter.

TEXT

Add Nonce

Boolean

Specifies a if a cryptographically random nonce should be added to the message.

false

Add Created

Boolean

Specifies if a timestamp should be created to indicate the creation time of the message.

false

### WSS Timestamp Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Time To Live

Number

The time difference between creation and expiry time in the time unit specified in timeToLiveUnit. After this time the message is invalid.

This parameter values must be greater or equal to 1 second (or similar in other unit). Values lower than 1 second will end up
in 1 second timestamp.

60

Time To Live Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A #timeToLive parameter.

Defaults to SECONDS

SECONDS

### WSS Decrypt Security Strategy
FieldTypeDescriptionDefault ValueRequired

Key Store Configuration

The keystore to use when decrypting the message.

x

### WSS Encrypt Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Key Store Configuration

The keystore to use when encrypting the message.

x

Encryption Algorithms Configuration

### WSS Encryption Algorithms Configuration
FieldTypeDescriptionDefault ValueRequired

Encryption Key Identifier

Enumeration, one of:

  • ISSUER_SERIAL

  • DIRECT_REFERENCE

  • X509_KEY_IDENTIFIER

  • THUMBPRINT

  • SKI_KEY_IDENTIFIER

  • ENCRYPTED_KEY_SHA1

  • EMBEDDED_KEY_NAME

ISSUER_SERIAL

Encryption Sym Algorithm

Enumeration, one of:

  • TRIPLE_DES

  • AES_128

  • AES_256

  • AES_192

  • AES_128_GCM

  • AES_192_GCM

  • AES_256_GCM

AES_128

Encryption Key Transport Algorithm

Enumeration, one of:

  • KEYTRANSPORT_RSA15

  • KEYTRANSPORT_RSAOAEP

  • KEYTRANSPORT_RSAOAEP_XENC11

KEYTRANSPORT_RSAOAEP

Encryption Digest Algorithm

Enumeration, one of:

  • SHA1

  • SHA256

  • SHA384

  • SHA512

SHA1

Wss Part Adapters

Array of WSS Part

### WSS Incoming Timestamp Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Future Time To Live

Number

Specifies the time in the future within which the Created time of an incoming Timestamp is valid. The default value is "60", to avoid problems where clocks are slightly askew. To reject all future-created Timestamps, set this value to "0".

60

Future Time To Live Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A #futureTimeToLive parameter.

Defaults to SECONDS

SECONDS

### Expiration Policy Configures an expiration policy strategy.
FieldTypeDescriptionDefault ValueRequired

Max Idle Time

Number

Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Idle Time field.

### SOAP Output Envelope
FieldTypeDescriptionDefault ValueRequired

Attachments

Object

Body

Binary

Headers

Object

Map of HTTP headers in the message.

### SOAP Attributes
FieldTypeDescriptionDefault ValueRequired

Protocol Headers

Object

The protocol headers bundled in the response.

x

Additional Transport Data

Object

The additional transport data bundled in the response.

x

### Error Mapping
FieldTypeDescriptionDefault ValueRequired

Source

Enumeration, one of:

  • ANY

  • REDELIVERY_EXHAUSTED

  • TRANSFORMATION

  • EXPRESSION

  • SECURITY

  • CLIENT_SECURITY

  • SERVER_SECURITY

  • ROUTING

  • CONNECTIVITY

  • RETRY_EXHAUSTED

  • TIMEOUT

Source of the error.

Target

String

Target of the error.

x

### HTTP Transport Configuration
FieldTypeDescriptionDefault ValueRequired

Requester Config

String

x

### Default HTTP Transport Configuration
FieldTypeDescriptionDefault ValueRequired

Timeout

Number

5000

--- product: Web Service Consumer Connector version: 1.11 --- # Web Service Consumer Connector Examples > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following examples illustrate how to configure Anypoint Connector for Web Service Consumer (Web Service Consumer) Connector operations both in Anypoint Studio and the XML editor. - [Web Service Consumer Connector Example 1](https://docs.mulesoft.com/web-service-consumer-connector/1.11/web-service-example-1) This example transforms a variable value into XML and pass that value to the Web Service Consumer Connector, which subsequently consumes a web service. - [Web Service Consumer Connector Example 2](https://docs.mulesoft.com/web-service-consumer-connector/1.11/web-service-example-2) This example list an inventory of t-shirts and the Web Service Consumer Connector returns if there is an error such as `BAD_RESPONSE` or `EMPTY_RESPONSE`. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 1.12 --- # Web Service Consumer Connector Examples > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following examples illustrate how to configure Anypoint Connector for Web Service Consumer (Web Service Consumer) Connector operations both in Anypoint Studio and the XML editor. - [Web Service Consumer Connector Example 1](https://docs.mulesoft.com/web-service-consumer-connector/1.12/web-service-example-1) This example transforms a variable value into XML and pass that value to the Web Service Consumer Connector, which subsequently consumes a web service. - [Web Service Consumer Connector Example 2](https://docs.mulesoft.com/web-service-consumer-connector/1.12/web-service-example-2) This example list an inventory of t-shirts and the Web Service Consumer Connector returns if there is an error such as `BAD_RESPONSE` or `EMPTY_RESPONSE`. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 2.0 --- # Web Service Consumer Connector Examples > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following examples illustrate how to configure Anypoint Connector for Web Service Consumer (Web Service Consumer) Connector operations both in Anypoint Studio and the XML editor. - [Web Service Consumer Connector Example 1](https://docs.mulesoft.com/web-service-consumer-connector/2.0/web-service-example-1) This example transforms a variable value into XML and pass that value to the Web Service Consumer Connector, which subsequently consumes a web service. - [Web Service Consumer Connector Example 2](https://docs.mulesoft.com/web-service-consumer-connector/2.0/web-service-example-2) This example list an inventory of t-shirts and the Web Service Consumer Connector returns if there is an error such as `BAD_RESPONSE` or `EMPTY_RESPONSE`. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 2.1 --- # Web Service Consumer Connector Examples > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following examples illustrate how to configure Anypoint Connector for Web Service Consumer (Web Service Consumer) Connector operations both in Anypoint Studio and the XML editor. - [Web Service Consumer Connector Example 1](https://docs.mulesoft.com/web-service-consumer-connector/2.1/web-service-example-1) This example transforms a variable value into XML and pass that value to the Web Service Consumer Connector, which subsequently consumes a web service. - [Web Service Consumer Connector Example 2](https://docs.mulesoft.com/web-service-consumer-connector/2.1/web-service-example-2) This example list an inventory of t-shirts and the Web Service Consumer Connector returns if there is an error such as `BAD_RESPONSE` or `EMPTY_RESPONSE`. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 2.2 is-latest-version: true --- # Web Service Consumer Connector Examples > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following examples illustrate how to configure Anypoint Connector for Web Service Consumer (Web Service Consumer) Connector operations both in Anypoint Studio and the XML editor. - [Web Service Consumer Connector Example 1](https://docs.mulesoft.com/web-service-consumer-connector/latest/web-service-example-1) This example transforms a variable value into XML and pass that value to the Web Service Consumer Connector, which subsequently consumes a web service. - [Web Service Consumer Connector Example 2](https://docs.mulesoft.com/web-service-consumer-connector/latest/web-service-example-2) This example list an inventory of t-shirts and the Web Service Consumer Connector returns if there is an error such as `BAD_RESPONSE` or `EMPTY_RESPONSE`. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 1.11 --- # Web Service Consumer Connector Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Web Service Consumer Connector Version 1.11 Anypoint Connector for Web Service Consumer (Web Service Consumer Connector) consumes a SOAP Web service to acquire data from an external source. Release Notes: [Web Service Consumer Release Notes](https://docs.mulesoft.com/release-notes/connector/connector-wsc) ## Configurations --- ### Config Default configuration #### Parameters
NameTypeDescriptionDefault ValueRequired

Name

String

Name for this configuration. Connectors reference the configuration with this name.

x

Connection

The connection types to provide to this configuration.

x

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

#### Connection Types ##### Connection ConnectionProvider that returns instances of WscSoapClient. ###### Parameters
NameTypeDescriptionDefault ValueRequired

Soap Version

Enumeration, one of:

  • SOAP11

  • SOAP12

The soap version of the WSDL.

SOAP11

Mtom Enabled

Boolean

If should use the MTOM protocol to manage the attachments or not.

false

Encoding

String

Default character encoding to use in all the messages. If not specified, the default charset in the mule configuration will be used

Transport Configuration

The transport configuration used to dispatch the SOAP messages.

Wsdl Location

String

The WSDL file URL remote or local.

x

Service

String

The service name.

x

Port

String

The port name.

x

Address

String

The address of the web service.

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy

Sign Security Strategy

A sign WSS configuration

Verify Signature Security Strategy

A verify signature WSS configuration

Username Token Security Strategy

A usernameToken WSS configuration

Outgoing Timestamp Security Strategy

A timestamp WSS configuration

Decrypt Security Strategy

A decrypt WSS configuration

Encrypt Security Strategy

an encrypt WSS configuration

Incoming Timestamp Security Strategy

A timestamp verification WSS configuration

Must Understand

Boolean

Whether mustUnderstand attribute in wsse:Security header is true or false. Defaults to true TODO (W-11800462): For the next major (v2.0.0) the default value should be false to match the SOAP protocol standard.

true

Actor

String

A SOAP message may travel from a sender to a receiver by passing different endpoints along the message path. The SOAP actor attribute is used to address the wsse:Security header to a specific endpoint. This parameter values must be a URI.

Security Headers Order

Enumeration, one of:

  • TimestampAtEnd

  • TimestampAtStart

Select the order of outgoing WS-Security tags.

## Supported Operations - [Consume](#consume) ## Operations ### Consume `` Consumes an operation from a SOAP Web Service. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

Name of the configuration to use.

x

Operation

String

The name of the web service operation that aims to invoke.

x

Body

Binary

The XML body to include in the SOAP message, with all the required parameters, or null if no params are required.

#[payload]

Headers

Binary

The XML headers to include in the SOAP message.

Attachments

Object

The attachments to include in the SOAP request.

Headers

Object

A group of transport headers that will be bounded with the transport request.

Force XML Prolog into body

Boolean

If true, the XML Prolog statement will be appended to the request’s body.

false

Target Variable

String

Name of the variable that storesoperation’s output will be placed

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

#### Output

Type

SOAP Output Envelope

Attributes Type

### For Configurations - [Config](#config) #### Throws - WSC:SOAP\_FAULT - WSC:EMPTY\_RESPONSE - WSC:TIMEOUT - WSC:BAD\_RESPONSE - WSC:BAD\_REQUEST - WSC:CONNECTIVITY - WSC:CANNOT\_DISPATCH - WSC:RETRY\_EXHAUSTED - WSC:INVALID\_WSDL - WSC:ENCODING ## Types ### Reconnection Configures a reconnection strategy for an operation.
FieldTypeDescriptionDefault ValueRequired

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Reconnection Strategy

Reconnection strategy to use.

### Reconnect
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often to attempt to reconnect, in milliseconds.

Count

Number

How many reconnection attempts the Mule app can make.

### Reconnect Forever
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often to attempt to reconnect, in milliseconds.

### WSS Sign Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Key Store Configuration

The keystore to use when signing the message.

x

Sign Algorithm Configuration

The algorithms to use on the signing.

### WSS Key Store Configuration
FieldTypeDescriptionDefault ValueRequired

Key Store Path

String

x

Alias

String

x

Password

String

Password to authenticate against the proxy server.

x

Key Password

String

Type

String

jks

### WSS Sign Configuration Adapter
FieldTypeDescriptionDefault ValueRequired

Signature Key Identifier

Enumeration, one of:

  • ISSUER_SERIAL

  • DIRECT_REFERENCE

  • X509_KEY_IDENTIFIER

  • THUMBPRINT

  • SKI_KEY_IDENTIFIER

  • KEY_VALUE

ISSUER_SERIAL

Signature Algorithm

Enumeration, one of:

  • RSAwithSHA256

  • ECDSAwithSHA256

  • DSAwithSHA1

  • RSAwithSHA1

  • RSAwithSHA224

  • RSAwithSHA384

  • RSAwithSHA512

  • ECDSAwithSHA1

  • ECDSAwithSHA224

  • ECDSAwithSHA384

  • ECDSAwithSHA512

  • DSAwithSHA256

Signature Digest Algorithm

Enumeration, one of:

  • SHA1

  • SHA256

  • SHA224

  • SHA384

  • SHA512

SHA1

Signature C14n Algorithm

Enumeration, one of:

  • CanonicalXML_1_0

  • CanonicalXML_1_1

  • ExclusiveXMLCanonicalization_1_0

ExclusiveXMLCanonicalization_1_0

Wss Parts

Array of WSS Part

### WSS Part
FieldTypeDescriptionDefault ValueRequired

Encode

Enumeration, one of:

  • ELEMENT

  • CONTENT

CONTENT

Namespace

String

x

Localname

String

x

### WSS Verify Signature Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Trust Store Configuration

The truststore to use to verify the signature.

### WSS Trust Store Configuration
FieldTypeDescriptionDefault ValueRequired

Trust Store Path

String

x

Password

String

Password to authenticate against the proxy server.

x

Type

String

jks

### Wss Username Token Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Username

String

The username required to authenticate with the service.

x

Password

String

The password for the provided username required to authenticate with the service.

x

Password Type

Enumeration, one of:

  • DIGEST

  • TEXT

A #password parameter.

TEXT

Add Nonce

Boolean

Specifies a if a cryptographically random nonce should be added to the message.

false

Add Created

Boolean

Specifies if a timestamp should be created to indicate the creation time of the message.

false

### WSS Timestamp Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Time To Live

Number

The time difference between creation and expiry time in the time unit specified in timeToLiveUnit. After this time the message is invalid.

This parameter values must be greater or equal to 1 second (or similar in other unit). Values lower than 1 second will end up
in 1 second timestamp.

60

Time To Live Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A #timeToLive parameter.

Defaults to SECONDS

SECONDS

### WSS Decrypt Security Strategy
FieldTypeDescriptionDefault ValueRequired

Key Store Configuration

The keystore to use when decrypting the message.

x

### WSS Encrypt Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Key Store Configuration

The keystore to use when encrypting the message.

x

Encryption Algorithms Configuration

### WSS Encryption Algorithms Configuration
FieldTypeDescriptionDefault ValueRequired

Encryption Key Identifier

Enumeration, one of:

  • ISSUER_SERIAL

  • DIRECT_REFERENCE

  • X509_KEY_IDENTIFIER

  • THUMBPRINT

  • SKI_KEY_IDENTIFIER

  • ENCRYPTED_KEY_SHA1

  • EMBEDDED_KEY_NAME

ISSUER_SERIAL

Encryption Sym Algorithm

Enumeration, one of:

  • TRIPLE_DES

  • AES_128

  • AES_256

  • AES_192

  • AES_128_GCM

  • AES_192_GCM

  • AES_256_GCM

AES_128

Encryption Key Transport Algorithm

Enumeration, one of:

  • KEYTRANSPORT_RSA15

  • KEYTRANSPORT_RSAOAEP

  • KEYTRANSPORT_RSAOAEP_XENC11

KEYTRANSPORT_RSAOAEP

Encryption Digest Algorithm

Enumeration, one of:

  • SHA1

  • SHA256

  • SHA384

  • SHA512

SHA1

Wss Part Adapters

Array of WSS Part

### WSS Incoming Timestamp Security Strategy Adapter
FieldTypeDescriptionDefault ValueRequired

Future Time To Live

Number

Specifies the time in the future within which the Created time of an incoming Timestamp is valid. The default value is "60", to avoid problems where clocks are slightly askew. To reject all future-created Timestamps, set this value to "0".

60

Future Time To Live Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A #futureTimeToLive parameter.

Defaults to SECONDS

SECONDS

### Expiration Policy Configures an expiration policy strategy.
FieldTypeDescriptionDefault ValueRequired

Max Idle Time

Number

Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Idle Time field.

### SOAP Output Envelope
FieldTypeDescriptionDefault ValueRequired

Attachments

Object

Body

Binary

Headers

Object

Map of HTTP headers in the message.

### SOAP Attributes
FieldTypeDescriptionDefault ValueRequired

Protocol Headers

Object

The protocol headers bundled in the response.

x

Additional Transport Data

Object

The additional transport data bundled in the response.

x

### HTTP Transport Configuration
FieldTypeDescriptionDefault ValueRequired

Requester Config

String

x

### Default HTTP Transport Configuration
FieldTypeDescriptionDefault ValueRequired

Timeout

Number

5000

--- product: Web Service Consumer Connector version: 1.11 --- # Web Service Consumer XML and Maven Support > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio. If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Studio XML editor or from a text editor, you can get access to the connector in your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file. When you install the connector in Studio, Studio automatically populates the XML code with the connector’s namespace and schema location. It also adds a dependency to the `pom.xml` file. ## Add a Namespace for the Connector Paste the following code inside the `` tag of the header of your configuration XML: ```xml http://www.mulesoft.org/schema/mule/wsc http://www.mulesoft.org/schema/mule/wsc/current/mule-wsc.xsd ``` This example shows how the namespace statements are placed in the `` XML block: ```xml ``` ## Add a POM File Dependency The Apache Maven `pom.xml` file generated by Anypoint Studio contains dependencies for a Mule app. If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector: ```xml org.mule.connectors mule-wsc-connector x.x.x mule-plugin ``` Replace `x.x.x` with the version that corresponds to the connector you are using. To obtain the most up-to-date `pom.xml` file information: 1. Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/). 2. In Exchange, click **Login** and supply your Anypoint Platform username and password. 3. In Exchange, search for `Web Service Consumer`. 4. Select the connector. 5. Click **Dependency Snippets** near the upper right of the screen. ## Next Step After completing your namespace and `pom.xml` file, you can try the [Examples](https://docs.mulesoft.com/web-service-consumer-connector/1.11/web-service-consumer-examples). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 1.12 --- # Web Service Consumer XML and Maven Support > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio. If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Studio XML editor or from a text editor, you can get access to the connector in your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file. When you install the connector in Studio, Studio automatically populates the XML code with the connector’s namespace and schema location. It also adds a dependency to the `pom.xml` file. ## Add a Namespace for the Connector Paste the following code inside the `` tag of the header of your configuration XML: ```xml http://www.mulesoft.org/schema/mule/wsc http://www.mulesoft.org/schema/mule/wsc/current/mule-wsc.xsd ``` This example shows how the namespace statements are placed in the `` XML block: ```xml ``` ## Add a POM File Dependency The Apache Maven `pom.xml` file generated by Anypoint Studio contains dependencies for a Mule app. If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector: ```xml org.mule.connectors mule-wsc-connector x.x.x mule-plugin ``` Replace `x.x.x` with the version that corresponds to the connector you are using. To obtain the most up-to-date `pom.xml` file information: 1. Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/). 2. In Exchange, click **Login** and supply your Anypoint Platform username and password. 3. In Exchange, search for `Web Service Consumer`. 4. Select the connector. 5. Click **Dependency Snippets** near the upper right of the screen. ## Next Step After completing your namespace and `pom.xml` file, you can try the [Examples](https://docs.mulesoft.com/web-service-consumer-connector/1.12/web-service-consumer-examples). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 2.0 --- # Web Service Consumer XML and Maven Support > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio. If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Studio XML editor or from a text editor, you can get access to the connector in your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file. When you install the connector in Studio, Studio automatically populates the XML code with the connector’s namespace and schema location. It also adds a dependency to the `pom.xml` file. ## Add a Namespace for the Connector Paste the following code inside the `` tag of the header of your configuration XML: ```xml http://www.mulesoft.org/schema/mule/wsc http://www.mulesoft.org/schema/mule/wsc/current/mule-wsc.xsd ``` This example shows how the namespace statements are placed in the `` XML block: ```xml ``` ## Add a POM File Dependency The Apache Maven `pom.xml` file generated by Anypoint Studio contains dependencies for a Mule app. If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector: ```xml org.mule.connectors mule-wsc-connector x.x.x mule-plugin ``` Replace `x.x.x` with the version that corresponds to the connector you are using. To obtain the most up-to-date `pom.xml` file information: 1. Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/). 2. In Exchange, click **Login** and supply your Anypoint Platform username and password. 3. In Exchange, search for `Web Service Consumer`. 4. Select the connector. 5. Click **Dependency Snippets** near the upper right of the screen. ## Next Step After completing your namespace and `pom.xml` file, you can try the [Examples](https://docs.mulesoft.com/web-service-consumer-connector/2.0/web-service-consumer-examples). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 2.1 --- # Web Service Consumer XML and Maven Support > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio. If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Studio XML editor or from a text editor, you can get access to the connector in your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file. When you install the connector in Studio, Studio automatically populates the XML code with the connector’s namespace and schema location. It also adds a dependency to the `pom.xml` file. ## Add a Namespace for the Connector Paste the following code inside the `` tag of the header of your configuration XML: ```xml http://www.mulesoft.org/schema/mule/wsc http://www.mulesoft.org/schema/mule/wsc/current/mule-wsc.xsd ``` This example shows how the namespace statements are placed in the `` XML block: ```xml ``` ## Add a POM File Dependency The Apache Maven `pom.xml` file generated by Anypoint Studio contains dependencies for a Mule app. If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector: ```xml org.mule.connectors mule-wsc-connector x.x.x mule-plugin ``` Replace `x.x.x` with the version that corresponds to the connector you are using. To obtain the most up-to-date `pom.xml` file information: 1. Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/). 2. In Exchange, click **Login** and supply your Anypoint Platform username and password. 3. In Exchange, search for `Web Service Consumer`. 4. Select the connector. 5. Click **Dependency Snippets** near the upper right of the screen. ## Next Step After completing your namespace and `pom.xml` file, you can try the [Examples](https://docs.mulesoft.com/web-service-consumer-connector/2.1/web-service-consumer-examples). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: Web Service Consumer Connector version: 2.2 is-latest-version: true --- # Web Service Consumer XML and Maven Support > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio. If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Studio XML editor or from a text editor, you can get access to the connector in your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file. When you install the connector in Studio, Studio automatically populates the XML code with the connector’s namespace and schema location. It also adds a dependency to the `pom.xml` file. ## Add a Namespace for the Connector Paste the following code inside the `` tag of the header of your configuration XML: ```xml http://www.mulesoft.org/schema/mule/wsc http://www.mulesoft.org/schema/mule/wsc/current/mule-wsc.xsd ``` This example shows how the namespace statements are placed in the `` XML block: ```xml ``` ## Add a POM File Dependency The Apache Maven `pom.xml` file generated by Anypoint Studio contains dependencies for a Mule app. If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector: ```xml org.mule.connectors mule-wsc-connector x.x.x mule-plugin ``` Replace `x.x.x` with the version that corresponds to the connector you are using. To obtain the most up-to-date `pom.xml` file information: 1. Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/). 2. In Exchange, click **Login** and supply your Anypoint Platform username and password. 3. In Exchange, search for `Web Service Consumer`. 4. Select the connector. 5. Click **Dependency Snippets** near the upper right of the screen. ## Next Step After completing your namespace and `pom.xml` file, you can try the [Examples](https://docs.mulesoft.com/web-service-consumer-connector/latest/web-service-consumer-examples). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com)