2017-04-25 92 views
0

在運行WSDL2Javasample我想檢查生成WSDL,因爲我是有在client code Netbeans generated從web服務的問題。是thisWSDL有效還是無效?如果無效,爲什麼它在XML「公佈」,在URL,以及作爲WSDL這個WSDL有效嗎?

運行WSDL2Javavalidator from the CLI顯示爲無效:

[email protected]:~$ 
[email protected]:~$ echo $JAVA_HOME 
/usr/lib/jvm/java-8-openjdk-amd64/ 
[email protected]:~$ 
[email protected]:~$ jars/apache-cxf-3.1.11/bin/wsdlvalidator https://www.w3schools.com/xml/tempconvert.asmx?WSDL 
WSIBP Validator found <{https://www.w3schools.com/xml/}TempConvertHttpPost> is NOT a SOAP binding 
WSDLValidator Error : 
line 127 column 66 of https://www.w3schools.com/xml/tempconvert.asmx?WSDL: cvc-complex-type.4: Attribute 'part' must appear on element 'mime:content'. 

line 136 column 66 of https://www.w3schools.com/xml/tempconvert.asmx?WSDL: cvc-complex-type.4: Attribute 'part' must appear on element 'mime:content'. 

[email protected]:~$ 

然而,這,從字面上看,第一次我用WSDL2Java API的。也許有一個online驗證程序作爲Web服務運行?

雖然我沒能保存報表,它似乎是有效的,下載頁面,然後上傳後:

https://www.wsdl-analyzer.com/service/service/893784871?version=1

+0

WSDL是確定,在.net檢查作爲ClientService,但服務是[向下](https://www.w3schools.com/xml/tempconvert.asmx?op=CelsiusToFahrenheit); – Seyran

回答

1

上述WSDL包含三個不同的綁定:肥皂1.1,SOAP 1.2和HTTP,這意味着有三種不同的方法/協議調用temperaturte轉換器web服務,你可以在這裏看到: https://www.w3schools.com/xml/tempconvert.asmx?op=CelsiusToFahrenheit

但WSDL工具和互操作性工作b如果你堅持只用肥皂1.1綁定的話。爲了學習目的,找到一個只有soap 1.1綁定的WSDL。