Search in sources :

Example 1 with Address

use of org.apache.cxf.tools.misc.processor.address.Address in project cxf by apache.

the class WSDLToServiceProcessor method setAddrElement.

private void setAddrElement() throws ToolException {
    String transport = (String) env.get(ToolConstants.CFG_TRANSPORT);
    Address address = AddressFactory.getInstance().getAddresser(transport);
    Map<String, String> ns = address.getNamespaces(env);
    for (Map.Entry<String, String> entry : ns.entrySet()) {
        wsdlDefinition.addNamespace(entry.getKey(), entry.getValue());
    }
    WSDLExtensibilityPlugin plugin = getWSDLPlugin(transport, Port.class);
    try {
        ExtensibilityElement extElement = plugin.createExtension(address.buildAddressArguments(env));
        port.addExtensibilityElement(extElement);
    } catch (WSDLException wse) {
        Message msg = new Message("FAIL_TO_CREATE_SOAP_ADDRESS", LOG);
        throw new ToolException(msg, wse);
    }
}
Also used : Address(org.apache.cxf.tools.misc.processor.address.Address) Message(org.apache.cxf.common.i18n.Message) WSDLException(javax.wsdl.WSDLException) WSDLExtensibilityPlugin(org.apache.cxf.wsdl.WSDLExtensibilityPlugin) ToolException(org.apache.cxf.tools.common.ToolException) Map(java.util.Map) ExtensibilityElement(javax.wsdl.extensions.ExtensibilityElement)

Example 2 with Address

use of org.apache.cxf.tools.misc.processor.address.Address in project cxf by apache.

the class WSDLToXMLProcessor method setAddrElement.

private void setAddrElement() throws ToolException {
    Address address = AddressFactory.getInstance().getAddresser("xml");
    for (Map.Entry<String, String> entry : address.getNamespaces(env).entrySet()) {
        wsdlDefinition.addNamespace(entry.getKey(), entry.getValue());
    }
    WSDLExtensibilityPlugin generator = getWSDLPlugin("xml", Port.class);
    try {
        ExtensibilityElement extElement = generator.createExtension(address.buildAddressArguments(env));
        port.addExtensibilityElement(extElement);
    } catch (WSDLException wse) {
        Message msg = new Message("FAIL_TO_CREATE_SOAPADDRESS", LOG);
        throw new ToolException(msg);
    }
}
Also used : Address(org.apache.cxf.tools.misc.processor.address.Address) Message(org.apache.cxf.common.i18n.Message) WSDLException(javax.wsdl.WSDLException) WSDLExtensibilityPlugin(org.apache.cxf.wsdl.WSDLExtensibilityPlugin) ToolException(org.apache.cxf.tools.common.ToolException) HashMap(java.util.HashMap) Map(java.util.Map) ExtensibilityElement(javax.wsdl.extensions.ExtensibilityElement)

Aggregations

Map (java.util.Map)2 WSDLException (javax.wsdl.WSDLException)2 ExtensibilityElement (javax.wsdl.extensions.ExtensibilityElement)2 Message (org.apache.cxf.common.i18n.Message)2 ToolException (org.apache.cxf.tools.common.ToolException)2 Address (org.apache.cxf.tools.misc.processor.address.Address)2 WSDLExtensibilityPlugin (org.apache.cxf.wsdl.WSDLExtensibilityPlugin)2 HashMap (java.util.HashMap)1