avoiding arg0 tag
I am using EJB3 webservice and Jaxb. No where in my input xsd I have metioned an element arg0. But its getting created when I open the WSDL in my SOAP UI. Ho开发者_如何学Cw do I avoid this?
Think getting arg0, arg1 is a JAXWS specification. If we want to customize it we have to use @WebParam and @WebResult annotations to specify nice names. If someone can validate this understanding it would be great.
I faced the same issue, in my SOAP request the body was getting wrapped inside an arg0 element. The solution was to use the annotation
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
as the default value is
SOAPBinding.ParameterStyle.WRAPPED
due to which the SOAP body gets wrapped in an arg0 element. The web service interface looks like
@WebService(targetNamespace = WSInterface.NAMESPACE_REQUEST)
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface WSInterface{
String NAMESPACE_REQUEST = "...";
String NAMESPACE_RESPONSE = "...";
String TARGET_OPERATION = "...";
String RESULT_ELEMENT = "...";
@WebMethod(operationName = TARGET_OPERATION)
@WebResult(name = RESULT_ELEMENT, targetNamespace = NAMESPACE_RESPONSE)
ResponseType executeWs(RequestType wsRequest);
}
精彩评论