Getting only partial response for Salesforce API using service callout

Not applicable

Hi,

I am trying query salesforce API using service callout policy. I am getting only the partial response from salesforce . But when I call the salesforce API from SOAP UI, I am able to get complete response.

Here is the code for ServiceCallout:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout name="Call Salesforce API" enabled="true" continueOnError="false" async="false">
    <DisplayName>Call Salesforce API</DisplayName>
    <Properties/>
    <Request>
        <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
        <Set>
            <Headers>
                <Header name="Allow">GET, PUT, POST, DELETE</Header>
                <Header name="SOAPAction">Query</Header>
                <Header name="contentType">application/xml</Header>
                <Header name="contentLength">999999999999</Header>
            </Headers>
            <Payload contentType="application/xml">
                <!-- Payload here -->
            </Payload>
            <Verb>POST</Verb>
        </Set>
    </Request>
    <Response>calloutResponse</Response>
    <HTTPTargetConnection>
        <Properties>
            <Property name="use.proxy">false</Property>
        </Properties>
        <URL>salesforce url here</URL>
    </HTTPTargetConnection>
</ServiceCallout>

Please suggest?

Solved Solved
1 9 924
1 ACCEPTED SOLUTION

@Julie Joseph ,

At last, found the solution for your issue,

Use ,

<Payload contentType="text/xml">{calloutResponse.content}</Payload>

Instead of ,

<Payload contentType="text/xml">{ServiceCallout.response}</Payload>

@docs , We need to update service callout policy with details. @arghya das Any reason why two different flow variables we have which leads to above error if content length is missing in response from service callout ?

View solution in original post

9 REPLIES 9

@Julie Joseph , Welcome to Apigee Community.

Are you saying partial response based on trace output ? It always shows partial if response size is too big, but flow variable includes full response. If that is the case, Please check similar article here. Keep Us Posted.

Thanks Anil. The partial response is not only on trace output. I tried to send it as the response for the API proxy. Then also, I could see only truncated soap(xml) response in the output

Anil, My intension is to query Salesforce API using Apigee. The request to SFDc is soap and it is provided in Payload of service callout. The response is also a soap message. My API Proxy has a service callout policy and assign message policy. In the service call out policy, I give the query to fetch salesforce records. In the assign message, I am assigning the response from salesforce. When I query salesforce from SoapUI, by giving soap message in payload, I am getting complete response in SOAP UI Here is the assign message code: Send Response{ServiceCallout.response} name true

@Julie

Need full API details & Proxy details to understand the issue, If you think it's confidential, PM me your org name & proxy name using Ask An Expert button in right sidebar.

@Julie , As far as we understand , service callout response will return full response. Without more details i am afraid, it's difficult to findout what exactly is the issue in your case. As i said in my previous comment, "Need full API details & Proxy details to understand the issue, If you think it's confidential, PM me your org name & proxy name using Ask An Expert button in right sidebar."

Not applicable
querysfdclatest.zip@Anil Sagar

Please find attached bundle

@Julie Joseph ,

I see attached Assign Message policy is modifying request instead of response. Ideally, it has to be in the response pipeline & AssignTo should be response not request. Please check.

@Julie Joseph ,

At last, found the solution for your issue,

Use ,

<Payload contentType="text/xml">{calloutResponse.content}</Payload>

Instead of ,

<Payload contentType="text/xml">{ServiceCallout.response}</Payload>

@docs , We need to update service callout policy with details. @arghya das Any reason why two different flow variables we have which leads to above error if content length is missing in response from service callout ?

Thank you for tracking that down, @Anil Sagar! Docs are updated.

Awesome, Thank you @Floyd Jones