Using polymorphic JAX-WS webservice parameters?

As you might have guessed, XML parser is not able to determine the exact subtype of animal you used when requesting because anything it sees is generic animal and a set of tags that are common to all types, hence the error. What JAX-WS implementation do you use? It is the responsibility of the client to properly wrap polymorphic types when sending request.In Apache CXF (I checked your code against newest 2.3.2 version) the SOAP request body looks like this.

As you might have guessed, XML parser is not able to determine the exact subtype of animal you used when requesting because anything it sees is generic and a set of tags that are common to all types, hence the error. What JAX-WS implementation do you use? It is the responsibility of the client to properly wrap polymorphic types when sending request.In Apache CXF (I checked your code against newest 2.3.2 version) the SOAP request body looks like this: Rambo 15.0 The xsi:type="ns2:dog" is crucial here.

It seems like your JAX-WS client is sending incorrect request that confuses the server. Try sending this request with some other client, like SoapUI, to see whether your server reacts properly.As I said, it works just fine with Spring/Apache CXF and exactly the same code you've provided, I only extracted Java interface to make CXF happy: public interface AnimalFeedingService { @WebMethod void feed(@WebParam(name = "animal") Animal animal); } @WebService @Service public class AnimalFeedingServiceImpl implements AnimalFeedingService { @Override @WebMethod public void feed(@WebParam(name = "animal") Animal animal) { // Whatever } } ...and the server/client glue code.

Using xsi:type from SoapUI worked, the problem must be in my client. Thanks. – adrianboimvaser Feb 10 at 2:08.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions