Question

Requirement to add endpointURL in http header of Connect SOAP before invoking generic gateway service

I have requirement to add endpointURL in http header of Connect SOAP.    How to do this?

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Correct Answer
July 29, 2015 - 1:47pm

Currently there is no OOTB way to add HTTP headers as part of SOAP connector execution.

Though it is not the recommended approach , customer may override invokeaxis2 to achieve this

The following code snipped would do the job

Options options = new Options(); 

java.util.List list = new java.util.ArrayList();

com.pega.apache.commons.httpclient.Header header = new com.pega.apache.commons.httpclient.Header(); 

//set the header key and value

header.setName("user"); 

header.setValue("admin"); 

list.add(header); 

options.setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_HEADERS, list); 

client.setOptions(options);

Comments

Keep up to date on this post and subscribe to comments

Pega
July 29, 2015 - 1:47pm

Currently there is no OOTB way to add HTTP headers as part of SOAP connector execution.

Though it is not the recommended approach , customer may override invokeaxis2 to achieve this

The following code snipped would do the job

Options options = new Options(); 

java.util.List list = new java.util.ArrayList();

com.pega.apache.commons.httpclient.Header header = new com.pega.apache.commons.httpclient.Header(); 

//set the header key and value

header.setName("user"); 

header.setValue("admin"); 

list.add(header); 

options.setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_HEADERS, list); 

client.setOptions(options);

July 29, 2015 - 2:14pm
Response to DASS1

Thanks Santosh for your reply

I have implemented exactly same soln as workaround last night.   I wanted to ensure that I am not doing unnecessary customization by overriding pega engine activity.

Thanks for your feedback.  Your reply ensures that there is no other way to achieve it at this moment,

Regards

Krishnat

August 17, 2016 - 1:48pm

Hi Folks,

Would this solution be also appilcable to the SOAP Service activity as well? If yes what is the activity to customise?

We intend to pass the SOAPActon as an HTTPHeader from the incoming Service request.

Thanks,
Sunil

August 17, 2016 - 1:48pm

Hi Folks,

Would this solution be also appilcable to the SOAP Service activity as well? If yes what is the activity to customise?

We intend to pass the SOAPActon as an HTTPHeader from the incoming Service request.

Thanks,
Sunil