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


Java SOAPVersion.SOAP_11属性代码示例

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


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

示例1: getFaultMessage

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,代码行数:7,代码来源:VersionMismatchException.java

示例2: create

/**
 * Creates a fault {@link Message} that captures the code/subcode/subsubcode
 * defined by WS-Addressing if wsa:Action is not supported.
 *
 * @param unsupportedAction The unsupported Action. Must not be null.
 * @param av The WS-Addressing version of the message. Must not be null.
 * @param sv The SOAP Version of the message. Must not be null.
 *
 * @return
 *      A message representing SOAPFault that contains the WS-Addressing code/subcode/subsubcode.
 */
public static Message create(@NotNull String unsupportedAction, @NotNull AddressingVersion av, @NotNull SOAPVersion sv) {
    QName subcode = av.actionNotSupportedTag;
    String faultstring = String.format(av.actionNotSupportedText, unsupportedAction);

    Message faultMessage;
    SOAPFault fault;
    try {
        if (sv == SOAPVersion.SOAP_12) {
            fault = SOAPVersion.SOAP_12.getSOAPFactory().createFault();
            fault.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT);
            fault.appendFaultSubcode(subcode);
            Detail detail = fault.addDetail();
            SOAPElement se = detail.addChildElement(av.problemActionTag);
            se = se.addChildElement(av.actionTag);
            se.addTextNode(unsupportedAction);
        } else {
            fault = SOAPVersion.SOAP_11.getSOAPFactory().createFault();
            fault.setFaultCode(subcode);
        }
        fault.setFaultString(faultstring);

        faultMessage = SOAPFaultBuilder.createSOAPFaultMessage(sv, fault);
        if (sv == SOAPVersion.SOAP_11) {
            faultMessage.getHeaders().add(new ProblemActionHeader(unsupportedAction, av));
        }
    } catch (SOAPException e) {
        throw new WebServiceException(e);
    }

    return faultMessage;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:42,代码来源:Messages.java

示例3: getEffectiveSOAPVersion

private SOAPVersion getEffectiveSOAPVersion(WSBinding binding) {
    SOAPVersion mySOAPVersion = (soapVersion != null) ? soapVersion : binding.getSOAPVersion();
    if (mySOAPVersion == null) {
        mySOAPVersion = SOAPVersion.SOAP_11;
    }
    return mySOAPVersion;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:HeaderList.java

示例4: XmlContent

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,代码行数:7,代码来源:XMLMessage.java

示例5: XMLMultiPart

public XMLMultiPart(final String contentType, final InputStream is, WSFeatureList f) {
    super(SOAPVersion.SOAP_11);
    headerList = new HeaderList(SOAPVersion.SOAP_11);
    dataSource = createDataSource(contentType, is);
    this.feature = f.get(StreamingAttachmentFeature.class);
    this.features = f;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:XMLMessage.java

示例6: testResetDefaultNamespaceSAAJ

@Test
public void testResetDefaultNamespaceSAAJ() throws Exception {
    // Create SOAP message from XML string and process it with SAAJ reader
    XMLStreamReader envelope = XMLInputFactory.newFactory().createXMLStreamReader(
            new StringReader(INPUT_SOAP_MESSAGE));
    StreamMessage streamMessage = new StreamMessage(SOAPVersion.SOAP_11,
            envelope, null);
    SAAJFactory saajFact = new SAAJFactory();
    SOAPMessage soapMessage = saajFact.readAsSOAPMessage(SOAPVersion.SOAP_11, streamMessage);

    // Check if constructed object model meets local names and namespace expectations
    SOAPElement request = (SOAPElement) soapMessage.getSOAPBody().getFirstChild();
    // Check top body element name
    Assert.assertEquals(request.getLocalName(), "SampleServiceRequest");
    // Check top body element namespace
    Assert.assertEquals(request.getNamespaceURI(), TEST_NS);
    SOAPElement params = (SOAPElement) request.getFirstChild();
    // Check first child name
    Assert.assertEquals(params.getLocalName(), "RequestParams");
    // Check if first child namespace is null
    Assert.assertNull(params.getNamespaceURI());

    // Check inner elements of the first child
    SOAPElement param1 = (SOAPElement) params.getFirstChild();
    Assert.assertEquals(param1.getLocalName(), "Param1");
    Assert.assertNull(param1.getNamespaceURI());
    SOAPElement param2 = (SOAPElement) params.getChildNodes().item(1);
    Assert.assertEquals(param2.getLocalName(), "Param2");
    Assert.assertNull(param2.getNamespaceURI());
    // Check full content of SOAP body
    Assert.assertEquals(nodeToText(request), EXPECTED_RESULT);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:32,代码来源:SaajEmptyNamespaceTest.java

示例7: fillRequestAddressingHeaders

public static void fillRequestAddressingHeaders(MessageHeaders headers, WSDLPort wsdlPort, WSBinding binding, Packet packet) {
    if (binding == null) {
        throw new IllegalArgumentException(AddressingMessages.NULL_BINDING());
    }

    if (binding.isFeatureEnabled(SuppressAutomaticWSARequestHeadersFeature.class)) {
        return;
    }

    //See if WSA headers are already set by the user.
    MessageHeaders hl = packet.getMessage().getHeaders();
    String action = AddressingUtils.getAction(hl, binding.getAddressingVersion(), binding.getSOAPVersion());
    if (action != null) {
        //assume that all the WSA headers are set by the user
        return;
    }
    AddressingVersion addressingVersion = binding.getAddressingVersion();
    //seiModel is passed as null as it is not needed.
    WsaTubeHelper wsaHelper = addressingVersion.getWsaHelper(wsdlPort, null, binding);

    // wsa:Action
    String effectiveInputAction = wsaHelper.getEffectiveInputAction(packet);
    if (effectiveInputAction == null || effectiveInputAction.equals("") && binding.getSOAPVersion() == SOAPVersion.SOAP_11) {
        throw new WebServiceException(ClientMessages.INVALID_SOAP_ACTION());
    }
    boolean oneway = !packet.expectReply;
    if (wsdlPort != null) {
        // if WSDL has <wsaw:Anonymous>prohibited</wsaw:Anonymous>, then throw an error
        // as anonymous ReplyTo MUST NOT be added in that case. BindingProvider need to
        // disable AddressingFeature and MemberSubmissionAddressingFeature and hand-craft
        // the SOAP message with non-anonymous ReplyTo/FaultTo.
        if (!oneway && packet.getMessage() != null && packet.getWSDLOperation() != null) {
            WSDLBoundOperation wbo = wsdlPort.getBinding().get(packet.getWSDLOperation());
            if (wbo != null && wbo.getAnonymous() == WSDLBoundOperation.ANONYMOUS.prohibited) {
                throw new WebServiceException(AddressingMessages.WSAW_ANONYMOUS_PROHIBITED());
            }
        }
    }

    OneWayFeature oneWayFeature = binding.getFeature(OneWayFeature.class);
    final AddressingPropertySet addressingPropertySet = packet.getSatellite(AddressingPropertySet.class);
    oneWayFeature = addressingPropertySet == null ? oneWayFeature : new OneWayFeature(addressingPropertySet, addressingVersion);

    if (oneWayFeature == null || !oneWayFeature.isEnabled()) {
        // standard oneway
        fillRequestAddressingHeaders(headers, packet, addressingVersion, binding.getSOAPVersion(), oneway, effectiveInputAction, AddressingVersion.isRequired(binding));
    } else {
        // custom oneway
        fillRequestAddressingHeaders(headers, packet, addressingVersion, binding.getSOAPVersion(), oneWayFeature, oneway, effectiveInputAction);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:51,代码来源:AddressingUtils.java

示例8: FastInfosetStreamSOAP11Codec

FastInfosetStreamSOAP11Codec(StreamSOAPCodec soapCodec, boolean retainState) {
    super(soapCodec, SOAPVersion.SOAP_11, retainState,
            (retainState) ? FastInfosetMIMETypes.STATEFUL_SOAP_11 : FastInfosetMIMETypes.SOAP_11);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:FastInfosetStreamSOAP11Codec.java

示例9: StreamSOAP11Codec

StreamSOAP11Codec() {
    super(SOAPVersion.SOAP_11);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:3,代码来源:StreamSOAP11Codec.java

示例10: create

public static Message create(Exception e) {
    return new FaultMessage(SOAPVersion.SOAP_11);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:3,代码来源:XMLMessage.java

示例11: UnknownContent

public UnknownContent(DataSource ds) {
    super(SOAPVersion.SOAP_11);
    this.ds = ds;
    this.headerList = new HeaderList(SOAPVersion.SOAP_11);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:XMLMessage.java

示例12: XMLHTTPBindingCodec

public XMLHTTPBindingCodec(WSFeatureList f) {
    super(SOAPVersion.SOAP_11, f);

    xmlCodec = new XMLCodec(f);

    fiCodec = getFICodec();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:7,代码来源:XMLHTTPBindingCodec.java


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