2013-04-23 144 views
1

我做了大量的研究,找不到任何能夠明確修復我的問題的東西。mustUnderstand屬性不只是設置爲false。

我用wsdl2java生成了我的SOAP客戶端,問題是我的信封在發送時在HeaderElement中創建了我不需要的屬性。

我已經創建了一個處理程序來構建我的標題,但一直無法將這些屬性去掉標題。

示例XML外出。

<soapenv:Envelope xmlns:soapenv="http://..." 
xmlns:v2="http://..." 
xmlns:xsd="http://..." xmlns:xsi="..."> 
<soapenv:Header> 
    <v2:wsMessageHeader soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" 
     soapenv:mustUnderstand="0"> 
     <v2:trackingMessageHeader> 
      <values>....</values> 
     </v2:trackingMessageHeader> 
    </v2:wsMessageHeader> 
</soapenv:Header> 
<soapenv:Body> 
    <item 
     xmlns="http://..."> 
     <geoCode>Zip</geoCode> 
     <zip> 
      <uspsPostalCd>49001</uspsPostalCd> 
     </zip> 
    </item> 
</soapenv:Body> 

我需要的soapenv:演員和soapenv:mustUnderstand屬性屬性被完全刪除。

回答

-1

的SOAP Header是可選的element..You應該能夠將其刪除..

messagecontext.getEnvelope().getHeader().detach(); 

不需要做的研究噸:)

相關問題