code from my prototype project. This takes xml file as input and transfers the xml to the webserice.
URL wsdlLocation = new URL("http://10.144.135.225:9080/CimrsWeb/ReportWebService?wsdl");
QName serviceQName =
new QName("http://webservices.cimrs.dss.gov/", "ReportWebService");
QName portQName = new QName("http://webservices.cimrs.dss.gov/", "ReportWebPort");
Service service = Service.create(wsdlLocation, serviceQName);
Dispatch
service.createDispatch(portQName, Source.class,
Service.Mode.PAYLOAD);
InputStream requestStream= new FileInputStream("C://input.xml");
Source request1 = new StreamSource(requestStream);
Source response1 = dispatch.invoke(request1);
Transformer copier = TransformerFactory.newInstance().newTransformer();
copier.transform(response1, new StreamResult(System.out));
No comments:
Post a Comment