0
我试图创建一个Web服务,以制作一个简单的SOAP响应ping请求:格式SOAP响应
<soap:Envelope>
<soap:Body>
<CustomRS attr="somevalue">
<Success/>
</CustomRS>
</soap:Body>
</soap:Envelope>
相反,我得到这个响应
<soap:Envelope>
<soap:Body>
<PingResponse>
<CustomRS attr="somevalue">
<Success/>
</CustomRS>
</PingResponse>
</soap:Body>
</soap:Envelope>
“平安”是我的WebMethod和CustomRS的名称是我的Serializable响应对象。我如何摆脱PingResponse元素,并将CustomRS作为根元素?
我实现
@WebService (name = '', serviceName = ''targetNamespace = '')
@Stateless (mappedName = '')
public class TestEjb implements Testnterface {
@SOAPBinding(style=Style.DOCUMENT, use=Use.LITERAL, parameterStyle=ParameterStyle.BARE)
@WebResult (name = "CustomRS", targetNamespace = "name space")
@WebMethod (operationName = "CustomRS")
public CustomRS_OutPut Ping(@WebParam (name = "header",Type type,
@WebParam (name = "parameters", Param param) throws Exception
{
}