Using the parameter type Object is not a good idea, since it will map to a custom JAXB type. When you later use it in your endpoint implementation class in this code:
Then the toString method will be called on an instance of the JAXB custom type, which does not know that you want to use it as a string.
JAX-WS and JAXB does know how to handle custom types, but they does not know how to read your mind.
Thus, if you want to use an object as a standard type, then type it as a standard type.
Note also that even though it is a SOAP web service, SOAP has nothing to do with handling custom types.
Additionally, to be picky: Your class is not a web service provider - it is a web service endpoint implementation class.
If you use the word "provider" when talking about a web service endpoint class developed in Java, people may thing that you mean an endpoint implementation class annotated with the @WebServiceProvider annotation that implements the Provider interface (see the JavaSE 6 API documentation for details).
Joined: Apr 24, 2009
Ups! Sorry about Provider stuff - I meant to say "Producer".
True, true about to String, but the problem is a bit misleading since I did not mention the problem as it is! I am sorry for that!
The stuff is actually a bit more complicated as it seems (at least to me) :
Now, here it is : I have made the same method to take as input 2 Objects. I expose the WSDL and build the client. Then I go back to the Producer and change the Objects to String and deploy it. If I try to consume this web service with soapUI (remember that WSDL is still xsd:anyType) , sopaUI does not know how to handle this "any:Type" that actually is a String and puts null instead. If I build a client (Java Code) - and pass two Strings it's all good!
I do not even know who to blame (soapUI for not knowing how to deal with xsd:anyType or ...) - of course I should NOT do stuff like redeploying the producer... but believe it or not this is my case in a future production environment and there is no way to change the WSDL to xsd:string!