2015-01-26 79 views
0

我是SOAP新手,也許我的問題有點簡單或奇怪。 在我的應用程序(spring-ws,JAXB)中,我使用hr-xml標準與客戶端背景檢查的第三方服務集成。完整的請求看起來像:請求中額外的SOAP信息

<?xml version="1.0" encoding="UTF-8"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope"> 
    <SOAP-ENV:Body> 
     <OrderBackgroundCheck> 
     <OrderBackgroundCheckRequest> 
      <Envelope version="01.00"> 
       <Sender> 
        <Id>DDF</Id> 
        <Credential>USERNAME</Credential> 
       </Sender> 
       <Recipient> 
        <Id>Some app</Id> 
       </Recipient> 
       <TransactInfo transactType="request" environment="alpha" mode="test"> 
        <TransactId>1</TransactId> 
        <TimeStamp>2009-04-30T12:28:23</TimeStamp> 
       </TransactInfo> 
       <Packet> 
        <PacketInfo packetType="request"> 
        <PacketId>1</PacketId> 
        <Action>OrderBackgroundCheck</Action> 
        <Manifest>BackgroundCheck.xsd</Manifest> 
        </PacketInfo> 
        <Payload> 
        <![CDATA[...]]> 
        </Payload> 
       </Packet> 
      </Envelope> 
     </OrderBackgroundCheckRequest> 
     </OrderBackgroundCheck> 
    </SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 

現在我有它發送的請求的測試代碼:內Payload

BackgroundCheckType type = new BackgroundCheckType(); //classes generated by JAXB from xsd 
// fill type with data 
webServiceTemplate.marshalSendAndReceive(objectFactory.createBackgroundCheck(type)); 

BackgroundCheckType是XML部分根(在CDATA雲) 據我瞭解,spring-ws用SOAP EnvelopeBody'包裝'我的數據。我也可以創建OrderBackgroundCheckOrderBackgroundCheckRequest類,並使用JAXB編寫它。

但第二部分Envelope(與Sender,Recipient,TransactInfo等)看起來與某些標準有關。看起來像哪些可以由一些框架生成和維護。我不知道如何以及我可以做什麼框架。

也許有人可以幫忙,或只是解釋它是什麼?爲什麼SOAP消息包含兩個信封? 謝謝!

回答

0

是的,所有這些額外的東西,如內部EnvelopeTransactInfo是服務相關的。第三方服務完全需要這種信息。沒有其他選項可以期望手動支持。