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

Java HeaderList类代码示例

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

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



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

示例1: writeTo

import com.sun.xml.internal.ws.api.message.HeaderList; //导入依赖的package包/类
/**
 * Default implementation that relies on {@link #writePayloadTo(XMLStreamWriter)}
 */
public void writeTo(XMLStreamWriter w) throws XMLStreamException {
    String soapNsUri = soapVersion.nsUri;
    w.writeStartDocument();
    w.writeStartElement("S","Envelope",soapNsUri);
    w.writeNamespace("S",soapNsUri);
    if(hasHeaders()) {
        w.writeStartElement("S","Header",soapNsUri);
        HeaderList headers = getHeaders();
        int len = headers.size();
        for( int i=0; i<len; i++ ) {
            headers.get(i).writeTo(w);
        }
        w.writeEndElement();
    }
    // write the body
    w.writeStartElement("S","Body",soapNsUri);

    writePayloadTo(w);

    w.writeEndElement();
    w.writeEndElement();
    w.writeEndDocument();
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:27,代码来源:AbstractMessageImpl.java


示例2: writeEnvelope

import com.sun.xml.internal.ws.api.message.HeaderList; //导入依赖的package包/类
/**
 * This method should be called when the StreamMessage is created with a payload
 * @param writer
 */
private void writeEnvelope(XMLStreamWriter writer) throws XMLStreamException {
    writer.writeStartDocument();
    envelopeTag.writeStart(writer);

    //write headers
    HeaderList hl = getHeaders();
    if(hl.size() > 0){
        headerTag.writeStart(writer);
        for(Header h:hl){
            h.writeTo(writer);
        }
        writer.writeEndElement();
    }
    bodyTag.writeStart(writer);
    if(hasPayload())
        writePayloadTo(writer);
    writer.writeEndElement();
    writer.writeEndElement();
    writer.writeEndDocument();
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:25,代码来源:StreamMessage.java


示例3: writeTo

import com.sun.xml.internal.ws.api.message.HeaderList; //导入依赖的package包/类
public void writeTo( ContentHandler contentHandler, ErrorHandler errorHandler ) throws SAXException {
    contentHandler.setDocumentLocator(NULL_LOCATOR);
    contentHandler.startDocument();
    envelopeTag.writeStart(contentHandler);
    headerTag.writeStart(contentHandler);
    if(hasHeaders()) {
        HeaderList headers = getHeaders();
        int len = headers.size();
        for( int i=0; i<len; i++ ) {
            // shouldn't JDK be smart enough to use array-style indexing for this foreach!?
            headers.get(i).writeTo(contentHandler,errorHandler);
        }
    }
    headerTag.writeEnd(contentHandler);
    bodyTag.writeStart(contentHandler);
    writePayloadTo(contentHandler,errorHandler, true);
    bodyTag.writeEnd(contentHandler);
    envelopeTag.writeEnd(contentHandler);

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


示例4: getMisUnderstoodHeaders

import com.sun.xml.internal.ws.api.message.HeaderList; //导入依赖的package包/类
/**
 * @param headers HeaderList that needs MU processing
 * @param roles        Roles configured on the Binding. Required Roles supposed to be assumbed a by a
 *                     SOAP Binding implementation are added.
 * @param handlerKnownHeaders Set of headers that the handlerchain associated with the binding understands
 * @return returns the headers that have mustUnderstand attribute and are not understood
 *         by the binding.
 */
public final Set<QName> getMisUnderstoodHeaders(HeaderList headers, Set<String> roles,
                                                Set<QName> handlerKnownHeaders) {
    Set<QName> notUnderstoodHeaders = null;
    for (int i = 0; i < headers.size(); i++) {
        if (!headers.isUnderstood(i)) {
            Header header = headers.get(i);
            if (!header.isIgnorable(soapVersion, roles)) {
                QName qName = new QName(header.getNamespaceURI(), header.getLocalPart());
                // see if the binding can understand it
                if (!binding.understandsHeader(qName)) {
                    if (!handlerKnownHeaders.contains(qName)) {
                        logger.info("Element not understood=" + qName);
                        if (notUnderstoodHeaders == null)
                            notUnderstoodHeaders = new HashSet<QName>();
                        notUnderstoodHeaders.add(qName);
                    }
                }
            }
        }
    }
    return notUnderstoodHeaders;
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:31,代码来源:MUTube.java


示例5: configureRequestPacket

import com.sun.xml.internal.ws.api.message.HeaderList; //导入依赖的package包/类
private void configureRequestPacket(Packet packet, RequestContext requestContext) {
    // fill in Packet
    packet.proxy = this;
    packet.handlerConfig = binding.getHandlerConfig();
    requestContext.fill(packet,(binding.getAddressingVersion() != null));
    if (wsdlProperties != null) {
        packet.addSatellite(wsdlProperties);
    }
    if (addrVersion != null) {
        // populate request WS-Addressing headers
        HeaderList headerList = packet.getMessage().getHeaders();
        headerList.fillRequestAddressingHeaders(wsdlPort, binding, packet);


        // Spec is not clear on if ReferenceParameters are to be added when addressing is not enabled,
        // but the EPR has ReferenceParameters.
        // Current approach: Add ReferenceParameters only if addressing enabled.
        if (endpointReference != null)
            endpointReference.addReferenceParameters(packet.getMessage().getHeaders());
    }

    // to make it multi-thread safe we need to first get a stable snapshot
    Header[] hl = userOutboundHeaders;
    if(hl!=null)
            packet.getMessage().getHeaders().addAll(hl);
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:27,代码来源:Stub.java


示例6: cacheHeaders

import com.sun.xml.internal.ws.api.message.HeaderList; //导入依赖的package包/类
private static XMLStreamBuffer cacheHeaders(XMLStreamReader reader,
        Map<String, String> namespaces, HeaderList headers,
        StreamHeaderDecoder headerDecoder) throws XMLStreamException {
    MutableXMLStreamBuffer buffer = createXMLStreamBuffer();
    StreamReaderBufferCreator creator = new StreamReaderBufferCreator();
    creator.setXMLStreamBuffer(buffer);

    // Reader is positioned at the first header block
    while(reader.getEventType() == javax.xml.stream.XMLStreamConstants.START_ELEMENT) {
        Map<String,String> headerBlockNamespaces = namespaces;

        // Collect namespaces on SOAP header block
        if (reader.getNamespaceCount() > 0) {
            headerBlockNamespaces = new HashMap<String,String>(namespaces);
            for (int i = 0; i < reader.getNamespaceCount(); i++) {
                headerBlockNamespaces.put(reader.getNamespacePrefix(i), reader.getNamespaceURI(i));
            }
        }

        // Mark
        XMLStreamBuffer mark = new XMLStreamBufferMark(headerBlockNamespaces, creator);
        // Create Header
        headers.add(headerDecoder.decodeHeader(reader, mark));


        // Cache the header block
        // After caching Reader will be positioned at next header block or
        // the end of the </soap:header>
        creator.createElementFragment(reader, false);
        if (reader.getEventType() != XMLStreamConstants.START_ELEMENT &&
                reader.getEventType() != XMLStreamConstants.END_ELEMENT) {
            XMLStreamReaderUtil.nextElementContent(reader);
        }
    }

    return buffer;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:StreamMessage.java


示例7: JAXBMessage

import com.sun.xml.internal.ws.api.message.HeaderList; //导入依赖的package包/类
/**
 * Copy constructor.
 */
public JAXBMessage(JAXBMessage that) {
    super(that);
    this.headers = that.headers;
    if(this.headers!=null)
        this.headers = new HeaderList(this.headers);
    this.attachmentSet = that.attachmentSet;

    this.jaxbObject = that.jaxbObject;
    this.bridge = that.bridge;
    this.rawContext = that.rawContext;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:JAXBMessage.java


示例8: addReferenceParametersToList

import com.sun.xml.internal.ws.api.message.HeaderList; //导入依赖的package包/类
/**
 * Copies all the reference parameters in this EPR as headers
 * to the given {@link HeaderList}.
 * @deprecated - use addReferenceParametersToList(MessageHeaders)
 */
@SuppressWarnings("ManualArrayToCollectionCopy")
public void addReferenceParametersToList(HeaderList outbound) {
    // implemented through iteration because of unsupportedoperation exception thrown from addAll method on headerlist
    // do not change
    for (Header header : referenceParameters) {
        outbound.add(header);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:WSEndpointReference.java


示例9: addReferenceParameters

import com.sun.xml.internal.ws.api.message.HeaderList; //导入依赖的package包/类
/**
 * Copies all the reference parameters from the given {@link HeaderList}
 * to this EPR
 */
public void addReferenceParameters(HeaderList headers) {
    if (headers != null) {
            Header[] hs = new Header[referenceParameters.length + headers.size()];
            System.arraycopy(referenceParameters, 0, hs, 0, referenceParameters.length);
            int i = referenceParameters.length;
            for (Header h : headers) {
                    hs[i++] = h;
            }
            referenceParameters = hs;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:WSEndpointReference.java


示例10: DOMMessage

import com.sun.xml.internal.ws.api.message.HeaderList; //导入依赖的package包/类
/**
 * This constructor is a convenience and called by the {@link #copy}
 */
private DOMMessage(DOMMessage that) {
    super(that);
    this.headers = HeaderList.copy(that.headers);
    this.payload = that.payload;
    this.copyFrom(that);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:DOMMessage.java


示例11: JAXBMessage

import com.sun.xml.internal.ws.api.message.HeaderList; //导入依赖的package包/类
/**
 * Copy constructor.
 */
public JAXBMessage(JAXBMessage that) {
    super(that);
    this.headers = that.headers;
    if(this.headers!=null)
        this.headers = new HeaderList(this.headers);
    this.attachmentSet = that.attachmentSet;

    this.jaxbObject = that.jaxbObject;
    this.bridge = that.bridge;
    this.rawContext = that.rawContext;
    this.copyFrom(that);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:JAXBMessage.java


示例12: EmptyMessageImpl

import com.sun.xml.internal.ws.api.message.HeaderList; //导入依赖的package包/类
/**
 * Copy constructor.
 */
private EmptyMessageImpl(EmptyMessageImpl that) {
    super(that);
    this.headers = new HeaderList(that.headers);
    this.attachmentSet = that.attachmentSet;
    this.copyFrom(that);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:EmptyMessageImpl.java


示例13: StreamMessage

import com.sun.xml.internal.ws.api.message.HeaderList; //导入依赖的package包/类
/**
 * Creates a {@link StreamMessage} from a {@link XMLStreamReader}
 * that points at the start element of the payload, and headers.
 *
 * <p>
 * This method creaets a {@link Message} from a payload.
 *
 * @param headers
 *      if null, it means no headers. if non-null,
 *      it will be owned by this message.
 * @param reader
 *      points at the start element/document of the payload (or the end element of the &lt;s:Body>
 *      if there's no payload)
 */
public StreamMessage(@Nullable HeaderList headers, @NotNull AttachmentSet attachmentSet, @NotNull XMLStreamReader reader, @NotNull SOAPVersion soapVersion) {
    super(soapVersion);
    this.headers = headers;
    this.attachmentSet = attachmentSet;
    this.reader = reader;

    if(reader.getEventType()== START_DOCUMENT)
        XMLStreamReaderUtil.nextElementContent(reader);

    //if the reader is pointing to the end element </soapenv:Body> then its empty message
    // or no payload
    if(reader.getEventType() == XMLStreamConstants.END_ELEMENT){
        String body = reader.getLocalName();
        String nsUri = reader.getNamespaceURI();
        assert body != null;
        assert nsUri != null;
        //if its not soapenv:Body then throw exception, we received malformed stream
        if(body.equals("Body") && nsUri.equals(soapVersion.nsUri)){
            this.payloadLocalName = null;
            this.payloadNamespaceURI = null;
        }else{ //TODO: i18n and also we should be throwing better message that this
            throw new WebServiceException("Malformed stream: {"+nsUri+"}"+body);
        }
    }else{
        this.payloadLocalName = reader.getLocalName();
        this.payloadNamespaceURI = reader.getNamespaceURI();
    }

    // use the default infoset representation for headers
    int base = soapVersion.ordinal()*3;
    this.envelopeTag = DEFAULT_TAGS[base];
    this.headerTag = DEFAULT_TAGS[base+1];
    this.bodyTag = DEFAULT_TAGS[base+2];
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:49,代码来源:StreamMessage.java


示例14: DOMMessage

import com.sun.xml.internal.ws.api.message.HeaderList; //导入依赖的package包/类
public DOMMessage(SOAPVersion ver, HeaderList headers, Element payload, AttachmentSet attachments) {
    super(ver);
    this.headers = headers;
    this.payload = payload;
    this.attachmentSet = attachments;
    assert payload!=null;
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:8,代码来源:DOMMessage.java


示例15: JAXBMessage

import com.sun.xml.internal.ws.api.message.HeaderList; //导入依赖的package包/类
private JAXBMessage( JAXBRIContext context, Object jaxbObject, SOAPVersion soapVer, HeaderList headers, AttachmentSet attachments ) {
    super(soapVer);
    this.bridge = new MarshallerBridge(context);
    this.jaxbObject = jaxbObject;
    this.headers = headers;
    this.attachmentSet = attachments;
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:8,代码来源:JAXBMessage.java


示例16: PayloadSourceMessage

import com.sun.xml.internal.ws.api.message.HeaderList; //导入依赖的package包/类
public PayloadSourceMessage(@Nullable HeaderList headers,
    @NotNull Source payload, @NotNull AttachmentSet attSet,
    @NotNull SOAPVersion soapVersion) {

    super(headers, SourceReaderFactory.createSourceReader(payload, true),
            attSet, soapVersion);
}
 
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:8,代码来源:PayloadSourceMessage.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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