What is "WebException: The request failed with HTTP status 502: Proxy Error."

Confluence SoapAPI Throws "WebException: The request failed with HTTP status 502: Proxy Error." exception while calling GetAttachmentData() method.

I was trying to get attachments of a wikipage. It was working fine for some attachments but after some moment it gave particualr exception.

WebException: The request failed with HTTP status 502: Proxy Error.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at ConfluenceAPIWebsServiceVersion2.ConfluenceSoapServiceService.getAttachmentData(String in0, Int64 in1, String in2, Int32 in3)
at APIService.ConfluenceService.GetAttachmentData(Int64 id, String attachmentName, Int32 doc

It was the first exception in the loop.
After then for every remaining attachment call it throws

WebException: The request failed with HTTP status 503: Service Temporarily Unavailable.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at Tzunami.Common.EcmConfluenceExporter.ConfluenceAPIWebsServiceVersion2.ConfluenceSoapServiceService.getAttachmentData(String in0, Int64 in1, String in2, Int32 in3)

Please help me on what is the cause and resolution for this issue

1 answer

0 vote
Daniel Eads Community Champion May 11, 2017

Hi Gopal,

I don't have experience personally with the SOAP API as Atlassian depreciated SOAP some time ago and has been trying to get everyone to switch over to REST. While SOAP still works (but is depreciated), it soon will be removed from Confluence. I'd suggest switching over to the REST API. This will hopefully get you past the error, but will make it easier for the community to troubleshoot even if you still see errors.

More information about the REST API: https://developer.atlassian.com/confdev/confluence-server-rest-api

Getting attachments: https://docs.atlassian.com/confluence/REST/latest-server/#content/{id}/child/attachment-getAttachments

Sample API call using curl: https://developer.atlassian.com/confdev/confluence-server-rest-api/confluence-rest-api-examples

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published 5 hours ago in Agile

What is ChatOps? A guide to its evolution, adoption, and significance

I am the product of AIM. I can hear that door swinging open and closed in my mind with absolute fidelity. I’d recognize that ding anywhere. At 15, as I typed away into AOL IM, I never imagined that ...

20 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you