【问题标题】:force.com streaming APIforce.com 流媒体 API
【发布时间】:2012-09-20 23:45:17
【问题描述】:

我正在尝试Force.com Streaming API demo,但出现以下错误:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body><soapenv:Fault>
        <faultcode>UNKNOWN_EXCEPTION</faultcode>
        <faultstring>UNKNOWN_EXCEPTION: Element type &quot;soapenv:Envelope&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.   </faultstring>
        <detail>
            <sf:UnexpectedErrorFault xsi:type="sf:UnexpectedErrorFault">   
                <sf:exceptionCode>UNKNOWN_EXCEPTION</sf:exceptionCode>
                <sf:exceptionMessage>Element type &quot;soapenv:Envelope&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.</sf:exceptionMessage>
            </sf:UnexpectedErrorFault>  
        </detail> 
    </soapenv:Fault></soapenv:Body>
</soapenv:Envelope>

【问题讨论】:

    标签: api streaming force.com


    【解决方案1】:

    第 22 行有一个错位的double quote,您的编译器没有捕捉到它。

    替换此代码:

    private static final String ENV_START =
    "
    "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'
             + "xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' " +
             "xmlns:urn='urn:partner.soap.sforce.com'><soapenv:Body>";
    

    使用此代码:

    private static final String ENV_START =
        "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'"
        + "xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' " +
             "xmlns:urn='urn:partner.soap.sforce.com'><soapenv:Body>";
    

    【讨论】:

    • @Thys Andries Michels 你试过我的答案了吗?我建议的这个更改暂时对我有用,但现在看来问题又回来了。在进一步调查此错误之前,我将删除我的答案。
    • 我认为该教程已经过时了。我正在尝试以下教程,如果它有效,我将报告。 wiki.developerforce.com/page/…
    猜你喜欢
    • 2016-02-04
    • 2014-07-15
    • 1970-01-01
    • 2023-03-17
    • 1970-01-01
    • 2013-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多