[問題] 請問Web Service的問題?
最近需要使用到Web Service,結果搞了好多天都沒有搞定。
先自學一下,建立和使用...
網路上找了很多資料來看,最基本的利用tomcat建立Web Service
並用wsimport -keep 建立可以使用的java檔
這些都沒問題
(另外還有看到一種要下載很多.jar檔的方法,看起來太複雜。我就沒有深入研究了)
但接收到的URL在接上WSDL描述檔的格式看起來頗複雜
直接wsimport會出現
[ERROR] Property "Any" is already defined. Use <jaxb:property> to resolve
this conflict.
是因為描述檔裡的結構是長這樣的...
<wsdl:definitions .....>
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="" rel="nofollow">http://tempuri.org/">
<s:element name="getResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="getsResult">
<s:complexType>
<s:sequence>
<s:any minOccurs="0" maxOccurs="unbounded"
namespace="http://www.w3.org/2001/XMLSchema" processContents="lax"/>
<s:any minOccurs="1"
namespace="urn:schemas-microsoft-com:xml-diffgram-v1" processContents="lax"/>
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
<wsdl:types>
</wsdl:definitions>
有兩個s:any ...從網路上爬文是寫說須要寫binding檔,但問題是我寫了這個binding檔
<jxb:bindings xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb" version="2.1">
<jxb:bindings schemaLocation="s:schema">
<jxb:bindings
node="//s:element[@name='getResponse']/s:complexType/s:sequence/
s:element[@name='getResult']/s:complexType/s:sequence/
s:any[@namespace='urn:schemas-microsoft-com:xml-diffgram-v1']">
<jxb:property name="any2" />
</jxb:bindings>
</jxb:bindings>
</jxb:bindings>
結果出現 "s:schema" is not a part of this compilation.
請問這個問題是...出在哪? 請各位高手指點一二
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.116.67.28
推
01/09 11:17, , 1F
01/09 11:17, 1F
→
01/09 12:52, , 2F
01/09 12:52, 2F
→
01/09 13:46, , 3F
01/09 13:46, 3F
推
01/09 15:12, , 4F
01/09 15:12, 4F
→
01/09 15:51, , 5F
01/09 15:51, 5F
→
01/09 15:58, , 6F
01/09 15:58, 6F
→
01/10 11:10, , 7F
01/10 11:10, 7F
→
01/10 16:27, , 8F
01/10 16:27, 8F
→
01/10 16:29, , 9F
01/10 16:29, 9F
推
01/11 17:09, , 10F
01/11 17:09, 10F