当前位置: 首页>>代码示例>>Java>>正文


Java SOAPVersion类代码示例

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


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

示例1: access

import com.sun.xml.internal.ws.api.SOAPVersion; //导入依赖的package包/类
protected void access() {
    if (!accessedMessage) {
        try {
            envelopeAttrs = sm.getSOAPPart().getEnvelope().getAttributes();
            Node body = sm.getSOAPBody();
            bodyAttrs = body.getAttributes();
            soapVersion = SOAPVersion.fromNsUri(body.getNamespaceURI());
            //cature all the body elements
            bodyParts = DOMUtil.getChildElements(body);
            //we treat payload as the first body part
            payload = bodyParts.size() > 0 ? bodyParts.get(0) : null;
            // hope this is correct. Caching the localname and namespace of the payload should be fine
            // but what about if a Handler replaces the payload with something else? Weel, may be it
            // will be error condition anyway
            if (payload != null) {
                payloadLocalName = payload.getLocalName();
                payloadNamespace = payload.getNamespaceURI();
            }
            accessedMessage = true;
        } catch (SOAPException e) {
            throw new WebServiceException(e);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:SAAJMessage.java

示例2: getFaultMessage

import com.sun.xml.internal.ws.api.SOAPVersion; //导入依赖的package包/类
public Message getFaultMessage() {
    QName faultCode = (soapVersion == SOAPVersion.SOAP_11)
        ? SOAPConstants.FAULT_CODE_VERSION_MISMATCH
        : SOAP12Constants.FAULT_CODE_VERSION_MISMATCH;
    return SOAPFaultBuilder.createSOAPFaultMessage(
            soapVersion, getLocalizedMessage(), faultCode);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:VersionMismatchException.java

示例3: dumpParam

import com.sun.xml.internal.ws.api.SOAPVersion; //导入依赖的package包/类
private void dumpParam(T param, String method) {
  if (param instanceof Packet) {
    Packet message = (Packet)param;

    String action;
    String msgId;
    if (LOGGER.isLoggable(Level.FINE)) {
      AddressingVersion av = DispatchImpl.this.getBinding().getAddressingVersion();
      SOAPVersion sv = DispatchImpl.this.getBinding().getSOAPVersion();
      action =
        av != null && message.getMessage() != null ?
          AddressingUtils.getAction(message.getMessage().getHeaders(), av, sv) : null;
      msgId =
        av != null && message.getMessage() != null ?
          AddressingUtils.getMessageID(message.getMessage().getHeaders(), av, sv) : null;
      LOGGER.fine("In DispatchImpl." + method + " for message with action: " + action + " and msg ID: " + msgId + " msg: " + message.getMessage());

      if (message.getMessage() == null) {
        LOGGER.fine("Dispatching null message for action: " + action + " and msg ID: " + msgId);
      }
    }
  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:DispatchImpl.java

示例4: fillRequestAddressingHeaders

import com.sun.xml.internal.ws.api.SOAPVersion; //导入依赖的package包/类
public static void fillRequestAddressingHeaders(MessageHeaders headers, Packet packet, AddressingVersion av, SOAPVersion sv, boolean oneway, String action, boolean mustUnderstand) {
    fillCommonAddressingHeaders(headers, packet, av, sv, action, mustUnderstand);

    // wsa:ReplyTo
    // null or "true" is equivalent to request/response MEP
    if (!oneway) {
        WSEndpointReference epr = av.anonymousEpr;
        if (headers.get(av.replyToTag, false) == null) {
          headers.add(epr.createHeader(av.replyToTag));
        }

        // wsa:FaultTo
        if (headers.get(av.faultToTag, false) == null) {
          headers.add(epr.createHeader(av.faultToTag));
        }

        // wsa:MessageID
        if (packet.getMessage().getHeaders().get(av.messageIDTag, false) == null) {
            if (headers.get(av.messageIDTag, false) == null) {
                Header h = new StringHeader(av.messageIDTag, Message.generateMessageID());
                headers.add(h);
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:AddressingUtils.java

示例5: getReplyTo

import com.sun.xml.internal.ws.api.SOAPVersion; //导入依赖的package包/类
public static WSEndpointReference getReplyTo(@NotNull MessageHeaders headers, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
    if (av == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
    }

    Header h = getFirstHeader(headers, av.replyToTag, true, sv);
    WSEndpointReference replyTo;
    if (h != null) {
        try {
            replyTo = h.readAsEPR(av);
        } catch (XMLStreamException e) {
            throw new WebServiceException(AddressingMessages.REPLY_TO_CANNOT_PARSE(), e);
        }
    } else {
        replyTo = av.anonymousEpr;
    }

    return replyTo;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:AddressingUtils.java

示例6: createServiceResponseForException

import com.sun.xml.internal.ws.api.SOAPVersion; //导入依赖的package包/类
@Override
public Packet createServiceResponseForException(final ThrowableContainerPropertySet tc,
                                                final Packet      responsePacket,
                                                final SOAPVersion soapVersion,
                                                final WSDLPort    wsdlPort,
                                                final SEIModel    seiModel,
                                                final WSBinding   binding)
{
    return wsEndpoint.createServiceResponseForException(tc, responsePacket, soapVersion,
                                                        wsdlPort, seiModel, binding);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:WSEndpointMOMProxy.java

示例7: getAction

import com.sun.xml.internal.ws.api.SOAPVersion; //导入依赖的package包/类
public static String getAction(@NotNull MessageHeaders headers, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
    if (av == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_ADDRESSING_VERSION());
    }

    String action = null;
    Header h = getFirstHeader(headers, av.actionTag, true, sv);
    if (h != null) {
        action = h.getStringContent();
    }

    return action;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:AddressingUtils.java

示例8: Header

import com.sun.xml.internal.ws.api.SOAPVersion; //导入依赖的package包/类
public Header(SOAPVersion soapVersion, ParameterImpl param, ValueSetter setter) {
    this(soapVersion,
        param.getTypeInfo().tagName,
        param.getXMLBridge(),
        setter);
    assert param.getOutBinding()== ParameterBinding.HEADER;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:ResponseBuilder.java

示例9: XmlContent

import com.sun.xml.internal.ws.api.SOAPVersion; //导入依赖的package包/类
public XmlContent(String ct, InputStream in, WSFeatureList f) {
            super(SOAPVersion.SOAP_11);
            dataSource = new XmlDataSource(ct, in);
            this.headerList = new HeaderList(SOAPVersion.SOAP_11);
//            this.binding = binding;
            features = f;
        }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:XMLMessage.java

示例10: init

import com.sun.xml.internal.ws.api.SOAPVersion; //导入依赖的package包/类
private void init(@Nullable MessageHeaders headers, @NotNull AttachmentSet attachmentSet, @NotNull XMLStreamReader reader, @NotNull SOAPVersion 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.get(base);
    this.headerTag = DEFAULT_TAGS.get(base+1);
    this.bodyTag = DEFAULT_TAGS.get(base+2);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:StreamMessage.java

示例11: create

import com.sun.xml.internal.ws.api.SOAPVersion; //导入依赖的package包/类
public static StreamSOAPCodec create(SOAPVersion version) {
    if(version==null)
        // this decoder is for SOAP, not for XML/HTTP
        throw new IllegalArgumentException();
    switch(version) {
        case SOAP_11:
            return new StreamSOAP11Codec();
        case SOAP_12:
            return new StreamSOAP12Codec();
        default:
            throw new AssertionError();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:StreamSOAPCodec.java

示例12: DOMMessage

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

示例13: isIgnorable

import com.sun.xml.internal.ws.api.SOAPVersion; //导入依赖的package包/类
public boolean isIgnorable(@NotNull SOAPVersion soapVersion, @NotNull Set<String> roles) {
    // check mustUnderstand
    String v = getAttribute(soapVersion.nsUri, "mustUnderstand");
    if(v==null || !parseBool(v)) return true;

    if (roles == null) return true;

    // now role
    return !roles.contains(getRole(soapVersion));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:AbstractHeaderImpl.java

示例14: RpcLit

import com.sun.xml.internal.ws.api.SOAPVersion; //导入依赖的package包/类
/**
 * Creates a {@link EndpointResponseMessageBuilder} from a {@link WrapperParameter}.
 */
public RpcLit(WrapperParameter wp, SOAPVersion soapVersion) {
    super(wp, soapVersion);
    // we'll use CompositeStructure to pack requests
    assert wp.getTypeInfo().type==WrapperComposite.class;

    parameterBridges = new XMLBridge[children.size()];
    for( int i=0; i<parameterBridges.length; i++ )
        parameterBridges[i] = children.get(i).getXMLBridge();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:EndpointResponseMessageBuilder.java

示例15: create

import com.sun.xml.internal.ws.api.SOAPVersion; //导入依赖的package包/类
/**
 * Creates a new {@link StreamSOAPCodec} instance using binding
 *
 * @deprecated use {@link #create(WSFeatureList)}
 */
public static StreamSOAPCodec create(WSBinding binding) {
    SOAPVersion version = binding.getSOAPVersion();
    if(version==null)
        // this decoder is for SOAP, not for XML/HTTP
        throw new IllegalArgumentException();
    switch(version) {
        case SOAP_11:
            return new StreamSOAP11Codec(binding);
        case SOAP_12:
            return new StreamSOAP12Codec(binding);
        default:
            throw new AssertionError();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:StreamSOAPCodec.java


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