• Anthony Lincoln
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

In the following SF class code:

 

//2. make webservice call to create Rally Attachment
req.setEndpoint(RallyURL+':443/slm/webservice/1.26/attachmentcontent/create');
req.setMethod('POST');

req.setHeader('Authorization', authorizationHeader);
req.setHeader('Content-Type','text/xml');

String body;
body = '{"Content":"'+EncodingUtil.base64Encode(att.Body)+'"}';

req.setBody(body);

//send the request
res = http.send(req);
System.debug('***res1: ' + res.getBody());

 

 

I am getting the following error on response:

 

09:49:09.411 (1411487000)|USER_DEBUG|[79]|DEBUG|***res1: <?xml version="1.0" encoding="UTF-8"?>
<CreateResult rallyAPIMajor="1" rallyAPIMinor="26">
<Errors>
<OperationResultError>Cannot parse input stream as XML document: Error on line 1: Content is not allowed in prolog.</OperationResultError>
</Errors>
<Warnings />
</CreateResult>


Can you please assist me?