CallbackPrefix including port number after Port Rerouting

This post has 11 replies

Not Ranked
Posts: 1
jlaf Posted: Mon Aug 14, 2006 @ 1:31 PM
I am having a problem with how ComponentArt generates the CallbackPrefix...

We only accepted external web requests over port 80.

However, once a request enters the server we reroute it internally to different, specific ports depending on the request header (Ex. port 8085)

The problem is this... when ComponentArt generates a CallbackPrefix it includes the internal port number we are using and not the original external URL.

Since we only accept requests over port 80 all of these callbacks which refer to internal port numbers (ex. 8085) do not work.

Is there an way we can parse out the port, override the callbackprefix or disable the port numbers that are being incorrectly included in the CallbackPrefix?

Any and all help is appreciated :)
Not Ranked
Posts: 1
Mike1969 Posted: Fri Sep 22, 2006 @ 6:06 AM
Hi,

We have exactly the same pb for our test plateform and have no other option but to put client mode instead of callback mode!

Did you manage to resolve it ?

Thx
Top 500 Contributor
Posts: 23
JBenson Posted: Wed Feb 13, 2008 @ 3:13 PM
Has there been anything done on this?

I am having issues when port 8902 is being translated to port 80 on the inside of the firewall
Top 10 Contributor
Posts: 6,424
hwan Posted: Thu Feb 28, 2008 @ 3:28 PM
Have you tried changing the CallbackPrefix? Note that you can do this dynamically on the client.

Something like:
<script>
	function CallBack1_onLoad(sender, e)
	{
		var newPrefix = "http:/" + location.pathname;

		newPrefix.replace("8902", "80");

		sender.CallbackPrefix = newPrefix;
	}
</script>
....
<ComponentArt:CallBack id="CallBack1" runat="server" .... >
	<clientevents>
		<load eventhandler="CallBack1_onLoad" />
	</clientevents>
	....
Not Ranked
Posts: 9
imsiddiqui Posted: Thu Jun 5, 2008 @ 6:51 AM
We are having the exact same issue with our hosted web application. Considering that port forwarding is very common for 3rd party hosting solution providers, I think this issue requires special attention by ComponentArt.
By sending the internal web server port number down to client, this is actually breaking security walls. Also, with client browser accessing things over port 80 and CA callback trying to access some other port, it could give permission denied problems as well (depending on browser's security level)!

The solution given above isn't generic hence cannot be easily deployed across all the pages without manual effort.

Isn't there a better way of doing that? What if my clients are actually accessing the internal web server directly (i.e. www.mysite.com:8092) with no firewall/port forwarding in between?

I will be glad to see a quick solution that can be applied across all pages of a large web application seamlessly, without much manual coding efforts!
Top 10 Contributor
Posts: 6,424
hwan Posted: Thu Jun 5, 2008 @ 1:28 PM
Do one of these approaches apply to you?
<code>
function CallBack1_onLoad(sender, e)
{
var oldPrefix = sender.CallbackPrefix;
var newPrefix = document.location.href;

// alert(oldPrefix + "\n" + newPrefix);
sender.CallbackPrefix = newPrefix;
}
</code>
Or even simpler:
<code>
function CallBack1_onLoad(sender, e)
{
var oldPrefix = sender.CallbackPrefix;
var newPrefix = oldPrefix.replace("http:", "https:");

// alert(oldPrefix + "\n" + newPrefix);
sender.CallbackPrefix = newPrefix;
}
</code>
You can uncomment the alert to verify that the newPrefix matches the path that should be used.
Not Ranked
Posts: 9
imsiddiqui Posted: Thu Jun 5, 2008 @ 10:14 PM
I'm sorry; I think I haven't explained it enough!

By generic solution, I meant one that I can apply in one place that could change the behaviour of all the callback controls across all the pages (sort of a 'framework' change).

For example, once the page is downloaded to client, can I not write some JavaScript page Load code that finds if there are any callback controls on the page, and if there are, changes there callback prefix property appropriately?
OR
Can I not write an HttpModule (or a base http handler for all pages in my app) that overwrites the view state variable that holds the web server port number with correct port number (I am assuming that CA callback constructs the url by reading port number from view state)?

And obviously I do NOT want to do any changes in CA source code at this point!
Not Ranked
Posts: 1
bmitty Posted: Fri Oct 30, 2009 @ 8:13 AM
I realize this thread is over a year old, but I am having a similar issue. I am completely unfamiliar with your product. I see your suggestion above, however, when I try to set the load eventhandler as shown above, the only properties that appear under the Callback control is LoadingPanelClientTemplate. I do not get Content or clientevents through Intellisense. Can you tell me what might be causing this? One last question, I assume the Grid needs to be inside the Content tags of the Callback control. Am I correct? Thanks for your help, Matt
Not Ranked
Posts: 6
ldentella Posted: Wed Jun 15, 2011 @ 8:47 AM
Hey Hwan,
I have the same problem with ComboBox control.  
Is there a property usable for ComboBox, like CallBackprefix for CallBack ?
Thanks in advance.
Top 10 Contributor
Posts: 6,149
stephen Posted: Wed Jun 15, 2011 @ 11:35 AM

I just responded to your other post here  with regards to the combobox. I hope this helps. 

Stephen Hatcher, Developer Support Manager
ssecor@virtualpremise.com Posted: Tue Jul 26, 2011 @ 8:03 AM
I am trying to apply this same fix to our application but am receiving the following error.


Type 'ComponentArt.Web.UI.CallBack' does not have a public property named 'clientevents'.


Can someone please explain why Component art this ClientEvents is invalid?

Thanks,

Scott Secor
Top 10 Contributor
Posts: 6,149
stephen Posted: Thu Aug 4, 2011 @ 7:07 AM

It would be invalid in an extremely old (pre 2006 version); other than that it sounds like it could be a syntax error. Can you post your code so we can see what you're doing? What version are you using? 

Stephen Hatcher, Developer Support Manager
Page 1 of 1 (12 items)