zoukankan      html  css  js  c++  java
  • XDS框架基本事务及其Soap消息实例

    xds.a框架的基本事务有以下几种:Provide and Register transaction,Register transaction,Patient Identity Feed transactin,Query Registry transaction,

    Retrieve Document Transaction,Response message 

    下面是一些基本事务对应的Soap信息
    XDS Register Document Set transaction

     This transaction must move registry metadata from the Repository actor to the Registry actor. There are no document attachments since the documents have already been deposited in the Repository by this time. This transaction just moves a single element, the bundle of registry metadata.

    Since there is only one item of payload, the SOAP with Attachments format is not used. Instead the simpler SOAP format is used. Below is an example of this format. It contains an HTTP header and a HTTP Body.

    HTTP Header - note the following header fields:

    • SOAPAction is required
    • Content-Type must be as shown

    HTTP Body - note the following points:

    • It is entirely XML
    • The outer-most layers of XML are SOAP
    • Next is the registry SubmitObjectsRequest
    • Within the SubmitObjectsRequest is the registry metadata
    • Notice the namespace definitions on SubmitObjectsRequest.

    View Code
     1 POST /ebxmlrr/registry/soap HTTP/1.1
    2 Accept: */*
    3 Accept-Language: en-us
    4 Referer: http://sst138.ncsl.nist.gov/web/soap/soap-diag-client.htm
    5 Content-Type: text/xml; charset=utf-8
    6 SOAPAction: ""
    7 Accept-Encoding: gzip, deflate
    8 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
    9 Host: gunshot.ncsl.nist.gov:8080
    10 Connection: Keep-Alive
    11 Cache-Control: no-cache
    12 Content-Length: 851
    13
    14 <?xml version="1.0" ?>
    15 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    16 <SOAP-ENV:Header/>
    17 <SOAP-ENV:Body>
    18 <rs:SubmitObjectsRequest
    19 xmlns:rs="urn:oasis:names:tc:ebxml-regrep:registry:xsd:2.1"
    20 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    21 xmlns="urn:oasis:names:tc:ebxml-regrep:rim:xsd:2.1"
    22 xmlns:rim="urn:oasis:names:tc:ebxml-regrep:rim:xsd:2.1">
    23
    24 <!-- registry metadata as defined by XDS goes here -->
    25
    26 </rs:SubmitObjectsRequest>
    27 </SOAP-ENV:Body>
    28 </SOAP-ENV:Envelope>

    XDS Provide and Registry Document Set transaction

    This transaction is used to move documents and metadata from the Document Source actor and the Document Repository actor. Since more than one element of data must be encoded, a coding scheme must be employed that is capable of wrapping multiple elements. That coding scheme is SOAP with attachments.

    HTTP Header - note the following header fields:

    • SOAPAction is required
    • Content-Type has a new part, the boundary sting
    • Within Content-Type is the boundary string to be used as a delimiter between the "parts". This string is typically generated randomly by toolkits that generate this format.
    • The final use of this delimeter has an extra "--". This is critical for some parsers.

    HTTP Body - note the following points:

    • The body has multiple parts separated by the boundary string
    • Each part has a Content-Type header and optionally a Content-ID header
    • The Content-ID header is an "ID" for this piece of content within the message. The "ID" is always surrounded by angle brackets "< >".
    • The first part is always the metadata. See XDS Registry Document Set transaction above for details.
    • An ExtrinsicObject in the metadata representing and XDSDocumentEntry can have a id attribute with this "ID" value. This links the ExtrinsicObject in metadata to real document content in the message.
    • In the example below, the ExtrinsicObject XML element has an id attribute with the value "doc_1". This is interpreted as a "pointer" to the message part with Content-Id equal to <doc_1>.
    • A submission can contain any number of documents
    View Code
     1 POST /ebxmlrr/registry/soap HTTP/1.1
    2 Content-Type: multipart/related; type="text/xml"; boundary=---------------------------7d4285f14803b8
    3 SOAPAction: ""
    4 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
    5 Host: gunshot.ncsl.nist.gov:8080
    6 Accept: */*
    7 Connection: Keep-Alive
    8 Cache-Control: no-cache
    9 Content-Length: 1318
    10
    11 -----------------------------7d4285f14803b8
    12 Content-Type: text/xml
    13
    14 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    15 <SOAP-ENV:Header/>
    16 <SOAP-ENV:Body>
    17 <SubmitObjectsRequest xmlns="urn:oasis:names:tc:ebxml-regrep:registry:xsd:2.1">
    18 <LeafRegistryObjectList>
    19 <ExtrinsicObject id="doc_1" mimeType="text/xml"/>
    20 </LeafRegistryObjectList>
    21 </SubmitObjectsRequest>
    22 </SOAP-ENV:Body>
    23 </SOAP-ENV:Envelope>
    24 -----------------------------7d4285f14803b8
    25 Content-Type: text/xml
    26 Content-Id: <doc_1>
    27
    28 <books>
    29 <book isbn="0345374827"><title>The Great Shark Hunt</title>
    30 <author>Hunter S. Thompson</author></book>
    31 <book><title>Life with Father</title><author>Clarence Day</author></book>
    32 </books>
    33
    34 -----------------------------7d4285f14803b8--

    Using MIME Multipart/Related as a document format

    The MIME Multipart/Related format is used as a document format within XDS-I. 


    View Code
     1 Content-Type: Multipart/Related; boundary=example-2
    2
    3 --example-2
    4 Content-Type: text/plain
    5
    6 Text related to the PDF below is inserted here.
    7 --example-2
    8 Content-Type: application/pdf
    9 Content-Transfer-Encoding: BASE64
    10
    11 BASE64 encoded PDF goes here
    12 --example-2--


    The first line is a Content-Type header which must have as its first value the string "Multipart/Related" and an additional part must document the boundary string to be used. The blank lines (technically \r\n) are used to indicate "end of header". One of the parts must be of type text/plain and the other must be "application/pdf" and the contents of this part must be the BASE64 encoded contents of the relevant PDF.




       

  • 相关阅读:
    java前三章总结
    Java入门第二章
    java编程入门小结
    Java入门第二章
    java预习易错点
    计算机基础
    切换卡
    ajax
    水印4
    shuiyin3
  • 原文地址:https://www.cnblogs.com/ITEagle/p/2400592.html
Copyright © 2011-2022 走看看