<?xml version="1.0" encoding="utf-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements. See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership. The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License. You may obtain a copy of the License at


  http://www.apache.org/licenses/LICENSE-2.0


  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied. See the License for the
  specific language governing permissions and limitations
  under the License.
-->
<wsdl:definitions name="SOAPBuilders-mime-cr-test" xmlns:types="http://cxf.apache.org/mime/types"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://cxf.apache.org/mime"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
    xmlns:xmime="http://www.w3.org/2005/05/xmlmime"    
    targetNamespace="http://cxf.apache.org/mime">

    <wsdl:types>
        <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://cxf.apache.org/mime/types"
            xmlns:xmime="http://www.w3.org/2005/05/xmlmime" elementFormDefault="qualified">
            <complexType name="ByteArrayType">
                <sequence>
                    <element name="name" type="xsd:string" />
                    <element name="attachinfo" type="xsd:base64Binary"/>
                </sequence>
            </complexType>
            <element name="testByteArray" type="types:ByteArrayType" />
            <element name="testByteArrayResponse" type="types:ByteArrayType" />
            
            <complexType name="DataHandlerType">
                <sequence>
                    <element name="name" type="xsd:string" />
                    <element name="attachinfo" type="xsd:base64Binary" 
                             xmime:expectedContentTypes="application/octet-stream"/>
                </sequence>
            </complexType>
            <element name="testDataHandler" type="types:DataHandlerType" />
            <element name="testDataHandlerResponse" type="types:DataHandlerType" />
        </schema>

    </wsdl:types>


    <wsdl:message name="testByteArrayIn">
        <wsdl:part name="data" element="types:testByteArray" />
    </wsdl:message>

    <wsdl:message name="testByteArrayOut">
        <wsdl:part name="data" element="types:testByteArrayResponse" />
    </wsdl:message>


    <wsdl:message name="testDataHandlerIn">
        <wsdl:part name="data" element="types:testDataHandler" />
    </wsdl:message>

    <wsdl:message name="testDataHandlerOut">
        <wsdl:part name="data" element="types:testDataHandlerResponse" />
    </wsdl:message>


    <wsdl:portType name="TestMtomPortType">
        <wsdl:operation name="testByteArray">
            <wsdl:input message="tns:testByteArrayIn" />
            <wsdl:output message="tns:testByteArrayOut" />
        </wsdl:operation>

        <wsdl:operation name="testDataHandler">
            <wsdl:input message="tns:testDataHandlerIn" />
            <wsdl:output message="tns:testDataHandlerOut" />
        </wsdl:operation>
    </wsdl:portType>

    <wsdl:binding name="TestMtomBinding" type="tns:TestMtomPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />

        <wsdl:operation name="testByteArray">
            <soap:operation soapAction="" />
            <wsdl:input>
                <soap:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>

        <wsdl:operation name="testDataHandler">
            <soap:operation soapAction="" />
            <wsdl:input>
                <soap:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>

    </wsdl:binding>

    <wsdl:service name="TestMtomService">
        <wsdl:port name="TestMtomPort" binding="tns:TestMtomBinding">
            <soap:address location="http://localhost:9000/mime-test" />
        </wsdl:port>
    </wsdl:service>

</wsdl:definitions>
