<?xml version='1.0' encoding='UTF-8'?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tp="urn:base.gateway.aesais.mf.gov.pl:ws" targetNamespace="urn:base.gateway.aesais.mf.gov.pl:ws">
	<xs:simpleType name="DescriptionType">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="1000"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="DocumentWithContentType">
		<xs:complexContent>
			<xs:extension base="tp:DocumentType">
				<xs:sequence>
					<xs:element maxOccurs="1" minOccurs="1" name="Content" type="tp:ContentType"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="BaseChannelType">
		<xs:sequence/>
		<xs:attribute name="type" type="tp:ChannelEnumType" use="optional"/>
	</xs:complexType>
	<xs:complexType name="CorrespondentWithDataType">
		<xs:complexContent>
			<xs:extension base="tp:CorrespondentType">
				<xs:sequence>
					<xs:element maxOccurs="99" minOccurs="0" name="Systems" type="tp:SystemType">
						<xs:annotation>
							<xs:documentation>Systemy, do których użytkownik ma uprawnienia.</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
				<xs:attribute name="name" type="tp:CorrespondentNameType" use="required"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:simpleType name="LinkType">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="255"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="DeliveryConfirmationEnumType">
		<xs:annotation>
			<xs:documentation>Potwierdzenia dostarczenia dokumentu (tryb UPD).</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:enumeration value="Required">
				<xs:annotation>
					<xs:documentation>Wymagany (wymaga potwierdzenia dostarczenia).</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="Delivered">
				<xs:annotation>
					<xs:documentation>Dostarczony (potwierdzono dostarczenie).</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="NotDelivered">
				<xs:annotation>
					<xs:documentation>Nie dostarczony (nie potwierdzono dostarczenia).</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="NotApplicable">
				<xs:annotation>
					<xs:documentation>Nie dotyczy (nie wymaga potwierdzenia dostarczenia).</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="ContentType">
		<xs:simpleContent>
			<xs:extension base="xs:base64Binary">
				<xs:attribute name="mimeType" type="tp:MIMEType" use="required">
					<xs:annotation>
						<xs:documentation>Typ MIME dokumentu.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="description" type="tp:DescriptionType" use="optional">
					<xs:annotation>
						<xs:documentation>Opcjonalny komentarz dotyczący dokumentu.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="compressionType" type="tp:CompressionTypeEnum" use="optional">
					<xs:annotation>
						<xs:documentation>Rodzaj kompresji (jeżeli nie jest podany oznacza bez kompresji)</xs:documentation>
					</xs:annotation>
				</xs:attribute>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="SISCType">
		<xs:sequence/>
		<xs:attribute name="IdSiscP" type="tp:IdSISCType" use="optional"/>
		<xs:attribute name="IdSiscROF" type="tp:IdSISCType" use="optional"/>
		<xs:attribute name="IdSiscROP" type="tp:IdSISCType" use="optional"/>
	</xs:complexType>
	<xs:simpleType name="MIMEType">
		<xs:annotation>
			<xs:documentation>Typ MIME</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string"/>
	</xs:simpleType>
	<xs:simpleType name="ReferenceNumberType">
		<xs:restriction base="xs:string">
			<xs:maxLength value="40"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="DocumentWithAttachmentAndRelatedType">
		<xs:complexContent>
			<xs:extension base="tp:DocumentWithAttachmentType">
				<xs:sequence>
					<xs:element maxOccurs="999" minOccurs="0" name="RelatedDocument" type="tp:DocumentWithAttachmentAndRelatedType"/>
				</xs:sequence>
				<xs:attribute name="deliveryConfirmation" type="tp:DeliveryConfirmationEnumType" use="optional">
					<xs:annotation>
						<xs:documentation>Potwierdzenie dostarczenia (tryb UPD).</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="orderId" type="tp:OrderIdType" use="optional"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:simpleType name="RepresentativeNameType">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="160"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="TraderDocumentType">
		<xs:sequence>
			<xs:element maxOccurs="1" minOccurs="0" name="Attachment" type="tp:DocumentWithContentType"/>
			<xs:element maxOccurs="1" minOccurs="1" name="Document" type="tp:DocumentWithContentType"/>
		</xs:sequence>
		<xs:attribute name="correlationOrderId" type="tp:OrderIdType" use="optional"/>
	</xs:complexType>
	<xs:element name="EmailReference" type="tp:EmailReferenceType">
		<xs:annotation>
			<xs:documentation>Komunikat EmailReference stanowi odnośnik komunikatu zwrotnego, odsyłanego przez Bramkę w sytuacji gdy ten wymaga potwierdzenia dostarczenia.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:complexType name="RepresentativeType">
		<xs:sequence>
			<xs:element maxOccurs="999" minOccurs="0" name="Correspondents" type="tp:CorrespondentWithDataType"/>
		</xs:sequence>
		<xs:attribute name="idSisc" type="tp:IdSISCType" use="required"/>
		<xs:attribute name="name" type="tp:RepresentativeNameType" use="required"/>
	</xs:complexType>
	<xs:complexType name="DocumentWithRelatedType">
		<xs:complexContent>
			<xs:extension base="tp:DocumentWithContentType">
				<xs:sequence>
					<xs:element maxOccurs="999" minOccurs="0" name="RelatedDocument" type="tp:DocumentWithRelatedType"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="EmailAttachmentResultType">
		<xs:sequence>
			<xs:element maxOccurs="1" minOccurs="1" name="Result" type="tp:ResultType">
				<xs:annotation>
					<xs:documentation>Wynik wykonania operacji dla danego załącznika w postaci kodu (wartości większe od 0 są zwracane w przypadku prawidłowego przetwarzania, mniejsze od zera  0 w przypadku wystąpienia błędu) i opcjonalnego opisu.
Możliwe wartości:
1 - Operacja zakończyła się powodzeniem
0 - Operacja nie zakończyła się prawidłowo, ale nie zwróciła również błędu (szczegóły zawarte w opisie).
-30 - Błędny typ mime.
-31 - Błędny format, dokumentu nie jest XML'em.
-32 - Dokument jest pusty.
-33 - Dokument nie jest obsługiwany przez System.
-35 - Błąd kompresji danych.
-34 - Nieznany System docelowy.</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="attachmentName" type="xs:string" use="required">
			<xs:annotation>
				<xs:documentation>Nazwa pliku załącznika.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="documentHash" type="xs:string" use="optional">
			<xs:annotation>
				<xs:documentation>Skrót (hash) z załączonego komunikatu (SHA-1).</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="orderId" type="tp:OrderIdType" use="optional">
			<xs:annotation>
				<xs:documentation>Unikalny identyfikator zlecenia odbioru komunikatu (orderId), nadany przez Bramkę.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="ValidationInfoType">
		<xs:annotation>
			<xs:documentation>Wynik walidacji.</xs:documentation>
		</xs:annotation>
		<xs:sequence/>
		<xs:attribute name="type" type="tp:ValidationInfoEnumType" use="required"/>
		<xs:attribute name="pointer" type="xs:string" use="optional"/>
		<xs:attribute name="text" type="xs:string" use="required"/>
		<xs:attribute name="originalValue" type="xs:string" use="optional"/>
	</xs:complexType>
	<xs:complexType name="EmailChannelType">
		<xs:complexContent>
			<xs:extension base="tp:BaseChannelType">
				<xs:sequence/>
				<xs:attribute name="value" type="xs:string" use="required"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="CorrespondentType">
		<xs:sequence/>
		<xs:attribute name="idSisc" type="tp:IdSISCType" use="optional">
			<xs:annotation>
				<xs:documentation>Id SISC Podmiotu.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="identifier" type="tp:CorrespondentIdentifierType" use="optional">
			<xs:annotation>
				<xs:documentation>Identyfikator Podmiotu (TIN lub EORI)</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="correspondentAgency" type="tp:CorrespondentAgencyType" use="optional">
			<xs:annotation>
				<xs:documentation>Placówka Podmiotu.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="ResultType">
		<xs:sequence/>
		<xs:attribute name="code" type="xs:int" use="required"/>
		<xs:attribute name="description" type="xs:string" use="optional"/>
	</xs:complexType>
	<xs:simpleType name="CorrespondentIdentifierType">
		<xs:restriction base="xs:string">
			<xs:maxLength value="40"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="ValidationInfoEnumType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="Error">
				<xs:annotation>
					<xs:documentation>Błąd.</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="Warning">
				<xs:annotation>
					<xs:documentation>Ostrzeżenie.</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="Other">
				<xs:annotation>
					<xs:documentation>Inne.</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
			<xs:enumeration value="Data">
				<xs:annotation>
					<xs:documentation>Dane.</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="DocumentWithAttachmentType">
		<xs:sequence>
			<xs:element maxOccurs="1" minOccurs="0" name="Attachment" type="tp:DocumentType"/>
			<xs:element maxOccurs="1" minOccurs="1" name="Document" type="tp:DocumentType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:simpleType name="CorrespondentNameType">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="300"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="WebServiceChannelType">
		<xs:complexContent>
			<xs:extension base="tp:BaseChannelType">
				<xs:sequence/>
				<xs:attribute name="login" type="xs:string" use="required"/>
				<xs:attribute name="password" type="xs:string" use="required"/>
				<xs:attribute name="thumbprint" type="xs:string" use="optional"/>
				<xs:attribute name="value" type="xs:anyURI" use="required"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="EmailResultType">
		<xs:sequence>
			<xs:element maxOccurs="20" minOccurs="0" name="AttachmentResult" type="tp:EmailAttachmentResultType">
				<xs:annotation>
					<xs:documentation>Szczegóły wykonania operacji dla danego załącznika.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element maxOccurs="1" minOccurs="1" name="Result" type="tp:ResultType">
				<xs:annotation>
					<xs:documentation>Wynik wykonania operacji dla wiadomości email w postaci kodu (wartości większe od 0 są zwracane w przypadku prawidłowego przetwarzania, mniejsze lub równe 0 w przypadku wystąpienia błędu) i opcjonalnego opisu.
Możliwe wartości:
1 - Operacja zakończyła się powodzeniem
0 - Wiadomość nie zawiera załączników xml.
-39 - Błędny format wiadomości email.</xs:documentation>
				</xs:annotation>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:simpleType name="CompressionTypeEnum">
		<xs:annotation>
			<xs:documentation>Rodzaje obsługiwanej kompresji.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:enumeration value="GZIP">
				<xs:annotation>
					<xs:documentation>Kompresja GZIP.</xs:documentation>
				</xs:annotation>
			</xs:enumeration>
		</xs:restriction>
	</xs:simpleType>
	<xs:element name="EmailResult" type="tp:EmailResultType">
		<xs:annotation>
			<xs:documentation>Komunikat EmailResult jest odpowiedzą Bramki na odebrany komunikat XML przesłany pocztą elektroniczną.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:simpleType name="ChannelEnumType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="Email"/>
			<xs:enumeration value="WebService"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="DocumentOrReferenceType">
		<xs:choice>
			<xs:element maxOccurs="1" minOccurs="1" name="Document" type="tp:DocumentWithContentType"/>
			<xs:element maxOccurs="1" minOccurs="1" name="Reference" type="tp:DocumentType"/>
		</xs:choice>
		<xs:attribute name="fileName" type="xs:string" use="optional">
			<xs:annotation>
				<xs:documentation>Nazwa pliku.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:simpleType name="RepositoryIdType">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="40"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="FileNameType">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="255"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="IdSISCType">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="17"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="OrderIdType">
		<xs:restriction base="xs:string">
			<xs:maxLength value="40"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="DocumentNameType">
		<xs:restriction base="xs:string">
			<xs:maxLength value="80"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="EmailReferenceType">
		<xs:sequence/>
		<xs:attribute name="link" type="tp:LinkType" use="optional">
			<xs:annotation>
				<xs:documentation>Bezpośredni link do pobrania komunikatu zwrotnego.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="orderId" type="tp:OrderIdType" use="optional">
			<xs:annotation>
				<xs:documentation>Unikalny identyfikator zlecenia wysyłki komunikatu zwrotnego (orderId), nadany przez Bramkę.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="DocumentType">
		<xs:sequence>
			<xs:element maxOccurs="1" minOccurs="1" name="Metadata" type="tp:DocumentMetadataType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="DocumentMetadataType">
		<xs:sequence/>
		<xs:attribute name="docNo" type="tp:ReferenceNumberType" use="optional">
			<xs:annotation>
				<xs:documentation>Identyfikator dokumentu w repozytorium komunikatów.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="docTime" type="xs:dateTime" use="optional">
			<xs:annotation>
				<xs:documentation>Data dokumentu (w przypadku dokumentów przychodzących, data odbioru komunikatu przez Bramkę).</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="name" type="tp:DocumentNameType" use="optional">
			<xs:annotation>
				<xs:documentation>Nazwa dokumentu (w przypadku XML nazwa głównego elementu)</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="refNo" type="tp:ReferenceNumberType" use="optional">
			<xs:annotation>
				<xs:documentation>Biznesowy numer sprawy nadany przez System (np. MRN)</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="selfRef" type="tp:ReferenceNumberType" use="optional">
			<xs:annotation>
				<xs:documentation>Numer własny dokumentu nadany przez jego nadawcę (w przypadku dokumentu XML atrybut musi być zgodny z numerem własnym w XML).</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="system" type="tp:SystemType" use="optional">
			<xs:annotation>
				<xs:documentation>System, będący właścicielem/adresatem dokumentu.
Lista obsługiwanych System'ów (zgodnie z specyfikacją 1.05):
- AES,
- AIS_ICS,
- AIS_Import,
- NCTS2.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="mimeType" type="tp:MIMEType" use="optional">
			<xs:annotation>
				<xs:documentation>Typ MIME dokumentu.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:simpleType name="CorrespondentAgencyType">
		<xs:annotation>
			<xs:documentation>Placówka Podmiotu</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="20"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="ChannelType">
		<xs:choice>
			<xs:element maxOccurs="1" minOccurs="1" name="Email" type="tp:EmailChannelType"/>
			<xs:element maxOccurs="1" minOccurs="1" name="WebService" type="tp:WebServiceChannelType"/>
		</xs:choice>
	</xs:complexType>
	<xs:simpleType name="SystemType">
		<xs:annotation>
			<xs:documentation>System</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="20"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>