java如何将JAXWS中的Date@webgram映射到xsd:Date而不是xsd:datetime?
我有以下接口,它表示我正在使用的远程Web服务
@WebService(name="ws_listadosPort", portName="ws_listadosPort", targetNamespace="...")
@SOAPBinding(style=Style.RPC, use=Use.ENCODED, parameterStyle=ParameterStyle.WRAPPED)
public interface TheService {
@WebMethod(operationName="someMethod")
@WebResult(partName="return")
String someMethod(@WebParam(name="when", partName="when") Date when);
}
我正在创建一个webservice客户端,只需执行以下操作
QName serviceName = new QName(namespace, "ws_listados");
QName portTypeName = new QName(namespace, "ws_listadosPort");
Service service = Service.create(new URL(wsdlLocation), serviceName);
TheService servicePort = service.getPort(portTypeName, TheService.class);
以及调用所需的方法。但是,在检查(通过fiddler)生成的信封时,我注意到“when”参数作为xsd:dateTime发送
<?xml version="1.0" ?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:someMethod xmlns:ns2="..."><when>2014-04-21T12:00:00-03:00</when></ns2:someMethod>
</S:Body>
</S:Envelope>
我引用的wsdl声明,当参数是xsd:date而不是xsd:dateTime时
<message name="someMethodRequest">
<part name="when" type="xsd:date" />
</message>
<portType name="ws_listadosPortType">
<operation name="someMethod">
<input message="tns:someMethodRequest"/>
<output message="tns:someMethodResponse"/>
</operation>
</portType>
我正在使用Jersey的JAX-WS实现。如何调整注释(甚至参数数据类型)以生成带有编码为xsd:date而不是xsd:dateType的“when”参数的请求
共 (0) 个答案