The Jackson2JsonDecoder supports own media types out of the box because it accepts application/*+json by default. The same does not work with xml (Jaxb2XmlDecoder). If you want to handle a xml response (with an own mediatype eg application/my.type+xml) with the spring webclient you'll get an error because no decoder can be found. You have to manually extend the Jaxb2XmlDecoder and let him accept any xml mediatype through the constructor and register this new decoder in the webclient. I think the Jackson and Jaxb decoder should behave the same way.
The
Jackson2JsonDecodersupports own media types out of the box because it acceptsapplication/*+jsonby default. The same does not work with xml (Jaxb2XmlDecoder). If you want to handle a xml response (with an own mediatype egapplication/my.type+xml) with the spring webclient you'll get an error because no decoder can be found. You have to manually extend theJaxb2XmlDecoderand let him accept any xml mediatype through the constructor and register this new decoder in the webclient. I think the Jackson and Jaxb decoder should behave the same way.