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


Java HTTPConstants.MEDIA_TYPE_APPLICATION_XML属性代码示例

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


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

示例1: inferContentType

private String inferContentType(String httpVerb) {
    if (httpVerb.trim().equals("GET") || httpVerb.trim().equals("DELETE")) {
        return HTTPConstants.MEDIA_TYPE_X_WWW_FORM;
    }

    return HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:7,代码来源:HTTPBindingHandler.java

示例2: getContentType

public static String getContentType(String contentType, MessageContext msgContext) {
    String type;
    int index = contentType.indexOf(';');
    if (index > 0) {
        type = contentType.substring(0, index);
    } else {
        int commaIndex = contentType.indexOf(',');
        if (commaIndex > 0) {
            type = contentType.substring(0, commaIndex);
        } else {
            type = contentType;
        }
    }
    // Some services send REST responces as text/xml. We should convert it to
    // application/xml if its a REST response, if not it will try to use the SOAPMessageBuilder.
    // isDoingREST should already be properly set by HTTPTransportUtils.initializeMessageContext
    if (msgContext.isDoingREST() && HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
        if (msgContext.isServerSide()) {
            if (msgContext.getSoapAction() == null) {
            	// TODO - remove this logic.
                // type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
            }
        } else if (!msgContext.isPropertyTrue(Constants.Configuration.SOAP_RESPONSE_MEP)) {
            type = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
        }
    }
    return type;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:28,代码来源:TransportUtils.java

示例3: getContentTypeForBuilderSelection

private static String getContentTypeForBuilderSelection(String type, MessageContext msgContext) {
    /**
     * Handle special case where content-type : text/xml and SOAPAction = null consider as
     * POX (REST) message not SOAP 1.1.
     *
     * it's required use the Builder associate with "application/xml" here but should not
     * change content type of current message.
     *
     */
    String cType = type;
    if (msgContext.getSoapAction() == null && HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type) && msgContext.isDoingREST()) {
        cType = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
    }
    return cType;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:15,代码来源:MessageProcessorSelector.java

示例4: getContentTypeForFormatterSelection

private static String getContentTypeForFormatterSelection(String type, MessageContext msgContext) {
    /**
     * Handle special case where content-type : text/xml and SOAPAction = null consider as
     * POX (REST) message not SOAP 1.1.
     *
     * 1.) it's required use the Builder associate with "application/xml" here but should not
     * change content type of current message.
     */
    String cType = type;
    if (msgContext.isDoingREST() && HTTPConstants.MEDIA_TYPE_TEXT_XML.equals(type)) {
        cType = HTTPConstants.MEDIA_TYPE_APPLICATION_XML;
        msgContext.setProperty(Constants.Configuration.CONTENT_TYPE, HTTPConstants.MEDIA_TYPE_TEXT_XML);
    }
    return cType;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:15,代码来源:MessageProcessorSelector.java


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