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

Java ClientMessages类代码示例

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

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



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

示例1: getPort

import com.sun.xml.internal.ws.resources.ClientMessages; //导入依赖的package包/类
@Override
public <T> T getPort(Class<T> portInterface, WebServiceFeature... features) {
    //get the portType from SEI
    QName portTypeName = RuntimeModeler.getPortTypeName(portInterface, getMetadadaReader(new WebServiceFeatureList(features), portInterface.getClassLoader()));
    WSDLService tmpWsdlService = this.wsdlService;
    if (tmpWsdlService == null) {
        // assigning it to local variable and not setting it back to this.wsdlService intentionally
        // as we don't want to include the service instance with information gathered from sei
        tmpWsdlService = getWSDLModelfromSEI(portInterface);
        //still null? throw error need wsdl metadata to create a proxy
        if(tmpWsdlService == null) {
            throw new WebServiceException(ProviderApiMessages.NO_WSDL_NO_PORT(portInterface.getName()));
        }
    }
    //get the first port corresponding to the SEI
    WSDLPort port = tmpWsdlService.getMatchingPort(portTypeName);
    if (port == null) {
        throw new WebServiceException(ClientMessages.UNDEFINED_PORT_TYPE(portTypeName));
    }
    QName portName = port.getName();
    return getPort(portName, portInterface,features);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:WSServiceDelegate.java


示例2: createEndpointIFBaseProxy

import com.sun.xml.internal.ws.resources.ClientMessages; //导入依赖的package包/类
private <T> T createEndpointIFBaseProxy(@Nullable WSEndpointReference epr, QName portName, Class<T> portInterface,
                                        WebServiceFeatureList webServiceFeatures, SEIPortInfo eif) {
    //fail if service doesnt have WSDL
    if (wsdlService == null) {
        throw new WebServiceException(ClientMessages.INVALID_SERVICE_NO_WSDL(serviceName));
    }

    if (wsdlService.get(portName)==null) {
        throw new WebServiceException(
            ClientMessages.INVALID_PORT_NAME(portName,buildWsdlPortNames()));
    }

    BindingImpl binding = eif.createBinding(webServiceFeatures, portInterface);
    InvocationHandler pis = getStubHandler(binding, eif, epr);

    T proxy = createProxy(portInterface, pis);

    if (serviceInterceptor != null) {
        serviceInterceptor.postCreateProxy((WSBindingProvider)proxy, portInterface);
    }
    return proxy;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:WSServiceDelegate.java


示例3: getOutput

import com.sun.xml.internal.ws.resources.ClientMessages; //导入依赖的package包/类
OutputStream getOutput() {
    try {
        createHttpConnection();
        // for "GET" request no need to get outputStream
        if (requiresOutputStream()) {
            outputStream = httpConnection.getOutputStream();
            if (chunkSize != null) {
                outputStream = new WSChunkedOuputStream(outputStream, chunkSize);
            }
            List<String> contentEncoding = reqHeaders.get("Content-Encoding");
            // TODO need to find out correct encoding based on q value - RFC 2616
            if (contentEncoding != null && contentEncoding.get(0).contains("gzip")) {
                outputStream = new GZIPOutputStream(outputStream);
            }
        }
        httpConnection.connect();
    } catch (Exception ex) {
        throw new ClientTransportException(
            ClientMessages.localizableHTTP_CLIENT_FAILED(ex),ex);
    }

    return outputStream;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:24,代码来源:HttpClientTransport.java


示例4: getInput

import com.sun.xml.internal.ws.resources.ClientMessages; //导入依赖的package包/类
@Nullable InputStream getInput() {
    // response processing

    InputStream in;
    try {
        in = readResponse();
        if (in != null) {
            String contentEncoding = httpConnection.getContentEncoding();
            if (contentEncoding != null && contentEncoding.contains("gzip")) {
                in = new GZIPInputStream(in);
            }
        }
    } catch (IOException e) {
        throw new ClientTransportException(ClientMessages.localizableHTTP_STATUS_CODE(statusCode, statusMessage), e);
    }
    return in;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:18,代码来源:HttpClientTransport.java


示例5: getPort

import com.sun.xml.internal.ws.resources.ClientMessages; //导入依赖的package包/类
public <T> T getPort(Class<T> portInterface, WebServiceFeature... features) {
    //get the portType from SEI
    QName portTypeName = RuntimeModeler.getPortTypeName(portInterface);
    WSDLServiceImpl wsdlService = this.wsdlService;
    if(wsdlService == null) {
        // assigning it to local variable and not setting it back to this.wsdlService intentionally
        // as we don't want to include the service instance with information gathered from sei
        wsdlService = getWSDLModelfromSEI(portInterface);
        //still null? throw error need wsdl metadata to create a proxy
        if(wsdlService == null) {
            throw new WebServiceException(ProviderApiMessages.NO_WSDL_NO_PORT(portInterface.getName()));
        }
    }
    //get the first port corresponding to the SEI
    WSDLPortImpl port = wsdlService.getMatchingPort(portTypeName);
    if (port == null)
            throw new WebServiceException(ClientMessages.UNDEFINED_PORT_TYPE(portTypeName));
    QName portName = port.getName();
    return getPort(portName, portInterface,features);
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:21,代码来源:WSServiceDelegate.java


示例6: createEndpointIFBaseProxy

import com.sun.xml.internal.ws.resources.ClientMessages; //导入依赖的package包/类
private <T> T createEndpointIFBaseProxy(@Nullable WSEndpointReference epr,QName portName, final Class<T> portInterface,
                                        WebServiceFeature[] webServiceFeatures, SEIPortInfo eif) {
    //fail if service doesnt have WSDL
    if (wsdlService == null)
        throw new WebServiceException(ClientMessages.INVALID_SERVICE_NO_WSDL(serviceName));

    if (wsdlService.get(portName)==null) {
        throw new WebServiceException(
            ClientMessages.INVALID_PORT_NAME(portName,buildWsdlPortNames()));
    }

    BindingImpl binding = eif.createBinding(webServiceFeatures,portInterface);
    SEIStub pis = new SEIStub(eif, binding, eif.model, epr);

    T proxy = createProxy(portInterface, pis);

    if (serviceInterceptor != null) {
        serviceInterceptor.postCreateProxy((WSBindingProvider)proxy, portInterface);
    }
    return proxy;
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:22,代码来源:WSServiceDelegate.java


示例7: WSEndpointReference

import com.sun.xml.internal.ws.resources.ClientMessages; //导入依赖的package包/类
/**
 * Creates from the spec version of {@link EndpointReference}.
 *
 * <p>
 * This method performs the data conversion, so it's slow.
 * Do not use this method in a performance critical path.
 */
public WSEndpointReference(EndpointReference epr, AddressingVersion version) {
    try {
        MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
        epr.writeTo(new XMLStreamBufferResult(xsb));
        this.infoset = xsb;
        this.version = version;
        this.rootElement = new QName("EndpointReference", version.nsUri);
        parse();
    } catch (XMLStreamException e) {
        throw new WebServiceException(ClientMessages.FAILED_TO_PARSE_EPR(epr),e);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:WSEndpointReference.java


示例8: setHandlerChain

import com.sun.xml.internal.ws.resources.ClientMessages; //导入依赖的package包/类
/**
 * This method separates the logical and protocol handlers and
 * sets the HandlerConfiguration.
 * Only logical handlers are allowed with HTTPBinding.
 * Setting SOAPHandlers throws WebServiceException
 */
public void setHandlerChain(List<Handler> chain) {
    for (Handler handler : chain) {
        if (!(handler instanceof LogicalHandler)) {
            throw new WebServiceException(ClientMessages.NON_LOGICAL_HANDLER_SET(handler.getClass()));
        }
    }
    setHandlerConfig(new HandlerConfiguration(Collections.<String>emptySet(), chain));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:HTTPBindingImpl.java


示例9: setRoles

import com.sun.xml.internal.ws.resources.ClientMessages; //导入依赖的package包/类
/**
 * Adds the next and other roles in case this has
 * been called by a user without them.
 * Creates a new HandlerConfiguration object and sets it on the BindingImpl.
 */
public void setRoles(Set<String> roles) {
    if (roles == null) {
        roles = new HashSet<String>();
    }
    if (roles.contains(ROLE_NONE)) {
        throw new WebServiceException(ClientMessages.INVALID_SOAP_ROLE_NONE());
    }
    addRequiredRoles(roles);
    setHandlerConfig(new HandlerConfiguration(roles, getHandlerConfig()));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:SOAPBindingImpl.java


示例10: freeze

import com.sun.xml.internal.ws.resources.ClientMessages; //导入依赖的package包/类
public void freeze() {
    portType = owner.getPortType(portTypeName);
    if(portType == null){
        throw new LocatableWebServiceException(
                ClientMessages.UNDEFINED_PORT_TYPE(portTypeName), getLocation());
    }
    portType.freeze();

    for (EditableWSDLBoundOperation op : bindingOperations.values()) {
        op.freeze(owner);
    }

    freezePayloadMap();
    owner.finalizeRpcLitBinding(this);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:WSDLBoundPortTypeImpl.java


示例11: getWSEndpointReference

import com.sun.xml.internal.ws.resources.ClientMessages; //导入依赖的package包/类
@Override
public final WSEndpointReference getWSEndpointReference() {
    if (binding.getBindingID().equals(HTTPBinding.HTTP_BINDING)) {
        throw new java.lang.UnsupportedOperationException(
                    ClientMessages.UNSUPPORTED_OPERATION("BindingProvider.getEndpointReference(Class<T> class)", "XML/HTTP Binding", "SOAP11 or SOAP12 Binding")
                );
    }

    if (endpointReference != null) {
        return endpointReference;
    }

    String eprAddress = requestContext.getEndpointAddress().toString();
    QName portTypeName = null;
    String wsdlAddress = null;
    List<WSEndpointReference.EPRExtension> wsdlEPRExtensions = new ArrayList<WSEndpointReference.EPRExtension>();
    if (wsdlPort != null) {
        portTypeName = wsdlPort.getBinding().getPortTypeName();
        wsdlAddress = eprAddress + "?wsdl";

        //gather EPRExtensions specified in WSDL.
        try {
            WSEndpointReference wsdlEpr = wsdlPort.getEPR();
            if (wsdlEpr != null) {
                for (WSEndpointReference.EPRExtension extnEl : wsdlEpr.getEPRExtensions()) {
                    wsdlEPRExtensions.add(new WSEPRExtension(
                            XMLStreamBuffer.createNewBufferFromXMLStreamReader(extnEl.readAsXMLStreamReader()), extnEl.getQName()));
                }
            }

        } catch (XMLStreamException ex) {
            throw new WebServiceException(ex);
        }
    }
    AddressingVersion av = AddressingVersion.W3C;
    this.endpointReference = new WSEndpointReference(
            av, eprAddress, getServiceName(), getPortName(), portTypeName, null, wsdlAddress, null, wsdlEPRExtensions, null);

    return this.endpointReference;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:Stub.java


示例12: getEndpointReference

import com.sun.xml.internal.ws.resources.ClientMessages; //导入依赖的package包/类
@Override
public final W3CEndpointReference getEndpointReference() {
    if (binding.getBindingID().equals(HTTPBinding.HTTP_BINDING)) {
        throw new java.lang.UnsupportedOperationException(
                    ClientMessages.UNSUPPORTED_OPERATION("BindingProvider.getEndpointReference()", "XML/HTTP Binding", "SOAP11 or SOAP12 Binding"));
    }
    return getEndpointReference(W3CEndpointReference.class);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:Stub.java


示例13: safeGetPort

import com.sun.xml.internal.ws.resources.ClientMessages; //导入依赖的package包/类
/**
 * Obtains {@link PortInfo} for the given name, with error check.
 */
public
@NotNull
PortInfo safeGetPort(QName portName) {
    PortInfo port = ports.get(portName);
    if (port == null) {
        throw new WebServiceException(ClientMessages.INVALID_PORT_NAME(portName, buildNameList(ports.keySet())));
    }
    return port;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:WSServiceDelegate.java


示例14: getPortModel

import com.sun.xml.internal.ws.resources.ClientMessages; //导入依赖的package包/类
/**
 * Obtains a {@link WSDLPortImpl} with error check.
 *
 * @return guaranteed to be non-null.
 */
public @NotNull WSDLPort getPortModel(WSDLService wsdlService, QName portName) {
    WSDLPort port = wsdlService.get(portName);
    if (port == null)
        throw new WebServiceException(
            ClientMessages.INVALID_PORT_NAME(portName,buildWsdlPortNames()));
    return port;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:WSServiceDelegate.java


示例15: checkStatusCode

import com.sun.xml.internal.ws.resources.ClientMessages; //导入依赖的package包/类
private void checkStatusCode(InputStream in, HttpClientTransport con) throws IOException {
    int statusCode = con.statusCode;
    String statusMessage = con.statusMessage;
    // SOAP1.1 and SOAP1.2 differ here
    if (binding instanceof SOAPBinding) {
        if (binding.getSOAPVersion() == SOAPVersion.SOAP_12) {
            //In SOAP 1.2, Fault messages can be sent with 4xx and 5xx error codes
            if (statusCode == HttpURLConnection.HTTP_OK || statusCode == HttpURLConnection.HTTP_ACCEPTED || isErrorCode(statusCode)) {
                // acceptable status codes for SOAP 1.2
                if (isErrorCode(statusCode) && in == null) {
                    // No envelope for the error, so throw an exception with http error details
                    throw new ClientTransportException(ClientMessages.localizableHTTP_STATUS_CODE(statusCode, statusMessage));
                }
                return;
            }
        } else {
            // SOAP 1.1
            if (statusCode == HttpURLConnection.HTTP_OK || statusCode == HttpURLConnection.HTTP_ACCEPTED || statusCode == HttpURLConnection.HTTP_INTERNAL_ERROR) {
                // acceptable status codes for SOAP 1.1
                if (statusCode == HttpURLConnection.HTTP_INTERNAL_ERROR && in == null) {
                    // No envelope for the error, so throw an exception with http error details
                    throw new ClientTransportException(ClientMessages.localizableHTTP_STATUS_CODE(statusCode, statusMessage));
                }
                return;
            }
        }
        if (in != null) {
            in.close();
        }
        throw new ClientTransportException(ClientMessages.localizableHTTP_STATUS_CODE(statusCode, statusMessage));
    }
    // Every status code is OK for XML/HTTP
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:HttpTransportPipe.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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