473,387 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Creating a proxy...

Here's the scenario. This is going to live in SharePoint, but it's an ASP/HTML issue I think. I need to be able to host an existing portlet in a sharepoint window. The trick is that I need to include some custom http headers in each request to the portlet app.

So, the initial request is easy... Just add the headers and make the request. But as the response comes back in, I need to look through it and see if any of the links are requests back to the portlet app. Those I need to intercept and add the custom headers to.

So as the response comes in, I can replace the href's in the stream, but what do I replace them with? What can I put int their place so that it maintains it look and feel as a hyperlink to the user, but will trigger a server side function call where I can add the custom headers in?

Any thoughts are greatly appreciated.

J
Nov 10 '06 #1
6 8589
you update the links to go thru your proxy.

ex:

<a href="http://microsoft.com">click</a>

becomes:

<a href="urlredir?http%3A//microsoft.com">click</a>

where urlredir is you remapper

-- bruce (sqlwork.com)
<rl*****@newsgroups.nospamwrote in message news:%2****************@TK2MSFTNGP04.phx.gbl...
Here's the scenario. This is going to live in SharePoint, but it's an ASP/HTML issue I think. I need to be able to host an existing portlet in a sharepoint window. The trick is that I need to include some custom http headers in each request to the portlet app.

So, the initial request is easy... Just add the headers and make the request. But as the response comes back in, I need to look through it and see if any of the links are requests back to the portlet app. Those I need to intercept and add the custom headers to.

So as the response comes in, I can replace the href's in the stream, but what do I replace them with? What can I put int their place so that it maintains it look and feel as a hyperlink to the user, but will trigger a server side function call where I can add the custom headers in?

Any thoughts are greatly appreciated.

J
Nov 10 '06 #2
I underestand that... But I don't have a separate web service or anything that is the proxy. The web control itself is the proxy. So how do I tell it to trigger a server side function in the web control? And still present as a hyperlink to the user?

Does that make sense?
"bruce barker (sqlwork.com)" <b_*************************@sqlwork.comwrote in message news:ef**************@TK2MSFTNGP03.phx.gbl...
you update the links to go thru your proxy.

ex:

<a href="http://microsoft.com">click</a>

becomes:

<a href="urlredir?http%3A//microsoft.com">click</a>

where urlredir is you remapper

-- bruce (sqlwork.com)
<rl*****@newsgroups.nospamwrote in message news:%2****************@TK2MSFTNGP04.phx.gbl...
Here's the scenario. This is going to live in SharePoint, but it's an ASP/HTML issue I think. I need to be able to host an existing portlet in a sharepoint window. The trick is that I need to include some custom http headers in each request to the portlet app.

So, the initial request is easy... Just add the headers and make the request. But as the response comes back in, I need to look through it and see if any of the links are requests back to the portlet app. Those I need to intercept and add the custom headers to.

So as the response comes in, I can replace the href's in the stream, but what do I replace them with? What can I put int their place so that it maintains it look and feel as a hyperlink to the user, but will trigger a server side function call where I can add the custom headers in?

Any thoughts are greatly appreciated.

J
Nov 10 '06 #3
when they click on the link, it goes to your site for processing, then your site responds with a rediect to the real site, like any ad redirector.

-- bruce (sqlwork.com)
<rl*****@newsgroups.nospamwrote in message news:u7**************@TK2MSFTNGP02.phx.gbl...
I underestand that... But I don't have a separate web service or anything that is the proxy. The web control itself is the proxy. So how do I tell it to trigger a server side function in the web control? And still present as a hyperlink to the user?

Does that make sense?
"bruce barker (sqlwork.com)" <b_*************************@sqlwork.comwrote in message news:ef**************@TK2MSFTNGP03.phx.gbl...
you update the links to go thru your proxy.

ex:

<a href="http://microsoft.com">click</a>

becomes:

<a href="urlredir?http%3A//microsoft.com">click</a>

where urlredir is you remapper

-- bruce (sqlwork.com)
<rl*****@newsgroups.nospamwrote in message news:%2****************@TK2MSFTNGP04.phx.gbl...
Here's the scenario. This is going to live in SharePoint, but it's an ASP/HTML issue I think. I need to be able to host an existing portlet in a sharepoint window. The trick is that I need to include some custom http headers in each request to the portlet app.

So, the initial request is easy... Just add the headers and make the request. But as the response comes back in, I need to look through it and see if any of the links are requests back to the portlet app. Those I need to intercept and add the custom headers to.

So as the response comes in, I can replace the href's in the stream, but what do I replace them with? What can I put int their place so that it maintains it look and feel as a hyperlink to the user, but will trigger a server side function call where I can add the custom headers in?

Any thoughts are greatly appreciated.

J
Nov 10 '06 #4
The thing is, there is no site... It's a web part in a SharePoint page. The link needs to trigger a server side event within the web part. Either I'm missing something in the way you're suggesting I implement, or I'm not explaining it well enough.

I don't have a URL that I can redirect to. This is all happening within a control on a web page. The hosting web page can't be part of the process. Does that make sense?
"bruce barker (sqlwork.com)" <b_*************************@sqlwork.comwrote in message news:e7**************@TK2MSFTNGP04.phx.gbl...
when they click on the link, it goes to your site for processing, then your site responds with a rediect to the real site, like any ad redirector.

-- bruce (sqlwork.com)
<rl*****@newsgroups.nospamwrote in message news:u7**************@TK2MSFTNGP02.phx.gbl...
I underestand that... But I don't have a separate web service or anything that is the proxy. The web control itself is the proxy. So how do I tell it to trigger a server side function in the web control? And still present as a hyperlink to the user?

Does that make sense?
"bruce barker (sqlwork.com)" <b_*************************@sqlwork.comwrote in message news:ef**************@TK2MSFTNGP03.phx.gbl...
you update the links to go thru your proxy.

ex:

<a href="http://microsoft.com">click</a>

becomes:

<a href="urlredir?http%3A//microsoft.com">click</a>

where urlredir is you remapper

-- bruce (sqlwork.com)
<rl*****@newsgroups.nospamwrote in message news:%2****************@TK2MSFTNGP04.phx.gbl...
Here's the scenario. This is going to live in SharePoint, but it's an ASP/HTML issue I think. I need to be able to host an existing portlet in a sharepoint window. The trick is that I need to include some custom http headers in each request to the portlet app.

So, the initial request is easy... Just add the headers and make the request. But as the response comes back in, I need to look through it and see if any of the links are requests back to the portlet app. Those I need to intercept and add the custom headers to.

So as the response comes in, I can replace the href's in the stream, but what do I replace them with? What can I put int their place so that it maintains it look and feel as a hyperlink to the user, but will trigger a server side function call where I can add the custom headers in?

Any thoughts are greatly appreciated.

J
Nov 13 '06 #5
Hi rlrcstr,

I think it would be hard to do this without an additional handler that will
do an intermediate work at server-side. This is because in your webpart's
client-side html, we can only embed some basic url and querystring info,
but not add any custom httpheader.

If you want to send custom httprequest with custom headers, so far what I
can get is use XMLHTTP component to send http request(just like what AJAX
based page or control do):

#Posting Form Data and sending custom Request Headers with XMLHTTP
http://www.eggheadcafe.com/articles/20010510.asp

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 15 '06 #6
For this basic functionality, I think I've got somethign that works.

I can reaplace the hrefs with calls to javascript and hijack the
__dopostback function sending the requested URL as a parameter. Seems to
work fine in testing.

Thanks.

J

"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:0z**************@TK2MSFTNGXA01.phx.gbl...
Hi rlrcstr,

I think it would be hard to do this without an additional handler that
will
do an intermediate work at server-side. This is because in your webpart's
client-side html, we can only embed some basic url and querystring info,
but not add any custom httpheader.

If you want to send custom httprequest with custom headers, so far what I
can get is use XMLHTTP component to send http request(just like what AJAX
based page or control do):

#Posting Form Data and sending custom Request Headers with XMLHTTP
http://www.eggheadcafe.com/articles/20010510.asp

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.

Nov 17 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: William Ryan | last post by:
I just loaded VS2003 on a new machine and when I try to create a ASP.NET app or Web Service, I get the following error: "Visual Studio could not create or open application because your browser...
0
by: AA | last post by:
Hello, I need to create a soap proxy from this schema.. http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-2 but the wsdl.exe does not work :( The xsd.exe create classes...
19
by: Steve | last post by:
Can anyone point me to a primer for creating OCX controls in VB .net? In particular, I want to access a web service in a VB6 application (not an easy thing to do). So, if I can write an ActiveX...
2
by: Chamander2kool | last post by:
I use Godday.com for hosting. What I'm trying to do is create a web proxy. This is the code I have currently: <%@ Import Namespace="System.Net" %> <%@ Import Namespace="System.IO" %> <%@...
1
by: Jeevan | last post by:
Hi , I am working on developing an ASP.NET server control that is based on AJAX and need to call a webservice on a remote domain. To avoid the security warning from IE , I created a proxy...
16
by: tshad | last post by:
This is a little complicated to explain but I have some web services on a machine that work great. The problem is that I have run into a situation where I need to set up my program to access one...
0
by: jackfrancy | last post by:
Hi , When I tried to create web reference (Proxy Class) from WSDL.EXE or Visual Studio 2003 web Reference Tool Following error has occurred . “The error message from each known type may help...
1
by: Bill Woodruff | last post by:
Visual Studio 2005, .NET FrameWork 2.0, C#, WinForms Application Hi, I've read the recent posts by and to 'Thunderbird' (and learned a lot, thanks, from the usual masters Skeet and Paladino,...
0
by: =?Utf-8?B?UlN1Yg==?= | last post by:
Hello, Hope I am asking this question in the right forum. We have been given a Wsdl file and the webservices link from a client. I am trying to invoke their web service first by creating a proxy...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.