[問題] 用JAX-WS 製作 SOAP web service問題
最近在學習建立web service,實作概念大概同這篇教學範例,
http://www.mkyong.com/webservices/jax-ws/jax-ws-hello-world-example/
執行上一切都沒問題,
由於每次透過JAX-WS建立的service,SOAP request中的Method一定會有namespace
如下getHelloWorldAsString method 的 ns2:
<S:Envelope xmlns:S="" rel="nofollow">http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:getHelloWorldAsString xmlns:ns2="" rel="nofollow">http://XXXXXXX">
<arg0>Hello world PTT!</arg0>
</ns2:getHelloWorldAsString>
</S:Body>
</S:Envelope>
可是我希望的需求架構是在Method Tag內不想要有出現namespace,
像是webserviceX內的這個例子,
( http://www.webservicex.net/globalweather.asmx?op=GetCitiesByCountry )
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="" rel="nofollow">http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetCitiesByCountry xmlns="" rel="nofollow">http://www.webserviceX.NET">
<CountryName>string</CountryName>
</GetCitiesByCountry>
</soap:Body>
</soap:Envelope>
如上soap body內的method都是不帶有namespace的,
我試過網路上一些解法,像是設定targetNamespace=""等等
不知道是沒設好還是怎樣的完全都沒效果,
沒有辦法製造出可以吃 method 沒有 namespace 的request,
還請有對這塊有經驗的版友幫幫忙解答囉~
感謝~
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.225.89.31
※ 文章網址: http://www.ptt.cc/bbs/java/M.1418743018.A.16D.html
※ 編輯: cpc (36.225.89.31), 12/16/2014 23:20:14
推
12/20 11:57, , 1F
12/20 11:57, 1F
java 近期熱門文章
PTT數位生活區 即時熱門文章