refElement.setSchemaType(wsaType);
refElement.setSchemaTypeName(wsaType.getQName());
// Create an annotation which contains the CORBA binding for the element
XmlSchemaAnnotation annotation = new XmlSchemaAnnotation();
XmlSchemaAppInfo appInfo = new XmlSchemaAppInfo();
try {
DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = db.newDocument();
Element el = doc.createElement("appinfo");
el.setTextContent("corba:binding=" + bindingName.getLocalPart());
// TODO: This is correct but the appinfo markup is never added to the
// schema. Investigate.
appInfo.setMarkup(el.getChildNodes());
} catch (ParserConfigurationException ex) {
throw new RuntimeException("[ObjectReferenceVisitor: error creating endpoint schema]");
}
annotation.getItems().add(appInfo);