更新时间:2023-09-11 22:28:22
今天您很幸运!有两种选择:
Today you're in luck! There is two options:
将WSDL文档文件和方案文件的副本保存到您的项目中.
Save a copy of the WSDL document file and the schemma files to your project.
ClassLoader classloader = Thread.currentThread().getContextClassLoader();
URL wsdlLocation = classloader.getResource("MyHelloService.wsdl");
QName serviceName= new QName("http://test.com/", "MyHelloService");
MyHelloService service = new MyHelloService(wsdlLocation, serviceName);
service.sayHello("Test");
QName qname = new QName("http://thenamespace", "FooService");
FooService service = new FooService(null, qname); // null for ignore WSDL
Foo port = service.getFooPort();
BindingProvider bindingProvider = (BindingProvider) port;
bindingProvider.getRequestContext()
.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://foo.com/soap/fooBean");
// Use the service
Object obj = port.doSomething(param);
另请参阅:
See also: