本文整理汇总了Java中com.sun.xml.internal.ws.transport.Headers类的典型用法代码示例。如果您正苦于以下问题:Java Headers类的具体用法?Java Headers怎么用?Java Headers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Headers类属于com.sun.xml.internal.ws.transport包,在下文中一共展示了Headers类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: mergeRequestHeaders
import com.sun.xml.internal.ws.transport.Headers; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void mergeRequestHeaders(Packet packet) {
//for bug 12883765
//retrieve headers which is set in soap message
Headers packetHeaders = (Headers) packet.invocationProperties.get(HTTP_REQUEST_HEADERS);
//retrieve headers from request context
Map<String, List<String>> myHeaders = (Map<String, List<String>>) asMap().get(HTTP_REQUEST_HEADERS);
if ((packetHeaders != null) && (myHeaders != null)) {
//update the headers set in soap message with those in request context
for (Entry<String, List<String>> entry : myHeaders.entrySet()) {
String key = entry.getKey();
if (key != null && key.trim().length() != 0) {
List<String> listFromPacket = packetHeaders.get(key);
//if the two headers contain the same key, combine the value
if (listFromPacket != null) {
listFromPacket.addAll(entry.getValue());
} else {
//add the headers in request context to those set in soap message
packetHeaders.put(key, myHeaders.get(key));
}
}
}
// update headers in request context with those set in soap message since it may contain other properties..
asMap().put(HTTP_REQUEST_HEADERS, packetHeaders);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:RequestContext.java
示例2: createPacket
import com.sun.xml.internal.ws.transport.Headers; //导入依赖的package包/类
Packet createPacket(SOAPMessage arg) {
Iterator iter = arg.getMimeHeaders().getAllHeaders();
Headers ch = new Headers();
while(iter.hasNext()) {
MimeHeader mh = (MimeHeader) iter.next();
ch.add(mh.getName(), mh.getValue());
}
Packet packet = new Packet(SAAJFactory.create(arg));
packet.invocationProperties.put(MessageContext.HTTP_REQUEST_HEADERS, ch);
return packet;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:SOAPMessageDispatch.java
示例3: createPacket
import com.sun.xml.internal.ws.transport.Headers; //导入依赖的package包/类
Packet createPacket(SOAPMessage arg) {
Iterator iter = arg.getMimeHeaders().getAllHeaders();
Headers ch = new Headers();
while(iter.hasNext()) {
MimeHeader mh = (MimeHeader) iter.next();
ch.add(mh.getName(), mh.getValue());
}
Packet packet = new Packet(new SAAJMessage(arg));
packet.invocationProperties.put(MessageContext.HTTP_REQUEST_HEADERS, ch);
return packet;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:12,代码来源:SOAPMessageDispatch.java
注:本文中的com.sun.xml.internal.ws.transport.Headers类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论