我的模式是:
<xsd:element name="SetMonitor">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="period" type="xsd:long" />
<xsd:element name="refreshrate" type="xsd:long" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
而我的XML是:
情况1。
<SetMonitor
xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:cb="http://schemas.cordys.com/1.0/coboc">
<period/>
<refreshrate/>
</SetMonitor>
或 案例2。
<SetMonitor
xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:cb="http://schemas.cordys.com/1.0/coboc">
<period>10</period>
<refreshrate>20</refreshrate>
</SetMonitor>
对于情况2没有任何问题。 但是,对于情况1,我得到以下错误:
Caused by: org.xml.sax.SAXException: cvc-datatype-valid.1.2.1: '' is not a valid value for 'integer'.
org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 14; cvc-datatype-valid.1.2.1: '' is not a valid value for 'integer'.
我如何修改WSDL,使它同时接受情况1和情况2? 请帮忙。