Including WSDL in the connector archive
The worst-case scenario is when a WSDL is not programmatically accessible. In this situation, the WSDL must be included in the connector archive. This is not ideal because there is no way to make the WSDL user-specific, and any changes to the WSDL require building and deploying a new connector.
- Extend the WSCache class and override the
readWsdl()method.
Code sample
// name of the file containing the WSDL in the connector jar
private static final String WSDL_RESOURCE = "com/myservice/connector/MyService.wsdl";
@Override
protected Definition readWsdl(WSDLReader reader)
throws WSDLException, IOException
{
try {
URL wsdlUrl = ClassUtil.getResource(WSDL_RESOURCE);
wsdlUrlString = wsdlUrl.toURI().toString();
return reader.readWSDL(wsdlUrlString);
} catch(URISyntaxException e) {
thrownew ConnectorException("Errors occurred attempting to parse URL: " + WSDL_RESOURCE, e);
}
}
Was this topic helpful?