use of com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding in project metro-jax-ws by eclipse-ee4j.
the class JAXWSBindingExtensionHandler method handleServiceExtension.
@Override
public boolean handleServiceExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
if (XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)) {
context.push();
context.registerNamespaces(e);
JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e));
for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext(); ) {
Element e2 = Util.nextElement(iter);
if (e2 == null) {
break;
}
if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)) {
parseClass(context, jaxwsBinding, e2);
if ((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null)) {
((Service) parent).setDocumentation(new Documentation(jaxwsBinding.getClassName().getJavaDoc()));
}
} else {
Util.fail("parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI());
return false;
}
}
parent.addExtension(jaxwsBinding);
context.pop();
// jaxwsBinding);
return true;
} else {
Util.fail("parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI());
return false;
}
}
use of com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding in project metro-jax-ws by eclipse-ee4j.
the class JAXWSBindingExtensionHandler method parseGlobalJAXWSBindings.
/**
*/
private boolean parseGlobalJAXWSBindings(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
context.push();
context.registerNamespaces(e);
JAXWSBinding jaxwsBinding = getJAXWSExtension(parent);
if (jaxwsBinding == null) {
jaxwsBinding = new JAXWSBinding(context.getLocation(e));
}
String attr = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.WSDL_LOCATION_ATTR);
if (attr != null) {
jaxwsBinding.setWsdlLocation(attr);
}
attr = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.NODE_ATTR);
if (attr != null) {
jaxwsBinding.setNode(attr);
}
attr = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.VERSION_ATTR);
if (attr != null) {
jaxwsBinding.setVersion(attr);
}
for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext(); ) {
Element e2 = Util.nextElement(iter);
if (e2 == null) {
break;
}
if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PACKAGE)) {
parsePackage(context, jaxwsBinding, e2);
if ((jaxwsBinding.getJaxwsPackage() != null) && (jaxwsBinding.getJaxwsPackage().getJavaDoc() != null)) {
((Definitions) parent).setDocumentation(new Documentation(jaxwsBinding.getJaxwsPackage().getJavaDoc()));
}
} else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)) {
parseWrapperStyle(context, jaxwsBinding, e2);
} else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)) {
parseAsynMapping(context, jaxwsBinding, e2);
} else // }
if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)) {
parseMimeContent(context, jaxwsBinding, e2);
} else {
Util.fail("parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI());
return false;
}
}
parent.addExtension(jaxwsBinding);
context.pop();
// jaxwsBinding);
return true;
}
use of com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding in project metro-jax-ws by eclipse-ee4j.
the class WSDLModeler method isAsync.
protected boolean isAsync(com.sun.tools.ws.wsdl.document.PortType portType, com.sun.tools.ws.wsdl.document.Operation wsdlOperation) {
// First look into wsdl:operation
JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(wsdlOperation, JAXWSBinding.class);
Boolean isAsync = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableAsyncMapping() : null;
if (isAsync != null) {
return isAsync;
}
// then into wsdl:portType
jaxwsCustomization = (JAXWSBinding) getExtensionOfType(portType, JAXWSBinding.class);
isAsync = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableAsyncMapping() : null;
if (isAsync != null) {
return isAsync;
}
// then wsdl:definitions
jaxwsCustomization = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
isAsync = (jaxwsCustomization != null) ? jaxwsCustomization.isEnableAsyncMapping() : null;
if (isAsync != null) {
return isAsync;
}
return false;
}
use of com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding in project metro-jax-ws by eclipse-ee4j.
the class WSDLModeler method getJavaPackage.
protected String getJavaPackage() {
String jaxwsPackage = null;
JAXWSBinding jaxwsCustomization = (JAXWSBinding) getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
if (jaxwsCustomization != null && jaxwsCustomization.getJaxwsPackage() != null) {
jaxwsPackage = jaxwsCustomization.getJaxwsPackage().getName();
}
if (jaxwsPackage != null) {
return jaxwsPackage;
}
String wsdlUri = document.getDefinitions().getTargetNamespaceURI();
return XJC.getDefaultPackageName(wsdlUri);
}
use of com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding in project metro-jax-ws by eclipse-ee4j.
the class WSDLModeler method getJavaNameOfSEI.
protected String getJavaNameOfSEI(Port port) {
QName portTypeName = (QName) port.getProperty(ModelProperties.PROPERTY_WSDL_PORT_TYPE_NAME);
PortType pt = (PortType) document.find(Kinds.PORT_TYPE, portTypeName);
// populate the portType map here. We should get rid of all these properties
// lets not do it as it may break NB
// TODO: clean all these stuff part of NB RFE
port.portTypes.put(portTypeName, pt);
JAXWSBinding jaxwsCust = (JAXWSBinding) getExtensionOfType(pt, JAXWSBinding.class);
if (jaxwsCust != null && jaxwsCust.getClassName() != null) {
CustomName name = jaxwsCust.getClassName();
if (name != null && !name.getName().equals("")) {
return makePackageQualified(name.getName());
}
}
String interfaceName;
if (portTypeName != null) {
// got portType information from WSDL, use it to name the interface
interfaceName = makePackageQualified(BindingHelper.mangleNameToClassName(portTypeName.getLocalPart()));
} else {
// somehow we only got the port name, so we use that
interfaceName = makePackageQualified(BindingHelper.mangleNameToClassName(port.getName().getLocalPart()));
}
return interfaceName;
}
Aggregations