THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block |
---|
package com.mycompany.demo; import javax.xml.namespace.QName; import javax.xml.ws.Service; public class Client { public static void main(String args[]) { QName serviceName = new QName("http://org.apache.cxf", "stockQuoteReporter"); Service s = Service.create(serviceName); QName portName = new QName("http://org.apache.cxf", "stockQuoteReporterPort"); Dispatch<DOMSource> dispatch = s.createDispatch(portName, DOMSource.class, Service.Mode.PAYLOAD); ... } } |
Constructing request messages
...
Code Block |
---|
T invoke(T msg) throws WebServiceException; |
...
Code Block |
---|
// Creating a DOMSource Object for the request DocumentBuilder db = DocumentBuilderFactory.newDocumentBuilder(); Document requestDoc = db.newDocument(); Element root = requestDoc.createElementNS("http://org.apache.cxf/stockExample", "getStockPrice"); root.setNodeValue("DOW"); DOMSource request = new DOMSource(requestDoc); // Dispatch disp created previously DOMSource response = disp.invoke(request); |
...
Code Block |
---|
Response <T> invokeAsync(T msg) throws WebServiceException; |
...
Code Block |
---|
Future<?> invokeAsync(T msg, AsyncHandler<T> handler) throws WebServiceException; |
...
Code Block |
---|
void invokeOneWay(T msg) throws WebServiceException; |
...