1CからのXSL / XSDの操作方法に関する記事はたくさんありますが、それらはすべてスタイルが揃っています:XSDスキーム(シンプルおよびダブル)またはWebサービスを使用して、すべてが簡単にエクスポートまたはインポートできることを確認してください。 しかし、複雑な関係を持つXSDスキームの束が与えられ、それらを変更することはできませんが、スキームの関連性を操作および維持する必要がある場合はどうでしょうか。
この記事の範囲を超えてハブ上でGISハウジングおよび共同サービスを使用する場合、GOSTによる暗号化/署名の問題はすぐに言わなければなりません。 署名はありませんが、リクエストは失敗します。
シンプルなものから始めましょう
-GISハウジングおよび共同サービスと統合するための形式のパッケージをダウンロードし、統合パッケージからすべてのxsdスキームをインポートし、整理し、必要に応じてすべての名前を変更します。 その結果、写真のようになります。
それでは、魔法に取り掛かりましょう。 登録事務所の組織のディレクトリからデータをリクエストしてみましょう。 これは、サブシステムorganization-registry-commonメソッドexportOrgRegistです。
Hcs-organizations-registry-common-service.wsdlのコメント:
hcs-organizations-registry-common-service.wsdlの仕様... <wsdl:message name="exportOrgRegistryRequest"> <wsdl:part name="exportOrgRegistryRequest" element="ro:exportOrgRegistryRequest"/> </wsdl:message> <wsdl:message name="exportOrgRegistryResult"> <wsdl:part name="exportOrgRegistryResult" element="ro:exportOrgRegistryResult"/> </wsdl:message> ... <wsdl:message name="ISRequestHeader"> <wsdl:part name="Header" element="ISRequestHeader"/> </wsdl:message> ... <wsdl:operation name="exportOrgRegistry"> <wsdl:documentation> </wsdl:documentation> <wsdl:input message="tns:exportOrgRegistryRequest"/> <wsdl:output message="tns:exportOrgRegistryResult"/> <wsdl:fault name="InvalidRequest" message="tns:Fault"/> </wsdl:operation> ... <wsdl:operation name="exportOrgRegistry"> <soap:operation soapAction="urn:exportOrgRegistry"/> <wsdl:input> <soap:body use="literal"/> <soap:header message="tns:ISRequestHeader" part="Header" use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> <soap:header message="tns:ResultHeader" part="Header" use="literal"/> </wsdl:output> <wsdl:fault name="InvalidRequest"> <soap:fault name="InvalidRequest" use="literal"/> </wsdl:fault> </wsdl:operation>
ISRequestHeaderヘッダーのexportOrgRegistryRequest本体からSOAPパッケージを収集する必要があります。 それらをxsd統合仕様スキーマで見てみましょう。
hcs-base.xsd ... <xs:element name="ISRequestHeader" type="tns:HeaderType"> <xs:annotation> <xs:documentation> </xs:documentation> </xs:annotation> </xs:element> ... <xs:complexType name="HeaderType"> <xs:annotation> <xs:documentation> </xs:documentation> </xs:annotation> <xs:sequence> <xs:element name="Date" type="xs:dateTime"> <xs:annotation> <xs:documentation> </xs:documentation> </xs:annotation> </xs:element> <xs:element name="MessageGUID" type="tns:GUIDType"> <xs:annotation> <xs:documentation> </xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:complexType> ... <xs:simpleType name="GUIDType"> <xs:annotation> <xs:documentation>GUID-.</xs:documentation> </xs:annotation> <xs:restriction base="xs:string"> <xs:pattern value="([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}"/> </xs:restriction> </xs:simpleType> ...
hcs-organizations-base.xsd ... <xs:element name="OGRN" type="tns:OGRNType"> <xs:annotation> <xs:documentation></xs:documentation> </xs:annotation> </xs:element> <xs:simpleType name="OGRNType"> <xs:restriction base="xs:string"> <xs:length value="13"/> </xs:restriction> </xs:simpleType> ...
hcs-organizations-registry-common-types.xsd ... <xs:element name="exportOrgRegistryRequest"> <xs:annotation> <xs:documentation> </xs:documentation> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="base:BaseType"> <xs:sequence> <xs:element name="SearchCriteria" maxOccurs="100"> <xs:annotation> <xs:documentation> .</xs:documentation> </xs:annotation> <xs:complexType> <xs:sequence> <xs:choice> <xs:choice> <xs:annotation> <xs:documentation> .</xs:documentation> </xs:annotation> <xs:element ref="organizations-base:OGRNIP"/> <xs:sequence> <xs:element ref="organizations-base:OGRN"/> <xs:element ref="organizations-base:KPP" minOccurs="0"/> </xs:sequence> <xs:element ref="organizations-base:NZA"/> </xs:choice> <xs:element ref="organizations-registry-base:orgVersionGUID"/> <xs:element ref="organizations-registry-base:orgRootEntityGUID"/> </xs:choice> <xs:element name="isRegistered" type="xs:boolean" fixed="true" minOccurs="0"> <xs:annotation> <xs:documentation> , </xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="lastEditingDateFrom" type="xs:date" minOccurs="0"> <xs:annotation> <xs:documentation> ()</xs:documentation> </xs:annotation> </xs:element> </xs:sequence> <xs:attribute ref="base:version" use="required" fixed="10.0.2.1"/> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> <xs:element name="exportOrgRegistryResult"> <xs:complexType> <xs:complexContent> <xs:extension base="base:BaseType"> <xs:choice> <xs:element ref="base:ErrorMessage"/> <xs:element name="OrgData" type="tns:exportOrgRegistryResultType" minOccurs="0" maxOccurs="unbounded"> <xs:annotation> <xs:documentation> .</xs:documentation> </xs:annotation> </xs:element> </xs:choice> <xs:attribute ref="base:version" use="required" fixed="10.0.2.1"/> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> <xs:complexType name="exportOrgRegistryResultType"> <xs:sequence> <xs:element ref="organizations-registry-base:orgRootEntityGUID"/> <xs:element name="OrgVersion"> <xs:annotation> <xs:documentation> </xs:documentation> </xs:annotation> <xs:complexType> <xs:sequence> <xs:element ref="organizations-registry-base:orgVersionGUID"/> <xs:element name="lastEditingDate" type="xs:date"> <xs:annotation> <xs:documentation> </xs:documentation> </xs:annotation> </xs:element> <xs:element name="IsActual" type="xs:boolean"> <xs:annotation> <xs:documentation> </xs:documentation> </xs:annotation> </xs:element> <xs:choice> <xs:element name="Legal" type="organizations-registry-base:LegalType"> <xs:annotation> <xs:documentation> </xs:documentation> </xs:annotation> </xs:element> <xs:element name="Subsidiary"> <xs:annotation> <xs:documentation> </xs:documentation> </xs:annotation> <xs:complexType> <xs:complexContent> <xs:extension base="organizations-registry-base:SubsidiaryType"> <xs:sequence> <xs:element name="StatusVersion"> <xs:annotation> <xs:documentation> </xs:documentation> </xs:annotation> <xs:simpleType> <xs:restriction base="xs:string"/> </xs:simpleType> </xs:element> <xs:element name="ParentOrg"> <xs:annotation> <xs:documentation> </xs:documentation> </xs:annotation> <xs:complexType> <xs:sequence> <xs:element ref="organizations-registry-base:RegOrgVersion"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> <xs:element name="Entrp" type="organizations-registry-base:EntpsType"> <xs:annotation> <xs:documentation> </xs:documentation> </xs:annotation> </xs:element> <xs:element name="ForeignBranch" type="organizations-registry-base:ForeignBranchType"> <xs:annotation> <xs:documentation> ( )</xs:documentation> </xs:annotation> </xs:element> </xs:choice> <xs:element name="registryOrganizationStatus" minOccurs="0"> <xs:annotation> <xs:documentation>: (P)UBLISHED - </xs:documentation> </xs:annotation> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="P"/> </xs:restriction> </xs:simpleType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element ref="base:orgPPAGUID" minOccurs="0"/> <xs:element name="organizationRoles" type="nsi-base:nsiRef" minOccurs="0" maxOccurs="unbounded"> <xs:annotation> <xs:documentation> ( №20)</xs:documentation> </xs:annotation> </xs:element> <xs:element name="isRegistered" type="xs:boolean" fixed="true" minOccurs="0"> <xs:annotation> <xs:documentation> </xs:documentation> </xs:annotation> </xs:element> </xs:sequence> </xs:complexType> ...
さあ、始めましょう、必要なXDTOパッケージを開きます。 必要なエンティティはタイプではなくプロパティであることがわかり、私が見つけた記事のXDTOドキュメントでこれを操作する方法は説明されていないため、魔法のレッスンを使用します:
- プロパティからオブジェクトを作成する
- 内部プロパティタイプまたはオブジェクトタイプからオブジェクトを作成する
- 値型からオブジェクトを作成する

body exportOrgRegistryRequestから始めましょう。
& ()
XML要求を収集する関数を作成します。
& XML(Guid, XDTO, XDTO) Base = XDTO..("http:
その結果、リクエストを取得します。
XMLリクエストexportOrgRegistryRequest <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:base="http://dom.gosuslugi.ru/schema/integration/base/" xmlns:hm="http://dom.gosuslugi.ru/schema/integration/house-management/" xmlns:ns="http://www.w3.org/2000/09/xmldsig#" xmlns:nsi-base="http://dom.gosuslugi.ru/schema/integration/nsi-base/" xmlns:nsi-common="http://dom.gosuslugi.ru/schema/integration/nsi-common/" xmlns:organizations-registry-base="http://dom.gosuslugi.ru/schema/integration/organizations-registry-base/" xmlns:ro="http://dom.gosuslugi.ru/schema/integration/organizations-registry-common/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://dom.gosuslugi.ru/schema/integration/house-management-service/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap:Header> <base:ISRequestHeader> <base:Date>2016-10-29T20:06:35</base:Date> <base:MessageGUID>8120c453-d4ee-4918-84f8-276257bb2c84</base:MessageGUID> </base:ISRequestHeader> </soap:Header> <soap:Body> <ro:exportOrgRegistryRequest Id="signed-data-container" base:version="10.0.2.1"> <ro:SearchCriteria> <OGRN xmlns="http://dom.gosuslugi.ru/schema/integration/organizations-base/">1027700132195</OGRN> </ro:SearchCriteria> </ro:exportOrgRegistryRequest> </soap:Body> </soap:Envelope>
リクエストを送信します。
& ()
GISユーティリティ(SIT-1)サーバーからの回答:
XML応答exportOrgRegistryResult <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:ns10="http://dom.gosuslugi.ru/schema/integration/organizations-base/" xmlns:ns11="http://dom.gosuslugi.ru/schema/integration/payments-base/" xmlns:ns12="http://dom.gosuslugi.ru/schema/integration/bills-base/" xmlns:ns13="http://dom.gosuslugi.ru/schema/integration/organizations-registry-common/" xmlns:ns3="http://www.w3.org/2000/09/xmldsig#" xmlns:ns4="http://dom.gosuslugi.ru/schema/integration/base/" xmlns:ns5="http://dom.gosuslugi.ru/schema/integration/account-base/" xmlns:ns6="http://dom.gosuslugi.ru/schema/integration/nsi-base/" xmlns:ns7="http://dom.gosuslugi.ru/schema/integration/individual-registry-base/" xmlns:ns8="http://dom.gosuslugi.ru/schema/integration/metering-device-base/" xmlns:ns9="http://dom.gosuslugi.ru/schema/integration/organizations-registry-base/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <ns4:ResultHeader> <ns4:Date>2016-10-29T20:06:37.185+03:00</ns4:Date> <ns4:MessageGUID>8120c453-d4ee-4918-84f8-276257bb2c84</ns4:MessageGUID> </ns4:ResultHeader> </soap:Header> <soap:Body> <ns13:exportOrgRegistryResult Id="signed-data-container" ns4:version="10.0.2.1"> <ns13:OrgData> <ns9:orgRootEntityGUID>50a8619b-2d27-4f20-8233-eab1ccf9dffe</ns9:orgRootEntityGUID> <ns13:OrgVersion> <ns9:orgVersionGUID>50a8619b-2d27-4f20-8233-eab1ccf9dffe</ns9:orgVersionGUID> <ns13:lastEditingDate>2015-08-10+03:00</ns13:lastEditingDate> <ns13:IsActual>true</ns13:IsActual> <ns13:Legal> <ns9:ShortName> « »</ns9:ShortName> <ns9:FullName> « »</ns9:FullName> <ns10:OGRN>1027700132195</ns10:OGRN> <ns9:StateRegistrationDate>2015-08-10+03:00</ns9:StateRegistrationDate> <ns10:INN>7707083893</ns10:INN> <ns10:KPP>775001001</ns10:KPP> <ns10:OKOPF>12247</ns10:OKOPF> <ns9:Address>. , . , . 19</ns9:Address> <ns9:FIASHouseGuid>93409d8c-d8d4-4491-838f-f9aa1678b5e6</ns9:FIASHouseGuid> </ns13:Legal> <ns13:registryOrganizationStatus>P</ns13:registryOrganizationStatus> </ns13:OrgVersion> <ns4:orgPPAGUID>2c57ed5e-583a-4471-839e-776250bdde50</ns4:orgPPAGUID> <ns13:organizationRoles> <ns6:Code>1</ns6:Code> <ns6:GUID>9875cc2e-73f9-41d6-bceb-47b48ed23395</ns6:GUID> <ns6:Name> </ns6:Name> </ns13:organizationRoles> <ns13:isRegistered>true</ns13:isRegistered> </ns13:OrgData> </ns13:exportOrgRegistryResult> </soap:Body> </soap:Envelope>
ご覧のとおり、提案されたxsdスキームにはそのようなタイプがないため、答えを直接デシリアライズすることはできません。 何らかの形でタグの一部をスキップし、応答領域のみを処理する必要があります。 私もこのトピックに関する情報を見つけられませんでしたが、試行錯誤によって魔法のようになりました。
& (, XDTO)
その結果、標準プラットフォームツールを使用して非常に複雑なxsdスキームを操作できます。 一般に、1Cは入力と入力を制御します。特に、パッケージプロパティ内で別のパッケージの基本型が使用されている場合は冗長すぎますが、いずれにしても、URIスペースが異なるため、型をローカルに減らす必要があります。 プラットフォームがすべての作業を行うため、デシリアライズされたデータを操作すると便利です。 ただし、チェックは実行段階で行われ、コードを記述するとき、1Cプラットフォームはヒントを提供せず、サードパーティのユーティリティを使用して処理を行います。ほとんどの要素の実行時も未定義状態にあり、タイプまたはそのプロパティさえも仕様でのみ見ることができます。