2017-01-14 68 views
0

嗨我有一個問題很長一段時間,我無法解決。當我使用spring run boot命令在STS spring上運行我的應用程序時,一切正常。但是,如果我嘗試在tomcat上部署應用程序,除了向肥皂消息添加一個名稱空間以拒絕對soap服務的調用以外,所有東西都可以工作。在tomcat服務器上的SOAP消息名稱空間問題

我在彈簧啓動時在下面插入正確的soap消息,並在tomcat上跟隨錯誤消息。

消費滿BOOT SUCCESS SOAP味精:

<RetrieveDocumentSetRequest 
xmlns="urn:ihe:iti:xds-b:2007" 
xmlns:ns2="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" 
xmlns:ns3="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" 
xmlns:ns4="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0" 
xmlns:ns5="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0"> 
<DocumentRequest> 
<RepositoryUniqueId>2.16.840.1.113883.2.9.2.999.4.5.113883</RepositoryUniqueId> 
<DocumentUniqueId>2.16.840.1.113883.2.9.2.999.4.4^123456</DocumentUniqueId></DocumentRequest> 
</RetrieveDocumentSetRequest> 

TOMCAT 7 FAIL SOAP味精:

<ns6:RetrieveDocumentSetRequest 
xmlns:ns2="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" 
xmlns:ns3="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" 
xmlns:ns4="urn:oasis:names:tc:ebxml-regrep:xsd:lcm:3.0" 
xmlns:ns5="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" 
xmlns:ns6="urn:ihe:iti:xds-b:2007"> 
<DocumentRequest><RepositoryUniqueId>2.16.840.1.113883.2.9.2.999.4.5.113883</RepositoryUniqueId> 
<DocumentUniqueId>2.16.840.1.113883.2.9.2.999.4.4^123456</DocumentUniqueId> 
</DocumentRequest> 
</ns6:RetrieveDocumentSetRequest> 

正如你所看到的消息是,除了N6命名空間幾乎相同。我不明白爲什麼以及如果Tomcat方面有錯誤的Jar,可以使用springboot sever。

回答

0

我已經解決了我的問題。 在spring引導的pom.xml中指定的生成器類,使用JAXB從接口WSDL生成類,而使用和釋放tomcat的Jar,使用jax-ws庫生成從WSDL開始的幾代類。 第一個庫JAXB插入關於名稱空間的註釋,既在類屬性上,也在生成的類的內部類中插入。所有這些在使用jax-ws時都不會發生,但僅適用於某些類。即使一見鍾情,這件事情也無關緊要,會創建一個由驗證器服務器端拒絕的答覆,即發送的SOAP請求。

我希望它能幫助未來的人。