Articles
Java Platform, Standard Edition
Code Fragment 4
private void updatePO() {
Service service = Service.create(qname);
service.addPort(qname, HTTPBinding.HTTP_BINDING, url);
Dispatch<Source> dispatcher = service.createDispatch(qname, Source.class,
Service.Mode.MESSAGE);
Map<String, Object> requestContext = dispatcher.getRequestContext();
requestContext.put(MessageContext.HTTP_REQUEST_METHOD, "PUT");
Source result = dispatcher.invoke(new StreamSource(new StringReader(poXML)));
printSource(result);
}
|