外部 Web サービスから応答を受信すると、Salesforce はその応答を解析して、提供された Web サービスの WSDL を使用して生成された Apex クラスにシリアライズしようとします。応答の本文は有効な XML ドキュメントであることが想定されています。パーサーは、<soap:Envelope> 要素が Prolog (存在する場合) の後の応答に含まれる最初の XML ノードであると想定するためです。しかし、<soap:Envelope> 要素の前に XML 以外の要素がある場合、パーサーは例外「Failed to get next element.」をスローします。
上記のシナリオでは、応答のフォーマットはマルチパート応答のフォーマットです。最初の行に「--id」、最後の行に「--id--」があり、これらによって、このマルチパート応答の最初かつ唯一の部分が区切られていることがわかります。この応答を解析しようとすると、パーサーは「--id」に遭遇します。そして、この非 XML 要素や後続の行のレスポンスヘッダーの存在を想定していないため失敗します。つまり、現時点ではパーサーはマルチパート応答に対応していないため、マルチパート応答を送信しないように Web サービスを修正することが推奨されます。
11:12:06.213 (1213388226)|CALLOUT_RESPONSE|[111]| --uuid:c71daf0b-eb0d-4aad-a8c3-6890e780e569 Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"; Content-Transfer-Encoding: binary Content-ID: <root.message@cxf.apache.org> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body>...</soap:Body></soap:Envelope> --uuid:c71daf0b-eb0d-4aad-a8c3-6890e780e569-- 11:12:06.213 (1213814277)|EXCEPTION_THROWN|[111]|System.CalloutException:Web service callout failed: Failed to get next element
000387950

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.