2
在我的模式我有以下元素:如何在驗證根據WSDL切換 - 春天引導和彈簧WS
<xs:element name="deletePokemonsRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="pokemonId" type="xs:int" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
而且我有它的端點:
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "deletePokemonsRequest")
@ResponsePayload
public DeletePokemonsRequest deletePokemons(@RequestPayload DeletePokemonsRequest deletePokemons){
pokemonDAO.deletePokemons(deletePokemons.getPokemonId());
return deletePokemons;
}
當我送在此端點上:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pok="www">
<soapenv:Header/>
<soapenv:Body>
<pok:deletePokemonsRequest>
</pok:deletePokemonsRequest>
</soapenv:Body>
</soapenv:Envelope>
它被接受,但它應該在驗證階段被拒絕。爲什麼?因爲我設置了minOccurs=1
,但它接受了包含0
元素的信封。
如何根據WSDL打開驗證?
怎麼樣在許多xsd文件的情況下? –
@HaskellFun PayloadValidatingInterceptor也有setXsdSchemaCollection()方法列表模式 – eis
我有許多文件的問題。你能附上很多xsd文件的例子嗎? –