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


Java SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI属性代码示例

本文整理汇总了Java中org.apache.axiom.soap.SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI属性的典型用法代码示例。如果您正苦于以下问题:Java SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI属性的具体用法?Java SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI怎么用?Java SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.axiom.soap.SOAP12Constants的用法示例。


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

示例1: getDocumentFromSOAPEnvelope

/**
 * Create a DOM Document using the org.apache.axiom.soap.SOAPEnvelope
 *
 * @param env An org.apache.axiom.soap.SOAPEnvelope instance
 * @return the DOM Document of the given SOAP Envelope
 */
public static Document getDocumentFromSOAPEnvelope(org.apache.axiom.soap.SOAPEnvelope env) {
    env.build();

    //Check the namespace and find SOAP version and factory
    String nsURI;
    SOAPFactory factory;
    if (env.getNamespace().getNamespaceURI()
            .equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
        nsURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
        factory = DOOMAbstractFactory.getSOAP11Factory();
    } else {
        nsURI = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI;
        factory = DOOMAbstractFactory.getSOAP12Factory();
    }

    StAXSOAPModelBuilder stAXSOAPModelBuilder =
            new StAXSOAPModelBuilder(env.getXMLStreamReader(), factory, nsURI);
    SOAPEnvelope envelope = (stAXSOAPModelBuilder).getSOAPEnvelope();
    envelope.build();

    Element envElem = (Element)envelope;
    return envElem.getOwnerDocument();
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:29,代码来源:SAAJUtil.java

示例2: toDOOMSOAPEnvelope

/**
 * Create a DOM Document using the org.apache.axiom.soap.SOAPEnvelope
 *
 * @param env An org.apache.axiom.soap.SOAPEnvelope instance
 * @return the org.apache.axis2.soap.impl.dom.SOAPEnvelopeImpl of the given SOAP Envelope
 */
public static org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl
        toDOOMSOAPEnvelope(org.apache.axiom.soap.SOAPEnvelope env) {
    env.build();

    //Check the namespace and find SOAP version and factory
    String nsURI;
    SOAPFactory factory;
    if (env.getNamespace().getNamespaceURI()
            .equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
        nsURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
        factory = DOOMAbstractFactory.getSOAP11Factory();
    } else {
        nsURI = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI;
        factory = DOOMAbstractFactory.getSOAP11Factory();
    }

    StAXSOAPModelBuilder stAXSOAPModelBuilder =
            new StAXSOAPModelBuilder(env.getXMLStreamReader(), factory, nsURI);
    SOAPEnvelope envelope = (stAXSOAPModelBuilder).getSOAPEnvelope();
    envelope.build();

    return (org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl)envelope;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:29,代码来源:SAAJUtil.java

示例3: getEnvelopeNamespace

public static String getEnvelopeNamespace(String contentType) {
    String soapNS = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
    if (contentType != null) {
        if (contentType.indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1) {
            // it is SOAP 1.2
            soapNS = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI;
        } else if (contentType.indexOf(SOAP11Constants.SOAP_11_CONTENT_TYPE) > -1) {
            // SOAP 1.1
            soapNS = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
        }
    }
    return soapNS;
}
 
开发者ID:wso2-attic,项目名称:carbon-gateway-framework,代码行数:13,代码来源:XMLUtil.java

示例4: processSoapAttachments

private static void processSoapAttachments(String identifier,
                                           List policyComponents, AxisService service) {
    Map map = service.getEndpoints();
    String soapVersion =
            (identifier.indexOf("soap12") > -1) ? SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI
                    : SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;

    for (Object o : map.values()) {
        AxisEndpoint axisEndpoint = (AxisEndpoint)o;
        AxisBinding axisBinding = axisEndpoint.getBinding();
        String wsoap = (String)axisBinding
                .getProperty(WSDL2Constants.ATTR_WSOAP_VERSION);
        if (soapVersion.equals(wsoap)) {
            String[] identifiers = identifier.split("/");
            int key = identifiers.length;
            if (key == 1) {
                axisBinding.getPolicySubject().attachPolicyComponents(
                        policyComponents);
            } else if (key == 2 || key == 3) {
                String opName = identifiers[1];
                opName = opName.substring(opName.indexOf(":") + 1, opName
                        .length());
                AxisBindingOperation bindingOperation = null;
                boolean found = false;
                for (Iterator i = axisBinding.getChildren(); i.hasNext();) {
                    bindingOperation = (AxisBindingOperation)i.next();
                    if (opName.equals(bindingOperation.getName()
                            .getLocalPart())) {
                        found = true;
                        break;
                    }
                }
                if (!found) {
                    throw new IllegalArgumentException(
                            "Invalid binding operation " + opName);
                }

                if (key == 2) {
                    bindingOperation.getPolicySubject()
                            .attachPolicyComponents(policyComponents);
                } else {
                    if ("in".equals(identifiers[2])) {
                        AxisBindingMessage bindingInMessage =
                                (AxisBindingMessage)bindingOperation
                                        .getChild(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                        bindingInMessage.getPolicySubject()
                                .attachPolicyComponents(policyComponents);

                    } else if ("out".equals(identifiers[2])) {
                        AxisBindingMessage bindingOutMessage =
                                (AxisBindingMessage)bindingOperation
                                        .getChild(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
                        bindingOutMessage.getPolicySubject()
                                .attachPolicyComponents(policyComponents);
                    } else {
                        // FIXME faults
                    }
                }
            }
            break;
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:63,代码来源:Utils.java

示例5: getSOAPNamespaceFromContentType

/**
 * @param contentType          The contentType of the incoming message.  It may be null
 * @param defaultSOAPNamespace Usually set the version that is expected.  This a fallback if the contentType is unavailable or
 *                             does not match our expectations
 * @return null or the soap namespace.  A null indicates that the message will be interpretted as a non-SOAP (i.e. REST) message
 */
private static String getSOAPNamespaceFromContentType(String contentType,
                                                      String defaultSOAPNamespace) {

    String returnNS = defaultSOAPNamespace;
    // Discriminate using the content Type
    if (contentType != null) {

        /*
        * SOAP11 content-type is "text/xml"
        * SOAP12 content-type is "application/soap+xml"
        *
        * What about other content-types?
        *
        * TODO: I'm not fully convinced this method is complete, given the media types
        * listed in HTTPConstants.  Should we assume all application/* is SOAP12?
        * Should we assume all text/* is SOAP11?
        *
        * So, we'll follow this pattern:
        * 1)  find the content-type main setting
        * 2)  if (1) not understood, find the "type=" param
        * Thilina: I merged (1) & (2)
        */

        if (JavaUtils.indexOfIgnoreCase(contentType, SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1)
        {
            returnNS = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI;
        }
        // search for "type=text/xml"
        else
        if (JavaUtils.indexOfIgnoreCase(contentType, SOAP11Constants.SOAP_11_CONTENT_TYPE) > -1)
        {
            returnNS = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
        }
    }

    if (returnNS == null) {
        if (log.isDebugEnabled()) {
            log.debug("No content-type or \"type=\" parameter was found in the content-type " +
                    "header and no default was specified, thus defaulting to SOAP 1.1.");
        }
        returnNS = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
    }

    if (log.isDebugEnabled()) {
        log.debug("content-type: " + contentType);
        log.debug("defaultSOAPNamespace: " + defaultSOAPNamespace);
        log.debug("Returned namespace: " + returnNS);
    }
    return returnNS;

}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:57,代码来源:TransportUtils.java


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