About this task
To create a Dispatch
object do the following:
Procedure
Results
The following table describes the parameters for createDispatch()
.
Parameter |
Description |
---|---|
portName |
Specifies the QName of the |
type |
Specifies the data type of the objects used by the |
mode |
Specifies the usage mode for the |
The code below creates a Dispatch
object that works with
DOMSource
objects in payload mode.
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);
...
}
}