Reading Time: 2 minutes

There are use cases where you may want to send a message through HTTP, File, or another transport to a .NET Web Service. Using Mule ESB, it’s fairly straight-forward to accomplish this.

Consider this use case:

  • A client sends an XML message (not SOAP) to Mule, which goes through some transformation and gets forwarded to a .NET-based web service using an SSL certificate.
  • If the client queries for the WSDL, a specialized component in Mule called WSProxyService returns the WSDL, which is retrieved from the .NET web service.
  • To the client, exposes a standard web service, and the client doesn’t have to know what this service is implemented by, e.g., whether it’s Axis2, .NET, or CXF.
  • In some cases, a SOAP action header may need to be added to the message so that .NET can find the right service on the .NET side.

Here’s how you configure this in the Mule configuration file:

Declaring a secure HTTP connector, endpoint, and transformers:

<xml:xslt-transformer name="MyTransformer" xsl-file="C:myprojectS2C.xsl"/>

<spring:bean name="CWSProxyService" class="org.mule.transport.soap.WSProxyService">
   <spring:property name="wsdlFile" value="S2CPassthroughWSDL.wsdl"/>

<https:<a href="!/?types=connector" target="_blank" rel="" title="Cloud Connectors" >connector</a> name="MyHttpsConnector" clientSoTimeout="30000">
   <https:tls-key-store path="C:myprojectv1etccertsserver.jks" storePassword="ssecret"
</https:<a href="!/?types=connector" target="_blank" rel="" title="Cloud Connectors" >connector</a>>

Defining a Mule service:

<service name="MyService">
        <inbound-endpoint ref="WSPROXYHTTP"/>
        <spring-object bean="CWSProxyService" />
            <cxf:outbound-endpoint address="https://anotherhost:7001/services
/ws2.svc?Service=processService" proxy="true" synchronous="true">

That’s all there is to it. Happy interop’ing!