java - What do I need to do to accept an array parameter in webservice? -
In order to create a web service for WS, I'm taking two strings and one array of such organs I have a webservice interface and implementation and it's like this:
@WebMethod (operationName = "getStuff") @WebResult (Name = "result") mix host (@ webparam (name = "string 1") string one, @ webparam (name = "string 2") string two, @ webp Ram (name = "stuff") Stuff [] stuff);
I am changing a type of mix that is a square in my project and I am accepting several types of material which is another class in my project. Testing from Java is not a problem, but when someone tries to consume another service or I try to send a request with soap, the array is always coming in the null. Why do I need to do this so that my service is being consumed, can I send it properly in the type of staff? Need to do some customization with JAXB?
JAXB2 uses lists and not arrays, so you should change @WebShop (name = "result "Sign in to Mix Millstuff (@WebParam (name =" string 1 ") string one, @ webparam (name)
@WebMethod (operation name =" getStuff ") @ =" String2 ") String two, @WebParam (name =" stuff ") java.util.List; & Gt; Accessories & gt; material);
Also, make sure that there are JAXB annotations in mix
and stuff
.
Comments
Post a Comment