Hello list.
I am having some trouble sending a date in HTTP GET via a Java-first SOAP
implementation.
import java.util.Date;
@WebService()
public interface MyInterface {
public Date test1();
public void test2(@WebParam(name = "date") Date date);
}
public class MyImplementation implements MyInterface {
public Date test1() {
return new Date();
}
public void test2(Date date) {
System.out.println("" + date);
}
}
public class StartTestDims {
public static void main(String[] args) {
MyImplementation implementor = new MyImplementation();
JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
svrFactory.setServiceClass(MyInterface.class);
svrFactory.setAddress("http://localhost:9000/TestDims");
svrFactory.setServiceBean(implementor);
svrFactory.getInInterceptors().add(new LoggingInInterceptor());
svrFactory.getOutInterceptors().add(new LoggingOutInterceptor());
svrFactory.create();
}
}
When I go:
http://localhost:9000/TestDims/test1
I get:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:test1Response xmlns:ns2="http://unknown.namespace/">
<return>2010-09-13T14:23:30.879+02:00</return>
</ns2:test1Response>
</soap:Body>
</soap:Envelope>
But when I go:
http://localhost:9000/TestDims/test2?date=2010-09-13T14:23:30.879%2B02:00
(Where %2B is the URL encoding of +) I get:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>argument type mismatch while invoking public abstract void
MyInterface.test2(java.util.Date) with params
[2010-09-13T14:23:30.879+02:00].</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
What I am doing wrong? What is the correct format for an xsd:date via HTTP
GET SOAP?
(The end-implementation will use SOAP over HTTP POST - I need this for
documentation and cross-platform testing.)
-- Christian