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

Java ServerMessages类代码示例

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

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



ServerMessages类属于com.sun.xml.internal.ws.resources包,在下文中一共展示了ServerMessages类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getWSDLOperationMapping

import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
public @NotNull WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
    WSDLOperationMapping opName;
    for(WSDLOperationFinder finder: opFinders) {
        opName = finder.getWSDLOperationMapping(request);
        if(opName != null)
            return opName;
    }
    //No way to dispatch this request
    String err = MessageFormat.format("Request=[SOAPAction={0},Payload='{'{1}'}'{2}]",
            request.soapAction, request.getMessage().getPayloadNamespaceURI(),
            request.getMessage().getPayloadLocalPart());
    String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(err);
    Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(
            binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient);
    throw new DispatchException(faultMsg);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:OperationDispatcher.java


示例2: getWSDLOperationMapping

import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
/**
     *
     * @return not null if it finds a unique handler for the request
     *         null if it cannot idenitify a unique wsdl operation from the Payload QName.
     *
     * @throws DispatchException if the payload itself is incorrect, this happens when the payload is not accepted by
     *          any operation in the port.
     */
//  public QName getWSDLOperationQName(Packet request) throws DispatchException{

    public WSDLOperationMapping getWSDLOperationMapping(Packet request) throws DispatchException {
        Message message = request.getMessage();
        String localPart = message.getPayloadLocalPart();
        String nsUri;
        if (localPart == null) {
            localPart = EMPTY_PAYLOAD_LOCAL;
            nsUri = EMPTY_PAYLOAD_NSURI;
        } else {
            nsUri = message.getPayloadNamespaceURI();
            if(nsUri == null)
                nsUri = EMPTY_PAYLOAD_NSURI;
        }
        WSDLOperationMapping op = methodHandlers.get(nsUri, localPart);

        // Check if payload itself is correct. Usually it is, so let us check last
        if (op == null && !unique.containsKey(nsUri,localPart)) {
            String dispatchKey = "{" + nsUri + "}" + localPart;
            String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey);
            throw new DispatchException(SOAPFaultBuilder.createSOAPFaultMessage(
                 binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
        }
        return op;
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:PayloadQNameBasedOperationFinder.java


示例3: getWSDLOperationQName

import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
/**
 *
 * @param request Packet
 * @return QName of the wsdl operation.
 * @throws DispatchException if a unique operartion cannot be associated with this packet.
 */
public @NotNull QName getWSDLOperationQName(Packet request) throws DispatchException {
    QName opName;
    for(WSDLOperationFinder finder: opFinders) {
        opName = finder.getWSDLOperationQName(request);
        if(opName != null)
            return opName;
    }
    //No way to dispatch this request
    String err = MessageFormat.format("Request=[SOAPAction={0},Payload='{'{1}'}'{2}]",
            request.soapAction, request.getMessage().getPayloadNamespaceURI(),
            request.getMessage().getPayloadLocalPart());
    String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(err);
    Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(
            binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient);
    throw new DispatchException(faultMsg);

}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:24,代码来源:OperationDispatcher.java


示例4: getWSDLOperationQName

import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
/**
 *
 * @return not null if it finds a unique handler for the request
 *         null if it cannot idenitify a unique wsdl operation from the Payload QName.
 *
 * @throws DispatchException if the payload itself is incorrect, this happens when the payload is not accepted by
 *          any operation in the port.
 */
public QName getWSDLOperationQName(Packet request) throws DispatchException{
    Message message = request.getMessage();
    String localPart = message.getPayloadLocalPart();
    String nsUri;
    if (localPart == null) {
        localPart = EMPTY_PAYLOAD_LOCAL;
        nsUri = EMPTY_PAYLOAD_NSURI;
    } else {
        nsUri = message.getPayloadNamespaceURI();
        if(nsUri == null)
            nsUri = EMPTY_PAYLOAD_NSURI;
    }
    QName op = methodHandlers.get(nsUri, localPart);

    // Check if payload itself is correct. Usually it is, so let us check last
    if (op == null && !unique.containsKey(nsUri,localPart)) {
        String dispatchKey = "{" + nsUri + "}" + localPart;
        String faultString = ServerMessages.DISPATCH_CANNOT_FIND_METHOD(dispatchKey);
        throw new DispatchException(SOAPFaultBuilder.createSOAPFaultMessage(
             binding.getSOAPVersion(), faultString, binding.getSOAPVersion().faultCodeClient));
    }
    return op;
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:32,代码来源:PayloadQNameBasedOperationFinder.java


示例5: findAnnotatedMethod

import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
/**
 * Finds the method that has the given annotation, while making sure that
 * there's only at most one such method.
 */
protected final @Nullable Method findAnnotatedMethod(Class clazz, Class<? extends Annotation> annType) {
    boolean once = false;
    Method r = null;
    for(Method method : clazz.getDeclaredMethods()) {
        if (method.getAnnotation(annType) != null) {
            if (once)
                throw new ServerRtException(ServerMessages.ANNOTATION_ONLY_ONCE(annType));
            if (method.getParameterTypes().length != 0)
                throw new ServerRtException(ServerMessages.NOT_ZERO_PARAMETERS(method));
            r = method;
            once = true;
        }
    }
    return r;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:AbstractInstanceResolver.java


示例6: generateWSDL

import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
/**
 * Generates the WSDL and XML Schema for the endpoint if necessary
 * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
 */
private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, List<SDDocumentImpl> docs,
                                           Container container, Class implType) {
    BindingID bindingId = binding.getBindingId();
    if (!bindingId.canGenerateWSDL()) {
        throw new ServerRtException("can.not.generate.wsdl", bindingId);
    }

    if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
        String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
        logger.warning(msg);
    }

    // Generate WSDL and schema documents using runtime model
    WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
    WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
            ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
    wsdlGen.doGeneration();
    return wsdlResolver.updateDocs();
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:24,代码来源:EndpointFactory.java


示例7: createDuplicateHeaderException

import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
private SOAPFaultException createDuplicateHeaderException() {
    try {
        SOAPFault fault = soapVersion.getSOAPFactory().createFault();
        fault.setFaultCode(soapVersion.faultCodeServer);
        fault.setFaultString(ServerMessages.DUPLICATE_PORT_KNOWN_HEADER(headerName));
        return new SOAPFaultException(fault);
    } catch(SOAPException e) {
        throw new WebServiceException(e);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:ResponseBuilder.java


示例8: getImplementorClass

import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
/**
 * Loads the class of the given name.
 *
 * @param xsr Used to report the source location information if there's any error.
 */
private Class getImplementorClass(String name, XMLStreamReader xsr) {
    try {
        return Class.forName(name, true, classLoader);
    } catch (ClassNotFoundException e) {
        logger.log(Level.SEVERE, e.getMessage(), e);
        throw new LocatableWebServiceException(
                ServerMessages.RUNTIME_PARSER_CLASS_NOT_FOUND(name), e, xsr);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:DeploymentDescriptorParser.java


示例9: publish

import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
public void publish(Object serverContext) {
    if (serverContext instanceof javax.xml.ws.spi.http.HttpContext) {
        setHandler((javax.xml.ws.spi.http.HttpContext)serverContext);
        return;
    }
    if (serverContext instanceof HttpContext) {
        this.httpContext = (HttpContext)serverContext;
        setHandler(httpContext);
        return;
    }
    throw new ServerRtException(ServerMessages.NOT_KNOW_HTTP_CONTEXT_TYPE(
            serverContext.getClass(), HttpContext.class,
            javax.xml.ws.spi.http.HttpContext.class));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:HttpEndpoint.java


示例10: createDuplicateHeaderException

import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
private SOAPFaultException createDuplicateHeaderException() {
    try {
        SOAPFault fault = soapVersion.getSOAPFactory().createFault();
        fault.setFaultCode(soapVersion.faultCodeClient);
        fault.setFaultString(ServerMessages.DUPLICATE_PORT_KNOWN_HEADER(headerName));
        return new SOAPFaultException(fault);
    } catch(SOAPException e) {
        throw new WebServiceException(e);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:EndpointArgumentsBuilder.java


示例11: generateWSDL

import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
/**
     * Generates the WSDL and XML Schema for the endpoint if necessary
     * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
     */
    private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, List<SDDocumentImpl> docs,
                                               Container container, Class implType) {
        BindingID bindingId = binding.getBindingId();
        if (!bindingId.canGenerateWSDL()) {
            throw new ServerRtException("can.not.generate.wsdl", bindingId);
        }

        if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
            String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
            logger.warning(msg);
        }

        // Generate WSDL and schema documents using runtime model
        WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
        WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
        wsdlGenInfo.setWsdlResolver(wsdlResolver);
        wsdlGenInfo.setContainer(container);
        wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
        wsdlGenInfo.setInlineSchemas(false);
        wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures()));
        seiModel.getDatabinding().generateWSDL(wsdlGenInfo);
//        WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
//                ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
//        wsdlGen.doGeneration();
        return wsdlResolver.updateDocs();
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:EndpointFactory.java


示例12: createBuilder

import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
static XMLProviderArgumentBuilder createBuilder(ProviderEndpointModel model, WSBinding binding) {
    if (model.mode == Service.Mode.PAYLOAD) {
        return new PayloadSource();
    } else {
        if(model.datatype==Source.class)
            return new PayloadSource();
        if(model.datatype== DataSource.class)
            return new DataSourceParameter(binding);
        throw new WebServiceException(ServerMessages.PROVIDER_INVALID_PARAMETER_TYPE(model.implClass,model.datatype));
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:XMLProviderArgumentBuilder.java


示例13: create

import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
static ProviderArgumentsBuilder create(ProviderEndpointModel model, SOAPVersion soapVersion) {
    if (model.mode == Service.Mode.PAYLOAD) {
        return new PayloadSource(soapVersion);
    } else {
        if(model.datatype==Source.class)
            return new MessageSource(soapVersion);
        if(model.datatype==SOAPMessage.class)
            return new SOAPMessageParameter(soapVersion);
        if(model.datatype==Message.class)
            return new MessageProviderArgumentBuilder(soapVersion);
        throw new WebServiceException(ServerMessages.PROVIDER_INVALID_PARAMETER_TYPE(model.implClass,model.datatype));
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:SOAPProviderArgumentBuilder.java


示例14: generateWSDL

import com.sun.xml.internal.ws.resources.ServerMessages; //导入依赖的package包/类
/**
     * Generates the WSDL and XML Schema for the endpoint if necessary
     * It generates WSDL only for SOAP1.1, and for XSOAP1.2 bindings
     */
    private static SDDocumentImpl generateWSDL(WSBinding binding, AbstractSEIModelImpl seiModel, Collection<SDDocumentImpl> docs,
                                               Container container, Class implType) {
        BindingID bindingId = binding.getBindingId();
        if (!bindingId.canGenerateWSDL()) {
            throw new ServerRtException("can.not.generate.wsdl", bindingId);
        }

        if (bindingId.toString().equals(SOAPBindingImpl.X_SOAP12HTTP_BINDING)) {
            String msg = ServerMessages.GENERATE_NON_STANDARD_WSDL();
            logger.warning(msg);
        }

        // Generate WSDL and schema documents using runtime model
        WSDLGenResolver wsdlResolver = new WSDLGenResolver(docs,seiModel.getServiceQName(),seiModel.getPortTypeName());
        WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
        wsdlGenInfo.setWsdlResolver(wsdlResolver);
        wsdlGenInfo.setContainer(container);
        wsdlGenInfo.setExtensions(ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
        wsdlGenInfo.setInlineSchemas(false);
        wsdlGenInfo.setSecureXmlProcessingDisabled(isSecureXmlProcessingDisabled(binding.getFeatures()));
        seiModel.getDatabinding().generateWSDL(wsdlGenInfo);
//        WSDLGenerator wsdlGen = new WSDLGenerator(seiModel, wsdlResolver, binding, container, implType, false,
//                ServiceFinder.find(WSDLGeneratorExtension.class).toArray());
//        wsdlGen.doGeneration();
        return wsdlResolver.updateDocs();
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:EndpointFactory.java



注:本文中的com.sun.xml.internal.ws.resources.ServerMessages类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java WSDLPort类代码示例发布时间:2022-05-23
下一篇:
Java ClusterValve类代码示例发布时间: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