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

Gopal Dahal April 29, 2017

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 votes
Daniel Eads _unmonitored account_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
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
TAGS
AUG Leaders

Atlassian Community Events