<?xml version="1.0" encoding="UTF-8"?>
<switchyard xmlns="urn:switchyard-config:switchyard:1.0"
    xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
    xmlns:bean="urn:switchyard-component-bean:config:1.0"
    xmlns:camel="urn:switchyard-component-camel:config:1.0"
    xmlns:soap="urn:switchyard-component-soap:config:1.0"
    name="soap-mtom">

  <sca:composite name="soap-mtom" targetNamespace="urn:switchyard-quickstart:soap-mtom:1.0">

    <sca:service name="ImageService" promote="InternalResizeServiceBean/InternalResizeService">
      <sca:interface.wsdl interface="ImageService.wsdl#wsdl.porttype(ImageService)"/>
      <soap:binding.soap>
        <soap:wsdl>ImageService.wsdl</soap:wsdl>
        <soap:contextPath>soap-mtom</soap:contextPath>
        <soap:mtom xopExpand="true"/>
      </soap:binding.soap>
    </sca:service>
    <sca:reference name="ResizeImageService" multiplicity="0..1" promote="InternalResizeServiceBean/ResizeImageService">
      <sca:interface.wsdl interface="ImageService-External.wsdl#wsdl.porttype(ImageService)"/>
      <soap:binding.soap>
        <soap:contextMapper/>
        <soap:wsdl>ImageService-External.wsdl</soap:wsdl>
        <soap:endpointAddress>http://localhost:8080/soap-mtom-external/ImageServiceService</soap:endpointAddress>
        <soap:mtom xopExpand="true"/>
      </soap:binding.soap>
    </sca:reference>
    <sca:component name="InternalResizeServiceBean">
      <camel:implementation.camel>
        <camel:xml path="META-INF/route.xml"/>
      </camel:implementation.camel>
      <sca:service name="InternalResizeService">
        <interface.esb inputType="java:java.awt.Image" outputType="java:java.lang.String"/>
      </sca:service>
      <sca:reference name="ResizeImageService">
        <interface.esb inputType="java:java.lang.String" outputType="java:java.awt.Image"/>
      </sca:reference>
    </sca:component>

    <sca:service name="ImageServiceExternal" promote="ResizeServiceBean/ResizeService">
      <sca:interface.wsdl interface="ImageService-External.wsdl#wsdl.porttype(ImageService)"/>
      <soap:binding.soap>
        <soap:contextMapper/>
        <soap:wsdl>ImageService-External.wsdl</soap:wsdl>
        <soap:contextPath>soap-mtom-external</soap:contextPath>
        <soap:mtom xopExpand="true"/>
      </soap:binding.soap>
    </sca:service>
    <sca:component name="ResizeServiceBean">
      <camel:implementation.camel>
        <camel:xml path="META-INF/filter.xml"/>
      </camel:implementation.camel>
      <sca:service name="ResizeService">
        <interface.esb inputType="java:java.awt.Image" outputType="java:java.lang.String"/>
      </sca:service>
    </sca:component>
  </sca:composite>
</switchyard>
