hi
I am using the following piece of code to create a model from a wsdl file.
public static void main(String args[]) {
URI fileURI = URI.createURI("someurl.wsdl");
WSDLResourceFactoryImpl factImpl = new WSDLResourceFactoryImpl();
WSDLResourceImpl wsdlResource = (WSDLResourceImpl)factImpl.createResource(fileURI);
ResourceSet set = new ResourceSetImpl();
set.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xml", new XMLResourceFactoryImpl());
set.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xsd", new XSDResourceFactoryImpl());
wsdlResource.basicSetResourceSet(new ResourceSetImpl(), null);
Definition loadedDefinition = null;
try {
wsdlResource.load(null);
loadedDefinition = wsdlResource.getDefinition();
Iterator<PortType> portTypes = loadedDefinition.getEPortTypes().iterator();
while (portTypes.hasNext()) {
PortType portType = (PortType)portTypes.next();
System.out.println("PorType: " + portType.getQName().getLocalPart());
Iterator<Operation> operations = portType.getOperations().iterator();
while (operations.hasNext()) {
Operation operation = operations.next();
Input ip = (Input)operation.getEInput();
Output op = (Output)operation.getOutput();
}
}
} catch (Exception exp) {
exp.printStackTrace();
}
}
}
From this I want to construct a SOAP message for one of the operations programatically. How can I do this?