本文整理汇总了Java中org.apache.axis2.description.AxisEndpoint类的典型用法代码示例。如果您正苦于以下问题:Java AxisEndpoint类的具体用法?Java AxisEndpoint怎么用?Java AxisEndpoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AxisEndpoint类属于org.apache.axis2.description包,在下文中一共展示了AxisEndpoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dispatchAndVerify
import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
/**
* Finds axis Service and the Operation for DSS requests
*
* @param msgContext request message context
* @throws AxisFault if any exception occurs while finding axis service or operation
*/
private static void dispatchAndVerify(MessageContext msgContext) throws AxisFault {
requestDispatcher.invoke(msgContext);
AxisService axisService = msgContext.getAxisService();
if (axisService != null) {
httpLocationBasedDispatcher.invoke(msgContext);
if (msgContext.getAxisOperation() == null) {
requestURIOperationDispatcher.invoke(msgContext);
}
AxisOperation axisOperation;
if ((axisOperation = msgContext.getAxisOperation()) != null) {
AxisEndpoint axisEndpoint =
(AxisEndpoint) msgContext.getProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME);
if (axisEndpoint != null) {
AxisBindingOperation axisBindingOperation = (AxisBindingOperation) axisEndpoint
.getBinding().getChild(axisOperation.getName());
msgContext.setProperty(Constants.AXIS_BINDING_OPERATION, axisBindingOperation);
}
msgContext.setAxisOperation(axisOperation);
}
}
}
示例2: extractBindingInformation
import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
private static Binding extractBindingInformation(final AxisService service,
final Definition wsdlOfService,
final MessageContext inMessageContext) {
AxisEndpoint currentEndpoint = (AxisEndpoint) inMessageContext
.getProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME);
if (currentEndpoint == null) {
String defaultEndpointName = service.getEndpointName();
currentEndpoint = service.getEndpoints().get(defaultEndpointName);
if (currentEndpoint == null) {
throw new NullPointerException("AxisEndpoint cannot be null.");
}
}
AxisBinding currentAxisBinding = currentEndpoint.getBinding();
QName bindingQName = currentAxisBinding.getName();
return wsdlOfService.getBinding(bindingQName);
}
示例3: applyPolicyToSOAPBindings
import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
/**
* Applies the MTOM policy to the binding level of the web service.
*
* @param axisService the {@link AxisService} to whom binding level the MTOM policy should be attached.
* @param policy the {@link Policy} object that contains the MTOM assertion.
* @throws AxisFault thrown if the parameter is locked on a parent level - thus it could not be added.
*/
public static void applyPolicyToSOAPBindings(AxisService axisService,
Policy policy) throws AxisFault {
Parameter param = axisService.getParameter(MTOM_ASSERTION_APPLIED);
if ( policy == null || (param != null && Constants.VALUE_TRUE.equals(param.getValue()))) {
return;
}
for (Object obj : axisService.getEndpoints().values()) {
AxisEndpoint endpoint = (AxisEndpoint) obj;
AxisBinding binding = endpoint.getBinding();
if (Java2WSDLConstants.TRANSPORT_URI.equals(binding.getType())
|| WSDL2Constants.URI_WSDL2_SOAP.equals(binding.getType())) {
binding.getPolicySubject().attachPolicy(policy);
}
}
axisService
.addParameter("MTOM_ASSERTION_APPLIED", Constants.VALUE_TRUE);
}
示例4: getUpperLevel
import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
private AxisDescription getUpperLevel(short type, AxisDescription thisLevel) {
switch (type) {
case AXIS_BINDING_MESSAGE:
return ((AxisBindingMessage) thisLevel).getAxisBindingOperation();
case AXIS_BINDING_OPERATION:
return ((AxisBindingOperation) thisLevel).getAxisBinding();
case AXIS_BINDING:
return ((AxisBinding) thisLevel).getAxisEndpoint();
case AXIS_ENDPOINT:
return ((AxisEndpoint) thisLevel).getAxisService();
case AXIS_MESSAGE:
return ((AxisMessage) thisLevel).getAxisOperation();
case AXIS_OPERATION:
return ((AxisOperation) thisLevel).getAxisService();
case AXIS_SERVICE:
return ((AxisService) thisLevel).getAxisServiceGroup();
case AXIS_SERVICE_GROUP:
return ((AxisServiceGroup) thisLevel).getAxisConfiguration();
default:
return null;
}
}
示例5: getType
import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
private short getType(AxisDescription description) {
if (description instanceof AxisBindingMessage) {
return AXIS_BINDING_MESSAGE;
} else if (description instanceof AxisMessage) {
return AXIS_MESSAGE;
} else if (description instanceof AxisBindingOperation) {
return AXIS_BINDING_OPERATION;
} else if (description instanceof AxisOperation) {
return AXIS_OPERATION;
} else if (description instanceof AxisBinding) {
return AXIS_BINDING;
} else if (description instanceof AxisEndpoint) {
return AXIS_ENDPOINT;
} else if (description instanceof AxisService) {
return AXIS_SERVICE;
} else if (description instanceof AxisServiceGroup) {
return AXIS_SERVICE_GROUP;
} else if (description instanceof AxisConfiguration) {
return AXIS_CONFIGURATION;
}
return -1;
}
示例6: addPolicyToAllBindings
import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
public void addPolicyToAllBindings(AxisService axisService, Policy policy)
throws ServerException {
try {
if (policy.getId() == null) {
// Generate an ID
policy.setId(UUIDGenerator.getUUID());
}
Map endPointMap = axisService.getEndpoints();
for (Object o : endPointMap.entrySet()) {
Map.Entry entry = (Map.Entry) o;
AxisEndpoint point = (AxisEndpoint) entry.getValue();
AxisBinding binding = point.getBinding();
String bindingName = binding.getName().getLocalPart();
//only UTOverTransport is allowed for HTTP
if (bindingName.endsWith("HttpBinding") &&
(!policy.getAttributes().containsValue("UTOverTransport"))) {
continue;
}
binding.getPolicySubject().attachPolicy(policy);
// Add the new policy to the registry
}
} catch (Exception e) {
log.error("Error in adding security policy to all bindings", e);
throw new ServerException("addPoliciesToService", e);
}
}
示例7: addSecurityPolicyToAllBindings
import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
/**
* This method add Policy to service at the Registry. Does not add the
* policy to Axis2. To all Bindings available
*
* @param axisService Service
* @param policy Policy
* @throws org.wso2.carbon.utils.ServerException se
*/
public void addSecurityPolicyToAllBindings(AxisService axisService, Policy policy)
throws ServerException {
try {
if (policy.getId() == null) {
policy.setId(UUIDGenerator.getUUID());
}
Map endPointMap = axisService.getEndpoints();
for (Object o : endPointMap.entrySet()) {
Map.Entry entry = (Map.Entry) o;
AxisEndpoint point = (AxisEndpoint) entry.getValue();
AxisBinding binding = point.getBinding();
String bindingName = binding.getName().getLocalPart();
//only UTOverTransport is allowed for HTTP
if (bindingName.endsWith("HttpBinding") &&
(!policy.getAttributes().containsValue("UTOverTransport"))) {
continue;
}
binding.getPolicySubject().attachPolicy(policy);
}
} catch (Exception e) {
log.error("Error in adding security policy to all bindings", e);
throw new ServerException("addPoliciesToService", e);
}
}
示例8: removeSecurityPolicyFromAllBindings
import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
public void removeSecurityPolicyFromAllBindings(AxisService axisService, String uuid)
throws ServerException {
if (log.isDebugEnabled()) {
log.debug("Removing security policy from all bindings.");
}
Map endPointMap = axisService.getEndpoints();
for (Object o : endPointMap.entrySet()) {
Map.Entry entry = (Map.Entry) o;
AxisEndpoint point = (AxisEndpoint) entry.getValue();
AxisBinding binding = point.getBinding();
if (binding.getPolicySubject().getAttachedPolicyComponent(uuid) != null) {
binding.getPolicySubject().detachPolicyComponent(uuid);
}
}
}
示例9: addSecurityPolicyToAllBindings
import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
/**
* This method add Policy to service at the Registry. Does not add the
* policy to Axis2. To all Bindings available
*
* @param axisService Service
* @param policy Policy
* @throws org.wso2.carbon.utils.ServerException se
*/
public void addSecurityPolicyToAllBindings(AxisService axisService, Policy policy)
throws ServerException {
String serviceGroupId = axisService.getAxisServiceGroup().getServiceGroupName();
try {
if (policy.getId() == null) {
policy.setId(UUIDGenerator.getUUID());
}
Map endPointMap = axisService.getEndpoints();
for (Object o : endPointMap.entrySet()) {
Map.Entry entry = (Map.Entry) o;
AxisEndpoint point = (AxisEndpoint) entry.getValue();
AxisBinding binding = point.getBinding();
String bindingName = binding.getName().getLocalPart();
//only UTOverTransport is allowed for HTTP
if (bindingName.endsWith("HttpBinding") &&
(!policy.getAttributes().containsValue("UTOverTransport"))) {
continue;
}
binding.getPolicySubject().attachPolicy(policy);
}
} catch (Exception e) {
log.error("Error in adding security policy to all bindings", e);
throw new ServerException("addPoliciesToService", e);
}
}
示例10: dispatchAndVerify
import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
private static void dispatchAndVerify(MessageContext msgContext) throws AxisFault {
RequestURIBasedDispatcher requestDispatcher = new RequestURIBasedDispatcher();
requestDispatcher.invoke(msgContext);
AxisService axisService = msgContext.getAxisService();
if (axisService != null) {
HTTPLocationBasedDispatcher httpLocationBasedDispatcher =
new HTTPLocationBasedDispatcher();
httpLocationBasedDispatcher.invoke(msgContext);
if (msgContext.getAxisOperation() == null) {
RequestURIOperationDispatcher requestURIOperationDispatcher =
new RequestURIOperationDispatcher();
requestURIOperationDispatcher.invoke(msgContext);
}
AxisOperation axisOperation;
if ((axisOperation = msgContext.getAxisOperation()) != null) {
AxisEndpoint axisEndpoint =
(AxisEndpoint) msgContext.getProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME);
if (axisEndpoint != null) {
AxisBindingOperation axisBindingOperation = (AxisBindingOperation) axisEndpoint
.getBinding().getChild(axisOperation.getName());
msgContext.setProperty(Constants.AXIS_BINDING_OPERATION, axisBindingOperation);
}
msgContext.setAxisOperation(axisOperation);
}
}
}
示例11: findOperation
import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
public AxisOperation findOperation(AxisService service, MessageContext messageContext)
throws AxisFault {
AxisService axisService = messageContext.getAxisService();
if (axisService != null && messageContext.getTo() != null) {
String uri = messageContext.getTo().getAddress();
String httpLocation = parseRequestURL(uri, axisService.getName());
String httpMethod = (String) messageContext.getProperty(HTTPConstants.HTTP_METHOD);
if (httpLocation != null) {
httpLocation = httpMethod + httpLocation;
// following code is commented out because it is not allowing us
//to differenciate between httplocation GET /product/ and GET /product
/* if(! httpLocation.endsWith("/")){
httpLocation=httpLocation.concat("/");
}*/
AxisEndpoint axisEndpoint = (AxisEndpoint) messageContext
.getProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME);
// Here we check whether the request was dispatched to the correct endpoint. If it
// was we can dispatch the operation using the HTTPLocationDispatcher table of that
// specific endpoint.
if (axisEndpoint != null) {
Map httpLocationTableForResource = (Map) axisEndpoint.getBinding()
.getProperty(WSDL2Constants.HTTP_LOCATION_TABLE_FOR_RESOURCE);
if (httpLocationTableForResource != null) {
return getOperationFromHTTPLocationForResource(httpLocation, httpLocationTableForResource);
}
Map httpLocationTable = (Map) axisEndpoint.getBinding()
.getProperty(WSDL2Constants.HTTP_LOCATION_TABLE);
if (httpLocationTable != null) {
return getOperationFromHTTPLocation(httpLocation, httpLocationTable);
}
}
} else {
log.debug("Attempt to check for Operation using HTTP Location failed");
return null;
}
}
return null;
}
示例12: processEndpoints
import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
private void processEndpoints(AxisService axisService,
AxisConfiguration axisConfiguration) throws AxisFault {
Map<String, AxisEndpoint> enspoints = axisService.getEndpoints();
if (enspoints == null || enspoints.size() == 0) {
org.apache.axis2.deployment.util.Utils.addEndpointsToService(
axisService, axisConfiguration);
}
}
示例13: findBinding
import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
private AxisBinding findBinding() {
if (axisService != null) {
if (axisService.getEndpointName() != null) {
AxisEndpoint axisEndpoint = axisService
.getEndpoint(axisService.getEndpointName());
if (axisEndpoint != null) {
return axisEndpoint.getBinding();
}
}
}
return null;
}
示例14: WSDLAwareSOAPProcessor
import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
public WSDLAwareSOAPProcessor(MessageContext inMsgCtx) throws AxisFault {
QName bindingQName;
AxisService axisService;
inMessageCtx = inMsgCtx;
axisService = inMsgCtx.getAxisService();
serviceName = new QName(axisService.getTargetNamespace(), axisService.getName());
wsdlDef = (Definition) axisService.getParameter(WSDL_4_J_DEFINITION).getValue();
if (wsdlDef == null) {
throw new AxisFault("No WSDL Definition was found for service " +
serviceName.getLocalPart() + ".");
}
wsdlServiceDef = wsdlDef.getService(serviceName);
if (wsdlServiceDef == null) {
throw new AxisFault("WSDL Service Definition not found for service " +
serviceName.getLocalPart());
}
/**
* This will get the current end point which Axis2 picks the incoming request.
*/
AxisEndpoint axisEndpoint = (AxisEndpoint) inMsgCtx.
getProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME);
if (axisEndpoint == null) {
String defaultEndpointName = axisService.getEndpointName();
axisEndpoint = axisService.getEndpoints().get(defaultEndpointName);
if (axisEndpoint == null) {
throw new AxisFault("AxisEndpoint cannot be null.");
}
}
portName = axisEndpoint.getName();
AxisBinding axisBinding = axisEndpoint.getBinding();
bindingQName = axisBinding.getName();
/** In this implementation, we assume that AxisBinding's QName is equal to WSDL bindings QName. */
wsdlBinding = wsdlDef.getBinding(bindingQName);
if (wsdlBinding == null) {
throw new AxisFault("WSDL Binding null for incoming message.");
}
ExtensibilityElement bindingType = getBindingExtension(wsdlBinding);
if (!(bindingType instanceof SOAPBinding || bindingType instanceof SOAP12Binding ||
bindingType instanceof HTTPBinding)) {
throw new AxisFault("WSDL Binding not supported.");
}
isRPC = isRPC(bindingType);
soapFactory = (SOAPFactory) inMsgCtx.getEnvelope().getOMFactory();
if (soapFactory == null) {
if (bindingType instanceof SOAPBinding) {
soapFactory = OMAbstractFactory.getSOAP11Factory();
} else {
soapFactory = OMAbstractFactory.getSOAP12Factory();
}
}
if (soapFactory instanceof SOAP12Factory) {
soap12 = true;
}
}
示例15: WSDLAwareSOAPProcessor
import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
public WSDLAwareSOAPProcessor(MessageContext inMsgCtx) throws AxisFault {
QName bindingQName;
AxisService axisService;
tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
// Need to solve this one way call scenario
inMessageCtx = inMsgCtx;
axisService = inMsgCtx.getAxisService();
serviceName = new QName(axisService.getTargetNamespace(), axisService.getName());
wsdlDef = (Definition) axisService.getParameter(WSDL_4_J_DEFINITION).getValue();
if (wsdlDef == null) {
throw new AxisFault("No WSDL Definition was found for service " +
serviceName.getLocalPart() + ".");
}
Service wsdlServiceDef = wsdlDef.getService(serviceName);
if (wsdlServiceDef == null) {
throw new AxisFault("WSDL Service Definition not found for service " +
serviceName.getLocalPart());
}
/**
* This will get the current end point which Axis2 picks the incoming request.
*/
AxisEndpoint axisEndpoint = (AxisEndpoint) inMsgCtx.
getProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME);
if (axisEndpoint == null) {
String defaultEndpointName = axisService.getEndpointName();
axisEndpoint = axisService.getEndpoints().get(defaultEndpointName);
if (axisEndpoint == null) {
throw new AxisFault("AxisEndpoint cannot be null.");
}
}
portName = axisEndpoint.getName();
AxisBinding axisBinding = axisEndpoint.getBinding();
bindingQName = axisBinding.getName();
/** In this implementation, we assume that AxisBinding's QName is equal to WSDL bindings QName. */
wsdlBinding = wsdlDef.getBinding(bindingQName);
if (wsdlBinding == null) {
throw new AxisFault("WSDL Binding null for incoming message.");
}
ExtensibilityElement bindingType = getBindingExtension(wsdlBinding);
if (!(bindingType instanceof SOAPBinding || bindingType instanceof SOAP12Binding ||
bindingType instanceof HTTPBinding)) {
throw new AxisFault("WSDL Binding not supported.");
}
isRPC = isRPC(bindingType);
soapFactory = (SOAPFactory) inMsgCtx.getEnvelope().getOMFactory();
if (soapFactory == null) {
if (bindingType instanceof SOAPBinding) {
soapFactory = OMAbstractFactory.getSOAP11Factory();
} else {
soapFactory = OMAbstractFactory.getSOAP12Factory();
}
}
}