<?php
header("Content-Type: text/xml; charset=utf-8");
require_once 'define.php';
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
?>
<definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
             xmlns:tns="http://<?=$_SERVER['HTTP_HOST'].PATH_TO_SERVISE ?>"
             xmlns:xs="http://www.w3.org/2001/XMLSchema"
             xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
             xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
             name="NavWsdl"
             targetNamespace="http://<?=$_SERVER['HTTP_HOST'].PATH_TO_SERVISE ?>" 
             xmlns="http://schemas.xmlsoap.org/wsdl/">
             
             
    <types>
        <xs:schema elementFormDefault="qualified"
                   xmlns:tns="http://schemas.xmlsoap.org/wsdl/"
                   xmlns:xs="http://www.w3.org/2001/XMLSchema"
                   targetNamespace="http://<?=$_SERVER['HTTP_HOST'].PATH_TO_SERVISE ?>">
                   
		      <xs:element name="getTripFromTMSByTimeInRequest">
		        <xs:complexType>
		          <xs:sequence>
		            <xs:element minOccurs="0" maxOccurs="1" name="time" type="xs:string" />
		            <xs:element minOccurs="0" maxOccurs="1" name="idSession" type="xs:string" />		           
		          </xs:sequence>
		        </xs:complexType>
		      </xs:element>
		      <xs:element name="getTripFromTMSByTimeOutResponse">
			        <xs:complexType>
			            <xs:sequence>
			              <xs:element minOccurs="0" maxOccurs="1" name="tripResultTime" type="xs:string" />
			            </xs:sequence>
			        </xs:complexType>
     		  </xs:element>
		      
		      <xs:element name="getTripFromTMSByDateInRequest">
		        <xs:complexType>
		          <xs:sequence>
		            <xs:element minOccurs="0" maxOccurs="1" name="date" type="xs:string" />
		            <xs:element minOccurs="0" maxOccurs="1" name="idSession" type="xs:string" />		           
		          </xs:sequence>
		        </xs:complexType>
		      </xs:element>
		      <xs:element name="getTripFromTMSByDateOutResponse">
			        <xs:complexType>
			            <xs:sequence>
			              <xs:element minOccurs="0" maxOccurs="1" name="tripResultDate" type="xs:string" />
			            </xs:sequence>
			        </xs:complexType>
     		  </xs:element>
		      
		      <xs:element name="getTripFromTMSByOrderIdInRequest">
		        <xs:complexType>
		          <xs:sequence>
		            <xs:element minOccurs="0" maxOccurs="1" name="orderId" type="xs:string" />
		            <xs:element minOccurs="0" maxOccurs="1" name="idSession" type="xs:string" />		           
		          </xs:sequence>
		        </xs:complexType>
		      </xs:element>	
		      <xs:element name="getTripFromTMSByOrderIdOutResponse">
			        <xs:complexType>
			            <xs:sequence>
			              <xs:element minOccurs="0" maxOccurs="1" name="tripResultId" type="xs:string" />
			            </xs:sequence>
			        </xs:complexType>
     		  </xs:element>
     		  
		      <xs:element name="pingRequest">
		        <xs:complexType>
		          <xs:sequence>
		          		<xs:element minOccurs="0" maxOccurs="1" name="idSession" type="xs:string" />		            		           
		          </xs:sequence>
		        </xs:complexType>
		      </xs:element>	
		      <xs:element name="pingResponse">
			        <xs:complexType>
			            <xs:sequence>
			              <xs:element minOccurs="0" maxOccurs="1" name="pingResult" type="xs:string" />
			            </xs:sequence>
			        </xs:complexType>
     		  </xs:element>
		      
		      <xs:element name="authRequest">
		        <xs:complexType>
		          <xs:sequence>
		            <xs:element minOccurs="0" maxOccurs="1" name="login" type="xs:string" />
		            <xs:element minOccurs="0" maxOccurs="1" name="password" type="xs:string" />
		          </xs:sequence>
		        </xs:complexType>
		      </xs:element>	
		      	      
		       <xs:element name="authResponse">
			        <xs:complexType>
			            <xs:sequence>
			              <xs:element minOccurs="0" maxOccurs="1" name="AuthResult" type="xs:string" />
			              <xs:element minOccurs="0" maxOccurs="1" name="AuthNumber" type="xs:string" />
			            </xs:sequence>
			        </xs:complexType>
     		  </xs:element>
     		  
     		  <xs:element name="importRequestFromNavRequest">
		        <xs:complexType>
		          <xs:sequence>
		            <xs:element minOccurs="0" maxOccurs="1" name="xml" type="xs:string" />
		            <xs:element minOccurs="0" maxOccurs="1" name="projectId" type="xs:string" />
		            <xs:element minOccurs="0" maxOccurs="1" name="idSession" type="xs:string" />		
		              	           
		          </xs:sequence>
		        </xs:complexType>
		      </xs:element>	
		      
		      <xs:element name="importRequestFromNavResponse">
			        <xs:complexType>
			            <xs:sequence>
			              <xs:element minOccurs="0" maxOccurs="1" name="importRequestFromNavResult" type="xs:string" />
			              
			            </xs:sequence>
			        </xs:complexType>
     		  </xs:element>
		      
		        <xs:element name="importReadyStatusFromNavRequest">
		        <xs:complexType>
		          <xs:sequence>
		            <xs:element minOccurs="0" maxOccurs="1" name="status" type="xs:string" />
		            <xs:element minOccurs="0" maxOccurs="1" name="idSession" type="xs:string" />	
		              	           
		          </xs:sequence>
		        </xs:complexType>
		      </xs:element>	
		      
		      <xs:element name="importReadyStatusFromNavResponse">
			        <xs:complexType>
			            <xs:sequence>
			              <xs:element minOccurs="0" maxOccurs="1" name="importReadyStatusFromNavResult" type="xs:string" />
			            </xs:sequence>
			        </xs:complexType>
     		  </xs:element>
        </xs:schema>
    </types>
   
   
    
     <!-- Сообщения процедур  -->  
	<message name="importRequestFromNavIn">
        <part name="parameters"  element="tns:importRequestFromNavRequest"/>
    </message>
    <message name="importRequestFromNavOut">
        <part name="parameters"  element="tns:importRequestFromNavResponse"/>
    </message>
     <message name="importReadyStatusFromNavIn">
        <part name="parameters" element="tns:importReadyStatusFromNavRequest"/>
    </message>
    <message name="importReadyStatusFromNavOut">
        <part name="parameters"  element="tns:importReadyStatusFromNavResponse"/>
    </message>
     <message name="authIn">
        <part name="parameters" element="tns:authRequest"  />
    </message>
     <message name="authOut">
        <part name="parameters" element="tns:authResponse"  />
    </message>
    <message name="pingIn">
        <part name="parameters" element="tns:pingRequest"  />
    </message>
     <message name="pingOut">
        <part name="parameters" element="tns:pingResponse"  />
    </message>
    <message name="getTripFromTMSByOrderIdIn">
        <part name="parameters" element="tns:getTripFromTMSByOrderIdInRequest"  />
    </message>
     <message name="getTripFromTMSByOrderIdOut">
        <part name="parameters" element="tns:getTripFromTMSByOrderIdOutResponse"  />
    </message>
    <message name="getTripFromTMSByDateIn">
        <part name="parameters" element="tns:getTripFromTMSByDateInRequest"  />
    </message>
     <message name="getTripFromTMSByDateOut">
        <part name="parameters" element="tns:getTripFromTMSByDateOutResponse"  />
    </message>
    <message name="getTripFromTMSByTimeIn">
        <part name="parameters" element="tns:getTripFromTMSByTimeInRequest"  />
    </message>
     <message name="getTripFromTMSByTimeOut">
        <part name="parameters" element="tns:getTripFromTMSByTimeOutResponse"  />
    </message>
  
    
     <!-- Привязка процедуры к сообщениям -->
      <portType name="NavServicePortType">
        <operation name="importRequestFromNav">
            <input message="tns:importRequestFromNavIn" />
            <output message="tns:importRequestFromNavOut" />
        </operation>
        <operation name="importReadyStatusFromNav">
            <input message="tns:importReadyStatusFromNavIn" />
            <output message="tns:importReadyStatusFromNavOut" />
        </operation>             
        <operation name="auth">
            <input message="tns:authIn" />
            <output message="tns:authOut" />
        </operation>
        <operation name="ping">
            <input message="tns:pingIn" />
            <output message="tns:pingOut" />
        </operation>
         <operation name="getTripFromTMSByOrderId">
            <input message="tns:getTripFromTMSByOrderIdIn" />
            <output message="tns:getTripFromTMSByOrderIdOut" />
        </operation> 
        <operation name="getTripFromTMSByDate">
            <input message="tns:getTripFromTMSByDateIn" />
            <output message="tns:getTripFromTMSByDateOut" />
        </operation>
        <operation name="getTripFromTMSByTime">
            <input message="tns:getTripFromTMSByTimeIn" />
            <output message="tns:getTripFromTMSByTimeOut" />
        </operation>               
    </portType>

    <!-- Формат процедур веб-сервиса -->     
      <binding name="NavServiceBinding" type="tns:NavServicePortType">
        <soap:binding  transport="http://schemas.xmlsoap.org/soap/http" />
         <operation name="importRequestFromNav">
            <soap:operation soapAction="" style="document" />
            <input>
                <soap:body use="literal" />
            </input>
            <output>
                <soap:body use="literal" />
            </output>
        </operation>
        <operation name="importReadyStatusFromNav">
            <soap:operation soapAction="" style="document" />
            <input>
                <soap:body use="literal" />
            </input>
            <output>
                <soap:body use="literal" />
            </output>
        </operation>      
        <operation name="auth">
            <soap:operation soapAction="" style="document" />
            <input>
                <soap:body use="literal" />
            </input>
            <output>
                <soap:body use="literal" />
            </output>
        </operation>
        <operation name="ping">
            <soap:operation soapAction="" style="document" />
            <input>
                <soap:body use="literal" />
            </input>
            <output>
                <soap:body use="literal" />
            </output>
        </operation>
          <operation name="getTripFromTMSByOrderId">
            <soap:operation soapAction="" style="document" />
            <input>
                <soap:body use="literal" />
            </input>
            <output>
                <soap:body use="literal" />
            </output>
        </operation>
        
        <operation name="getTripFromTMSByDate">
            <soap:operation soapAction="" style="document" />
            <input>
                <soap:body use="literal" />
            </input>
            <output>
                <soap:body use="literal" />
            </output>
        </operation>
        
        <operation name="getTripFromTMSByTime">
            <soap:operation soapAction="" style="document" />
            <input>
                <soap:body use="literal" />
            </input>
            <output>
                <soap:body use="literal" />
            </output>
        </operation>           
    </binding>
    
    
     <!-- Определение сервиса -->
     <service name="NavService">
        <port name="NavServicePort" binding="tns:NavServiceBinding">
            <soap:address location="http://<?=$_SERVER['HTTP_HOST'].PATH_TO_SERVISE?>elit_service.php" />
        </port>
    </service>
</definitions>