2017-08-28 93 views
0

我有一個預編譯的類,我的輸入SOAP消息應該適合。

字段和順序一切都是正確的,除了命名空間,我試着在@webservice中以及在輸入SOAP xmlns中添加相同的命名空間。

但我收到以下錯誤。如何在SOAP請求中正確定義名稱空間?

enter image description here

我的服務:

@WebService(serviceName = "OTMTransService",targetNamespace="http://xmlns.oracle.com/apps/otm/transmission/v6.4") 
public class OTMTransServiceImpl implements OTMTransService{ 

XML輸入我打,

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:trm="http://receiver.tms.renault"> 
     <soapenv:Header/> 
     <soapenv:Body> 
      <trm:publish> 
      <Transmission> 
     <TransmissionHeader/> 
     <TransmissionBody>... 
    </TransmissionBody> 
    </Transmission> 
    </trm:publish> 
    </soapenv:Body> 
</soapenv:Envelope> 

輸出我得到,

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soap:Body> 
     <soap:Fault> 
      <faultcode>soap:Client</faultcode> 
      <faultstring>Unmarshalling Error: unexpected element (uri:"", local:"TransmissionHeader"). Expected elements are &lt;{http://xmlns.oracle.com/apps/otm/transmission/v6.4}TransmissionBody>,&lt;{http://xmlns.oracle.com/apps/otm/transmission/v6.4}TransmissionHeader> </faultstring> 
     </soap:Fault> 
    </soap:Body> 
</soap:Envelope> 

回答

0

您需要前綴TRANSM issionHeader和TransmissionBody與命名空間前綴和聲明的前綴:

In the top tag add: xmlns:ts="http://xmlsns.oracle.com/apps...the rest..." then ... <ts:TransmissionHeader>... <ts:TransmissionBody>...

如果您貼上您的XML請求文本我可以告訴你更具體

+0

我已經更新了細節..請幫助 –

相關問題