我简要说明:
如何让wsdl2java生成SOAP 1.2绑定?
详细说明:
我使用工具(apache cxf 3.0.2)为wsdl生成了java服务类wsdl2java:
MBA-Anton:bin asmirnov$ ./wsdl2java -server -catalog /tmp/wsdl/catalog -d /tmp/onvif/server http://www.onvif.org/onvif/ver10/network/wsdl/remotediscovery.wsdl
Run Code Online (Sandbox Code Playgroud)
然后我创建了服务代码并运行它,它正在运行:
public static void main(String args[]) throws InterruptedException {
System.out.println("Starting Server");
Endpoint.publish("udp://239.255.255.250:3702", new DiscoveryService());
System.out.println("Server ready...");
Thread.sleep(10 * 60 * 1000); // 10 min
System.out.println("Server exiting");
System.exit(0);
}
Run Code Online (Sandbox Code Playgroud)
开始记录:
Starting Server
28.11.2014 19:51:59 org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
INFO: Creating Service {http://www.onvif.org/ver10/network/wsdl}DiscoveryService from class org.onvif.ver10.network.wsdl.DiscoveryLookupPort
28.11.2014 19:52:00 org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be udp://239.255.255.250:3702
28.11.2014 19:52:00 org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean buildServiceFromWSDL
INFO: …Run Code Online (Sandbox Code Playgroud)