Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC4J-604 Suppress EclWatch redirects #711

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ protected Integer getStubConnectionTO() throws AxisFault
final static UsernamePasswordCredentials emptyCreds = new UsernamePasswordCredentials("", null);

/**
* Sets the stub options defaults preemptiveauth to 'true;
* Sets the stub options defaults preemptiveauth to 'true';
*
* @param thestub
* The Axis generated service stub
Expand All @@ -573,7 +573,12 @@ protected Integer getStubConnectionTO() throws AxisFault
*/
static public Stub setStubOptions(Stub thestub, Connection connection) throws AxisFault
{
//Add "rawxml_" query param to request ESP to suppress any default redirects
Options opt = thestub._getServiceClient().getOptions();
EndpointReference toRef = opt.getTo();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets add a comment why we are adding the rawxml_ query param here.

String toAddress = toRef.getAddress() + (toRef.getAddress().contains("?") ? "&" : "?") + "rawxml_";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rpastrana I looked around to see if there was a different way to set a query parameter in Axis2, but wasn't able to find another method. However, I do wonder if we should be using the URL & URI classes here to add the query param instead of doing it manually.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered URL, but you were in the midst of removing URL from our project.
At this point, it doesn't seem worthwhile to introduce URL here to add a query param

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked into the URL/URI classes since I'm adding the comment your suggested, but didn't find any convenient methods allowing us to easily add a query param

toRef.setAddress(toAddress);
opt.setTo(toRef);

opt.setProperty(HTTPConstants.SO_TIMEOUT, connection.getSocketTimeoutMilli());
opt.setProperty(HTTPConstants.CONNECTION_TIMEOUT, connection.getConnectTimeoutMilli());
Expand Down
Loading