try {
soapAddress = (SOAPAddress)extReg.createExtension(Port.class,
WSDLConstants.NS_SOAP_BINDING_ADDRESS);
} catch (WSDLException wse) {
Message msg = new Message("FAIl_TO_CREATE_SOAPADDRESS", LOG);
throw new ToolException(msg, wse);
}
if (env.get(ToolConstants.CFG_ADDRESS) != null) {
soapAddress.setLocationURI((String)env.get(ToolConstants.CFG_ADDRESS));
} else {
soapAddress.setLocationURI(HTTP_PREFIX + "/" + env.get(ToolConstants.CFG_SERVICE) + "/"
+ env.get(ToolConstants.CFG_PORT));
}
port.addExtensibilityElement(soapAddress);
} else if ("jms".equalsIgnoreCase((String)env.get(ToolConstants.CFG_TRANSPORT))) {
JMSAddress jmsAddress = null;
JMSAddressSerializer jmsAddressSerializer = new JMSAddressSerializer();
try {
extReg.registerSerializer(JMSAddress.class, ToolConstants.JMS_ADDRESS, jmsAddressSerializer);
extReg
.registerDeserializer(JMSAddress.class, ToolConstants.JMS_ADDRESS, jmsAddressSerializer);
jmsAddress = (JMSAddress)extReg.createExtension(Port.class, ToolConstants.JMS_ADDRESS);
if (env.optionSet(ToolConstants.JMS_ADDR_DEST_STYLE)) {
jmsAddress.setDestinationStyle((String)env.get(ToolConstants.JMS_ADDR_DEST_STYLE));
}
if (env.optionSet(ToolConstants.JMS_ADDR_INIT_CTX)) {
jmsAddress.setInitialContextFactory((String)env.get(ToolConstants.JMS_ADDR_INIT_CTX));
}
if (env.optionSet(ToolConstants.JMS_ADDR_JNDI_DEST)) {
jmsAddress.setJndiDestinationName((String)env.get(ToolConstants.JMS_ADDR_JNDI_DEST));
}
if (env.optionSet(ToolConstants.JMS_ADDR_JNDI_FAC)) {
jmsAddress.setJndiConnectionFactoryName((String)env.get(ToolConstants.JMS_ADDR_JNDI_FAC));
}
if (env.optionSet(ToolConstants.JMS_ADDR_JNDI_URL)) {
jmsAddress.setJndiProviderURL((String)env.get(ToolConstants.JMS_ADDR_JNDI_URL));
}
if (env.optionSet(ToolConstants.JMS_ADDR_MSGID_TO_CORRID)) {
jmsAddress.setUseMessageIDAsCorrelationID(Boolean.getBoolean((String)env
.get(ToolConstants.JMS_ADDR_MSGID_TO_CORRID)));
}
if (env.optionSet(ToolConstants.JMS_ADDR_SUBSCRIBER_NAME)) {
jmsAddress.setDurableSubscriberName((String)env
.get(ToolConstants.JMS_ADDR_SUBSCRIBER_NAME));
}
} catch (WSDLException wse) {
Message msg = new Message("FAIL_TO_CREATE_SOAP_ADDRESS", LOG);
throw new ToolException(msg, wse);
}
port.addExtensibilityElement(jmsAddress);
}
}