url stays relative in postrequest_submit

url stays relative in postrequest_submit

  
Hello,
 
I try to post a XML document to a remote webserver with the postrequest_submit method.
In the url property of postrequest_submit  is a full HTTPS:// string  of the remote webserver.
Outsystems returns in debug a 404 and looking at the localwebserver logfiles tells me outsystems made the request relative like /app1/https:/www.google.nl/
 
What am i doing wrong?

Thanx in advance,


Dirk Pol
Hi Dirk,

I was able to preform a test, using Agile Platform 6.0.1.21 and 7.0.0.13, to an external URL (i.g. http://www.ebay.com/) and recieved the correct response.
Can you let us know the error you have in runtime (without the debug)? is it also a 404 error?

Can you access URLs trough HTTP or your errors are only felt with HTTPS?

Best regards,
Renato Gonçalves
Hi Renato,

I have narrowed the problem down to only HTTPS POST.
HTTP Post makes an external request, HTTPS gives a 404 on the local webserver like this:

url in postrequest_submit.url   https://1.2.3.4/cgi-bin/xams.pl

ends up in local logfile of iis as:

2012-09-03 12:32:17 ::1 POST /mdns/https:/1.2.3.4/cgi-bin/xams.pl - 80 - ::1 - 404 0 2 2
 
HTTP post is not giving any problems.
tested on platform 7

Best

Dirk
Hi,

Any fix to do this for https sites? Need to interface with payment provider which uses https endpoint.

regards, Paul
Greetings,
I'm also having the same problem in a server with Version 7.0.1.5.

Making a POST to an HTTPS URI results in having a wrong URI in the request. 
Hi,

This is a bug in the HTTPRequestHandler action MakeAbsoluteURL, which is used transparently by PostRequest_Submit and others.

I'll forward the issue to our maintenance team so an appropriate fix can be done.

Meanwhile, you may open the extension in Integration Studio and use the Edit Source Code option for your stack (.NET or Java) to fix the code.

In .NET, changing the method's code into this should be sufficient:
public void MssMakeAbsoluteURL(string ssURL, out string ssAbsoluteURL) {
    string currentUri;
    MssGetURL(out currentUri);
    ssAbsoluteURL = (new Uri(new Uri(currentUri), ssURL).AbsoluteUri;
}
In Java, you can use
public static ActMakeAbsoluteURL mosMakeAbsoluteURL ( String inParamURL) throws Exception {
    ActMakeAbsoluteURL result = new ActMakeAbsoluteURL();
    result.outParamAbsoluteURL = (new URI(ActGetURL.mosGetURL().outParamURL).resolve(inParamURL.trim())).toString();
    return result;
}

PLEASE NOTE
I haven't yet tested this code and you may have other code in your factory that depends on the current misbehaviors of MakeAbsoluteURL, so you should test that this indeed fixes your problem and that it doesn't introduce new problems on components that rely on HttpRequestHandler's actions.

Cheers,
Miguel
Ok, thank you for the reply. I'll try your code.

Thanks
João
Hi,

I took the ardoHTTP extension and refactored it for OS 6.x ;-) Works perfect !

When the standard OS extensions are fixed, will probably switch back to using these extensions.

regards, Paul