• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AxisEndpoint类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.axis2.description.AxisEndpoint的典型用法代码示例。如果您正苦于以下问题:Java AxisEndpoint类的具体用法?Java AxisEndpoint怎么用?Java AxisEndpoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AxisEndpoint类属于org.apache.axis2.description包,在下文中一共展示了AxisEndpoint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
        }
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:29,代码来源:IntegratorStatefulHandler.java


示例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);
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:19,代码来源:BPELMessageContextFactory.java


示例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);

}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:31,代码来源:Utils.java


示例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;
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:24,代码来源:AxisPolicyLocator.java


示例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;
    
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:26,代码来源:AxisPolicyLocator.java


示例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);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:28,代码来源:SecurityDeploymentInterceptor.java


示例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);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:36,代码来源:SecurityServiceAdmin.java


示例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);
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:16,代码来源:SecurityServiceAdmin.java


示例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);
    }
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:37,代码来源:SecurityServiceAdmin.java


示例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);
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:28,代码来源:RESTUtil.java


示例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;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:41,代码来源:HTTPLocationBasedDispatcher.java


示例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);
	}
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:9,代码来源:AxisConfiguration.java


示例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;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:13,代码来源:MessageContext.java


示例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;
    }
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:66,代码来源:WSDLAwareSOAPProcessor.java


示例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();
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:65,代码来源:WSDLAwareSOAPProcessor.java


示例16: checkTypePublishing

import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
public boolean checkTypePublishing(){
   
    MessageContext msgctx= MessageContext.getCurrentMessageContext();
    AxisService axisServce= msgctx.getAxisService();
    AxisEndpoint axisEndpoint= axisServce.getEndpoint("AnnotationServiceHttpEndpoint");
    AxisBinding axisBinding=axisEndpoint.getBinding();
    AxisBindingOperation axisBindingOperation;
    Iterator<AxisBindingOperation> iterator=axisBinding.getChildren();


      while(iterator.hasNext()){
        axisBindingOperation=iterator.next();
          if(axisBindingOperation.getName().equals(new QName("addDataFromURLandBody"))){
              if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_LOCATION).equals("testroot/getFromBody/{data1}")){
              System.out.println("wrong http location : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_LOCATION)+" expected : testroot/getFromBody/{data1}" );
               return false;
             }
              if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_METHOD).equals("POST")){
               System.out.println("wrong http method : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_METHOD)+" expected : POST" );
               return false;
             }

              if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION).equals("application/xml")){
                  System.out.println("INPUT SERIALIZATION TESTS");
               System.out.println("wrong input serialization : found : "+ axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION) +" expected : application/xml" );
               return false;
             }

             if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION).equals("text/xml")){
                  System.out.println("OUTPUT SERIALIZATION TEST");
               System.out.println("wrong output serialization : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION)+" expected : text/xml" );
               return false;
             }
              System.out.println("Type publishing test \"addDataFromURLandBody\" OK.........");
          }   

          if(axisBindingOperation.getName().equals(new QName("updateDataFromURL"))){
           
              if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_LOCATION).equals("testroot/update/{data1}")){
              System.out.println("wrong http location : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_LOCATION)+" expected : testroot/update/{data1}" );
               return false;
             }
              if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_METHOD).equals("PUT")){
               System.out.println("wrong http method : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_METHOD)+" expected : PUT" );
               return false;
             }
              if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION).equals("text/xml")){
               System.out.println("wrong input serialization : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION)+" expected : text/xml" );
               return false;
             }
              if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION).equals("application/xml")) {
               System.out.println("wrong output serialization : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION)+" expected : application/xml" );
               return false;
             }
              System.out.println("Type publishing test \"updateDataFromURL\" OK.........");
          }

          if(axisBindingOperation.getName().equals(new QName("checkServicesXMLoverriding"))){
              if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_LOCATION).equals("serviceroot/check")){
              System.out.println("wrong http location : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_LOCATION)+" expected : serviceroot/check" );
               return false;
             }
              if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_METHOD).equals("POST")){
               System.out.println("wrong http method : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_METHOD)+" expected : POST" );
               return false;
             }
              if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION).equals("application/xml")){
               System.out.println("wrong input serialization : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION)+" expected : application/xml" );
               return false;
             }
              if(!axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION).equals("application/xml")) {
               System.out.println("wrong output serialization : found : "+axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION)+" expected : application/xml" );
               return false;
             }
              System.out.println("Type publishing test \"checkServicesXMLoverriding\" OK.........");
          }
      }
   return true; // all the test are ok     
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:80,代码来源:Service.java


示例17: addServiceGroup

import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
public synchronized void addServiceGroup(AxisServiceGroup axisServiceGroup)
        throws AxisFault {
    axisServiceGroup.setParent(this);
    notifyObservers(new AxisEvent(AxisEvent.SERVICE_DEPLOY, axisServiceGroup), axisServiceGroup);
    AxisService axisService;

    Iterator<AxisService> services = axisServiceGroup.getServices();
    while (services.hasNext()) {
        axisService = services.next();
        if (axisService.getSchemaTargetNamespace() == null) {
            axisService.setSchemaTargetNamespace(Java2WSDLConstants.AXIS2_XSD);
        }
    }
    services = axisServiceGroup.getServices();
    while (services.hasNext()) {
        axisService = services.next();
        if (axisService.isUseDefaultChains()) {
            Iterator<AxisOperation> operations = axisService.getOperations();
            while (operations.hasNext()) {
                AxisOperation operation = operations.next();
                phasesinfo.setOperationPhases(operation);
            }
        }
    }
    Iterator<AxisModule> enModule = getEngagedModules().iterator();
    while (enModule.hasNext()) {
        axisServiceGroup.engageModule(enModule.next());
    }
    services = axisServiceGroup.getServices();
    ArrayList<AxisService> servicesIAdded = new ArrayList<AxisService>();
    while (services.hasNext()) {
        axisService = services.next();
        processEndpoints(axisService, axisService.getAxisConfiguration());

        Map<String, AxisEndpoint> endpoints = axisService.getEndpoints();
        String serviceName = axisService.getName();
        try {
            addToAllServicesMap(axisService);
        } catch (AxisFault axisFault) {
            // Whoops, must have been a duplicate!  If we had a problem here, we have to
            // remove all the ones we added...
            for (AxisService service : servicesIAdded) {
                allServices.remove(service.getName());
            }
            // And toss this in case anyone wants it?
            throw axisFault;
        }
        servicesIAdded.add(axisService);
        if (endpoints != null) {
            Iterator<String> endpointNameIter = endpoints.keySet().iterator();
            while (endpointNameIter.hasNext()) {
                String endpointName = endpointNameIter.next();
                if (log.isDebugEnabled()) {
                    log.debug("Adding service to allEndpoints map: ("
                              + serviceName + "," + endpointName + ") ");
                }

                allEndpoints.put(serviceName + "." + endpointName, axisService);
            }
            if (log.isDebugEnabled()) {
                log.debug("After adding to allEndpoints map, size is "
                          + allEndpoints.size());
            }
        }

        if (!axisService.isClientSide()) {
            notifyObservers(new AxisEvent(AxisEvent.SERVICE_DEPLOY ,axisService ), axisService);
        }
    }
    // serviceGroups.put(axisServiceGroup.getServiceGroupName(),
    // axisServiceGroup);
    addChild(axisServiceGroup);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:74,代码来源:AxisConfiguration.java


示例18: addServiceToExistingServiceGroup

import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
/**
   * This method is used to add a service to an existing active service group in the axis configuration
   *
   * @param axisService service to be added to the existing service group provided
   * @param serviceGroupName name of the service group which should be existing in the axis configuration
   * @throws AxisFault in case of an error in adding the service to the group specified or if the group is not existing
   */
  public void addServiceToExistingServiceGroup(AxisService axisService,
                                               String serviceGroupName) throws AxisFault {

      AxisServiceGroup serviceGroup = getServiceGroup(serviceGroupName);
      if (serviceGroup == null) {
          String message = "A ServiceGroup with the provided name "
                  + serviceGroupName + " is not existing";
          log.error(message);
          throw new AxisFault(message);
      }

      if (axisService.getSchemaTargetNamespace() == null) {
          axisService.setSchemaTargetNamespace(Java2WSDLConstants.AXIS2_XSD);
      }

      if (axisService.isUseDefaultChains()) {
          Iterator<AxisOperation> operations = axisService.getOperations();
          while (operations.hasNext()) {
              AxisOperation operation = operations.next();
              phasesinfo.setOperationPhases(operation);
          }
      }

      Map<String, AxisEndpoint> endpoints = axisService.getEndpoints();
      if (endpoints == null || endpoints.size() == 0) {
	org.apache.axis2.deployment.util.Utils.addEndpointsToService(
			axisService, axisService.getAxisConfiguration());
          endpoints = axisService.getEndpoints();
}

      String serviceName = axisService.getName();
      addToAllServicesMap(axisService);

      if (endpoints != null) {
          Iterator<String> endpointNameIter = endpoints.keySet().iterator();
          while (endpointNameIter.hasNext()) {
              String endpointName = endpointNameIter.next();
              if (log.isDebugEnabled()) {
                  log.debug("Adding service to allEndpoints map: ("
                          + serviceName + "," + endpointName + ") ");
              }

              allEndpoints.put(serviceName + "." + endpointName, axisService);
          }
          if (log.isDebugEnabled()) {
              log.debug("After adding to allEndpoints map, size is "
                      + allEndpoints.size());
          }
      }
      
      serviceGroup.addService(axisService);

      if (!axisService.isClientSide()) {
          notifyObservers(new AxisEvent(AxisEvent.SERVICE_DEPLOY, axisService), axisService);
      }
  }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:64,代码来源:AxisConfiguration.java


示例19: findBindingMessage

import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
private AxisBindingMessage findBindingMessage() {
  	if (axisService != null && axisOperation != null ) {
	if (axisService.getEndpointName() != null) {
		AxisEndpoint axisEndpoint = axisService
				.getEndpoint(axisService.getEndpointName());
		if (axisEndpoint != null) {
			AxisBinding axisBinding = axisEndpoint.getBinding();
                  AxisBindingOperation axisBindingOperation = (AxisBindingOperation) axisBinding
					.getChild(axisOperation.getName());

                  //If Binding Operation is not found, just return null
                  if (axisBindingOperation == null) {
                     return null;
                  }

                  String direction = axisMessage.getDirection();
			AxisBindingMessage axisBindingMessage = null;
			if (WSDLConstants.WSDL_MESSAGE_DIRECTION_IN
					.equals(direction)
					&& WSDLUtil
							.isInputPresentForMEP(axisOperation
									.getMessageExchangePattern())) {
				axisBindingMessage = (AxisBindingMessage) axisBindingOperation
						.getChild(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
				return axisBindingMessage;

			} else if (WSDLConstants.WSDL_MESSAGE_DIRECTION_OUT
					.equals(direction)
					&& WSDLUtil
							.isOutputPresentForMEP(axisOperation
									.getMessageExchangePattern())) {
				axisBindingMessage = (AxisBindingMessage) axisBindingOperation
						.getChild(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
				return axisBindingMessage;
			}
		}

	}
}
  	return null;
  }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:42,代码来源:MessageContext.java


示例20: processDocument

import org.apache.axis2.description.AxisEndpoint; //导入依赖的package包/类
/**
 * @return Returns the document element.
 */
public OMElement processDocument(InputStream inputStream, String contentType,
                                 MessageContext messageContext)
        throws AxisFault {

    MultipleEntryHashMap parameterMap = new MultipleEntryHashMap();
    SOAPFactory soapFactory;
    AxisBindingOperation axisBindingOperation =
            (AxisBindingOperation) messageContext.getProperty(
                    Constants.AXIS_BINDING_OPERATION);
    String queryParameterSeparator = null;
    String templatedPath = null;
    if (axisBindingOperation != null) {
        queryParameterSeparator = (String) axisBindingOperation
                .getProperty(WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR);
        templatedPath =
                (String) axisBindingOperation.getProperty(WSDL2Constants.ATTR_WHTTP_LOCATION);
    }
    if (queryParameterSeparator == null) {
        queryParameterSeparator =
                WSDL20DefaultValueHolder.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR_DEFAULT;
    }

    AxisEndpoint axisEndpoint =
            (AxisEndpoint) messageContext.getProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME);
    if (axisEndpoint != null) {
        AxisBinding axisBinding = axisEndpoint.getBinding();
        String soapVersion =
                (String) axisBinding.getProperty(WSDL2Constants.ATTR_WSOAP_VERSION);
        soapFactory = getSOAPFactory(soapVersion);
    } else {
        soapFactory = getSOAPFactory(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
    }
    EndpointReference endpointReference = messageContext.getTo();
    if (endpointReference == null) {
        throw new AxisFault("Cannot create DocumentElement without destination EPR");
    }

    String requestURL = endpointReference.getAddress();
    try {
        requestURL = extractParametersUsingHttpLocation(templatedPath, parameterMap,
                                                        requestURL,
                                                        queryParameterSeparator);
    } catch (UnsupportedEncodingException e) {
        throw AxisFault.makeFault(e);
    }

    String query = requestURL;
    int index;
    if ((index = requestURL.indexOf("?")) > -1) {
        query = requestURL.substring(index + 1);
    }

    extractParametersFromRequest(parameterMap, query, queryParameterSeparator,
                                 (String) messageContext.getProperty(
                                         Constants.Configuration.CHARACTER_SET_ENCODING),
                                 inputStream);

    messageContext.setProperty(Constants.REQUEST_PARAMETER_MAP, parameterMap);
    return BuilderUtil.buildsoapMessage(messageContext, parameterMap,
                                        soapFactory);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AttRuntimeVisibleAnnotations类代码示例发布时间:2022-05-23
下一篇:
Java GSIConstants类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap