<?xml version="1.0"?>
<definitions name="EdecService" 
	targetNamespace="http://www.e-dec.ch/services/EdecService/v4/" 
	xmlns:tns="http://www.e-dec.ch/services/EdecService/v4/" 
	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
	xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
	xmlns:edecRequest="http://www.e-dec.ch/xml/schema/edec/v4" 
	xmlns:edecSATRequest="http://www.e-dec.ch/xml/schema/edecSelectionAndTransit/v4" 
	xmlns:edecResponse="http://www.e-dec.ch/xml/schema/edecResponse/v4" 
	xmlns="http://schemas.xmlsoap.org/wsdl/">

	<documentation>
		Service for the SYNCHRONOUS submission of e-dec declarations (import, export)
		The first e-dec response is handed back; follow-up responses must be transferred by other means (eg email)
	</documentation>

	<types>
		<xsd:schema>
			<xsd:import namespace="http://www.e-dec.ch/xml/schema/edec/v4" schemaLocation="http://www.ezv.admin.ch/pdf_linker.php?doc=edec_v_4_0"/>
		</xsd:schema>
		<xsd:schema>
			<xsd:import namespace="http://www.e-dec.ch/xml/schema/edecSelectionAndTransit/v4" schemaLocation="http://www.ezv.admin.ch/pdf_linker.php?doc=edecSelectionAndTransit_v_4_0"/>
		</xsd:schema>
		<xsd:schema>
			<xsd:import namespace="http://www.e-dec.ch/xml/schema/edecResponse/v4" schemaLocation="http://www.ezv.admin.ch/pdf_linker.php?doc=edecResponse_v_4_0"/>
		</xsd:schema>
	</types>

	<message name="goodsDeclarationsRequest">
    <documentation>
      Contains a single declaration for Import or Export. Sending 
      multiple declarations per request are only supported via E-Mail.
    </documentation>
		<part name="parameters" element="edecRequest:goodsDeclarations"/>
	</message>

	<message name="goodsDeclarationsResponse">
		<documentation>
			Contains a declaration acceptance response message. The other base64-encoded parts contain 
			PDF attachment and are all OPTIONAL. According to the business-level service 
			contracts, none, one or more of these PDF parts may be present in a response.
		</documentation>
		<part name="parameters" element="edecResponse:goodsDeclarationsResponse"/>
		<!-- import-specific -->
		<part name="e-dec_Import_EL" type="xsd:base64Binary"/>
		<part name="e-dec_Import_BS" type="xsd:base64Binary"/>
		<part name="e-dec_Import_VVM" type="xsd:base64Binary"/>
		<part name="e-dec_Import_VVZ" type="xsd:base64Binary"/>
		<part name="e-dec_Import_RBM" type="xsd:base64Binary"/>
		<part name="e-dec_Import_RBZ" type="xsd:base64Binary"/>
		<!-- export-specific -->
		<part name="e-dec_Export_AL" type="xsd:base64Binary"/>		
	</message>

	<message name="goodsDeclarationsFault">
		<documentation>
		  Contains the reason for the rejection of the declaration.
		</documentation>
		<part name="parameters" element="edecResponse:goodsDeclarationsResponse"/>
	</message>

	<message name="selectionAndTransitRequest">
    <documentation>
      Contains the parameter for the Selection and Transit process.
    </documentation>
		<part name="parameters" element="edecSATRequest:selectionAndTransit"/>
	</message>

	<message name="selectionAndTransitResponse">
		<documentation>
			Contains a declaration acceptance response message. The other base64-encoded parts contain 
			PDF attachment and are all OPTIONAL. According to the business-level service 
			contracts, none, one or more of these PDF parts may be present in a response.
		</documentation>
		<part name="parameters" element="edecResponse:selectionAndTransitResponse"/>
		<!-- export-specific -->
		<part name="e-dec_Export_AL" type="xsd:base64Binary"/>		
	</message>

	<message name="selectionAndTransitFault">
		<documentation>
		  Contains the reason why the Selection and Transit process failed.
		</documentation>
		<part name="parameters" element="edecResponse:selectionAndTransitResponse"/>
	</message>

	<portType name="EdecPortType">
		<operation name="goodsDeclarations">
			<input message="tns:goodsDeclarationsRequest"/>
			<output message="tns:goodsDeclarationsResponse"/>
			<fault name="goodsDeclarationsFault" message="tns:goodsDeclarationsFault"/>
		</operation>
		<operation name="selectionAndTransit">
			<input message="tns:selectionAndTransitRequest"/>
			<output message="tns:selectionAndTransitResponse"/>
			<fault name="selectionAndTransitFault" message="tns:selectionAndTransitFault"/>
		</operation>
	</portType>

	<binding name="EdecBinding" type="tns:EdecPortType">
		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
		<operation name="goodsDeclarations">
			<soap:operation soapAction="goodsDeclarations" style="document"/>
			<input>
				<soap:body use="literal" parts="parameters"/>
			</input>
			<output>
				<mime:multipartRelated>
					<mime:part>
						<soap:body use="literal" parts="parameters"/>
					</mime:part>
					<mime:part>
						<mime:content part="e-dec_Import_EL" type="application/pdf"/>
					</mime:part>
					<mime:part>
						<mime:content part="e-dec_Import_BS" type="application/pdf"/>
					</mime:part>
					<mime:part>
						<mime:content part="e-dec_Import_VVM" type="application/pdf"/>
					</mime:part>
					<mime:part>
						<mime:content part="e-dec_Import_VVZ" type="application/pdf"/>
					</mime:part>
					<mime:part>
						<mime:content part="e-dec_Import_RBM" type="application/pdf"/>
					</mime:part>
					<mime:part>
						<mime:content part="e-dec_Import_RBZ" type="application/pdf"/>
					</mime:part>
					<mime:part>
						<mime:content part="e-dec_Export_AL" type="application/pdf"/>
					</mime:part>
				</mime:multipartRelated>
			</output>
			<fault name="goodsDeclarationsFault">
				<soap:fault name="goodsDeclarationsFault" use="literal"/>
			</fault>
		</operation>
		<operation name="selectionAndTransit">
		  <soap:operation soapAction="selectionAndTransit" style="document"/>
		  <input>
		    <soap:body use="literal" parts="parameters"/>
		  </input>
		  <output>
		    <mime:multipartRelated>
		      <mime:part>
		        <soap:body use="literal" parts="parameters"/>
		      </mime:part>
			  <mime:part>
			    <mime:content part="e-dec_Export_AL" type="application/pdf"/>
			  </mime:part>
		  	</mime:multipartRelated>
		  </output>
		  <fault name="selectionAndTransitFault">
		    <soap:fault name="selectionAndTransitFault" use="literal"/>
		  </fault>
		</operation>
	</binding>

	<service name="EdecService">
		<documentation>
			Submit a customs declaration to e-dec or a selection and transit request 
			and receive a synchronous response. Note that a client certificate is 
			required for authentication.
		</documentation>
		<port name="EdecPort" binding="tns:EdecBinding">
			<soap:address location="https://ws.edec-a.ezv.admin.ch/services/EdecService/v4"/>
		</port>
	</service>

</definitions>

