<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="transitService" targetNamespace="http://ws.estesexpress.com/transittime" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://ws.estesexpress.com/transittime" xmlns:trans="http://ws.estesexpress.com/schema/transittime">
  <wsdl:types>
    <xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://ws.estesexpress.com/transittime" xmlns:tns="http://ws.estesexpress.com/transittime" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

		<!-- Define simple types used in SOAP request/response here. -->

		<xsd:complexType name="AuthenticationType">
			<xsd:sequence>
				<xsd:element name="user" type="tns:UserType"/>
				<xsd:element name="password" type="tns:PasswordType"/>
			</xsd:sequence>
		</xsd:complexType>

		<xsd:simpleType name="EchoRequestType">
			<xsd:restriction base="xsd:string">
				<xsd:maxLength value="100"/>
			</xsd:restriction>
		</xsd:simpleType>

		<xsd:simpleType name="PasswordType">
			<xsd:restriction base="xsd:string">
				<xsd:minLength value="5"/>
				<xsd:maxLength value="10"/>
			</xsd:restriction>
		</xsd:simpleType>

		<xsd:simpleType name="UserType">
			<xsd:restriction base="xsd:string">
				<xsd:minLength value="5"/>
				<xsd:maxLength value="10"/>
			</xsd:restriction>
		</xsd:simpleType>

		<!-- Define SOAP message names here. -->

		<!-- Authentication SOAP Header  -->
		<xsd:element name="auth" type="tns:AuthenticationType"/>

		<!-- General Fault -->
		<xsd:element name="generalError" type="xsd:string"/>

		<!-- Schema Validation Fault -->
		<xsd:element name="schemaError" type="xsd:string"/>

		<!-- Echo Request Type -->
		<xsd:element name="echoRequest" type="tns:EchoRequestType"/>
		<!-- Echo Response Type -->
		<xsd:element name="echoResponse" type="xsd:string"/>
    </xsd:schema>
    <xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://ws.estesexpress.com/schema/transittime" xmlns:trans="http://ws.estesexpress.com/schema/transittime" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <!--  Reference all the schemas -->
      <xsd:include schemaLocation="TransitTimeService?xsd=serviceRequest.xsd"/>
      <xsd:include schemaLocation="TransitTimeService?xsd=serviceResponse.xsd"/>
    </xsd:schema>
  </wsdl:types>
  <wsdl:message name="serviceRequestMsg">
    <wsdl:part name="serviceRequest" element="trans:serviceRequest">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="generalErrorMsg">
    <wsdl:part name="fault" element="tns:generalError">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="echoRequestMsg">
    <wsdl:part name="echoRequest" element="tns:echoRequest">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="serviceResponseMsg">
    <wsdl:part name="serviceResult" element="trans:serviceResult">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="authenticationMsg">
    <wsdl:part name="authentication" element="tns:auth">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="schemaErrorMsg">
    <wsdl:part name="fault" element="tns:schemaError">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="echoResponseMsg">
    <wsdl:part name="echoResponse" element="tns:echoResponse">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="transitPortType">
    <wsdl:operation name="echo">
      <wsdl:input name="echoRequest" message="tns:echoRequestMsg">
    </wsdl:input>
      <wsdl:output name="echoResponse" message="tns:echoResponseMsg">
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="calculate">
      <wsdl:input name="serviceRequest" message="tns:serviceRequestMsg">
    </wsdl:input>
      <wsdl:output name="serviceResponse" message="tns:serviceResponseMsg">
    </wsdl:output>
      <wsdl:fault name="schemaErrorMessage" message="tns:schemaErrorMsg">
    </wsdl:fault>
      <wsdl:fault name="generalErrorMessage" message="tns:generalErrorMsg">
    </wsdl:fault>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="transitBinding" type="tns:transitPortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="echo">
      <soap:operation soapAction="http://ws.estesexpress.com/echo" style="document"/>
      <wsdl:input>
        <soap:body parts="echoRequest" use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body parts="echoResponse" use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="calculate">
      <soap:operation soapAction="http://ws.estesexpress.com/transittime/calc" style="document"/>
      <wsdl:input name="serviceRequest">
        <soap:header message="tns:authenticationMsg" part="authentication" use="literal">
        </soap:header>
        <soap:body parts="serviceRequest" use="literal"/>
      </wsdl:input>
      <wsdl:output name="serviceResponse">
        <soap:body parts="serviceResult" use="literal"/>
      </wsdl:output>
      <wsdl:fault name="schemaErrorMessage">
        <soap:fault name="schemaErrorMessage" use="literal"/>
      </wsdl:fault>
      <wsdl:fault name="generalErrorMessage">
        <soap:fault name="generalErrorMessage" use="literal"/>
      </wsdl:fault>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="TransitTimeService">
<wsdl:documentation>Transit time calculator service</wsdl:documentation>
    <wsdl:port name="transitPortType" binding="tns:transitBinding">
      <soap:address location="https://www.estes-express.com/transittime/services/TransitTimeService"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
