本文整理汇总了Java中org.apache.axis2.engine.AxisConfiguration.getTransportIn方法的典型用法代码示例。如果您正苦于以下问题:Java AxisConfiguration.getTransportIn方法的具体用法?Java AxisConfiguration.getTransportIn怎么用?Java AxisConfiguration.getTransportIn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.engine.AxisConfiguration
的用法示例。
在下文中一共展示了AxisConfiguration.getTransportIn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getWsdlInformation
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public static String getWsdlInformation(String serviceName,
AxisConfiguration axisConfig) throws AxisFault {
String ip;
try {
ip = NetworkUtils.getLocalHostname();
} catch (SocketException e) {
throw new AxisFault("Cannot get local host name", e);
}
TransportInDescription transportInDescription = axisConfig.getTransportIn("http");
if (transportInDescription == null) {
transportInDescription = axisConfig.getTransportIn("https");
}
if (transportInDescription != null) {
EndpointReference[] epr =
transportInDescription.getReceiver().getEPRsForService(serviceName, ip);
String wsdlUrlPrefix = epr[0].getAddress();
if (wsdlUrlPrefix.endsWith("/")) {
wsdlUrlPrefix = wsdlUrlPrefix.substring(0, wsdlUrlPrefix.length() - 1);
}
return wsdlUrlPrefix + "?wsdl";
}
return null;
}
示例2: getWsdlInformation
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
private String getWsdlInformation(String serviceName, AxisConfiguration axisConfig)
throws AxisFault {
String ip;
try {
ip = NetworkUtils.getLocalHostname();
} catch (SocketException e) {
throw new AxisFault("Cannot get local host name", e);
}
TransportInDescription http = axisConfig.getTransportIn("http");
if (http != null) {
EndpointReference epr =
((HttpTransportListener) http.getReceiver()).
getEPRForService(serviceName, ip);
String wsdlUrlPrefix = epr.getAddress();
if (wsdlUrlPrefix.endsWith("/")) {
wsdlUrlPrefix = wsdlUrlPrefix.substring(0, wsdlUrlPrefix.length() - 1);
}
return wsdlUrlPrefix + "?wsdl";
}
return null;
}
示例3: inferInTransport
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public static TransportInDescription inferInTransport(AxisConfiguration ac,
Options options,
MessageContext msgCtxt)
throws AxisFault {
String listenerTransportProtocol = options.getTransportInProtocol();
if (listenerTransportProtocol == null) {
EndpointReference replyTo = msgCtxt.getReplyTo();
if (replyTo != null) {
try {
URI uri = new URI(replyTo.getAddress());
listenerTransportProtocol = uri.getScheme();
} catch (URISyntaxException e) {
//need to ignore
}
} else {
//assume listener transport as sender transport
if (msgCtxt.getTransportOut() != null) {
listenerTransportProtocol = msgCtxt.getTransportOut().getName();
}
}
}
TransportInDescription transportIn = null;
if (options.isUseSeparateListener() || msgCtxt.getOptions().isUseSeparateListener()) {
if ((listenerTransportProtocol != null) && !"".equals(listenerTransportProtocol)) {
transportIn = ac.getTransportIn(listenerTransportProtocol);
ListenerManager listenerManager =
msgCtxt.getConfigurationContext().getListenerManager();
if (transportIn == null) {
// TODO : User should not be mandated to give an IN transport. If it is not given, we should
// ask from the ListenerManager to give any available transport for this client.
log.error(Messages.getMessage("unknownTransport",
listenerTransportProtocol));
throw new AxisFault(Messages.getMessage("unknownTransport",
listenerTransportProtocol));
}
synchronized (ClientUtils.class) {
if (!listenerManager.isListenerRunning(transportIn.getName())) {
listenerManager.addListener(transportIn, false);
}
}
}
if (msgCtxt.getAxisService() != null) {
if (!msgCtxt.isEngaged(Constants.MODULE_ADDRESSING)) {
log.error(Messages.getMessage("2channelNeedAddressing"));
throw new AxisFault(Messages.getMessage("2channelNeedAddressing"));
}
} else {
if (!ac.isEngaged(Constants.MODULE_ADDRESSING)) {
log.error(Messages.getMessage("2channelNeedAddressing"));
throw new AxisFault(Messages.getMessage("2channelNeedAddressing"));
}
}
}
return transportIn;
}