Redirecting an ASMX page to a new server

S

Simon960

Hi,

I wonder if someone would help me please? I am trying to redirect a
..NET web service ASMX page to a new server (from
https://localhost/webservices/syncdata.asmx for test) to
https://vault1.secured-url.com/fundamentumfais/webservices/syncdata.asmx)
so that my VB .NET standalone client app connects to the new server. I
can not change the standalone app as it is in use in several locations
around the country and I can't change them all on the same day (so data
would be split across two DBs, etc).

I have created a redirect on IIS for the folder webservices on the test
server redirecting to:
https://vault1.secured-url.com/fundamentumfais/webservices$S$Q and
ticked "exact URL above" and this seems to work fine in a browser.

If I type in
https://localhost/webservices/syncdata.asmx?op=GetChangedTableData then
it redirects to
https://vault1.secured-url.com/fundamentumfais/webservices/syncdata.asmx?op=GetChangedTableData
and it seems fine. However if I run my standalone VB app it gives an
error. I'm afraid I can't be more specific on the error because it
just gives me a friendly error "Communications Error".

By changing the client app's configuration file I can set it to connect
directly to https://vault1.secured-url.com/fundamentumfais/webservices/
(the app itself completes the rest of the URL, because it uses a couple
of web services) and that works perfectly so its not a network/
password issue or anything along those lines.

Is there some reason why asmx pages can't redirected in this way? As I
said its strange that it seems to work fine in a browser, but then I'm
new to .NET and I'm not a developer. Is there an easy way to make this
redirect work in code? I'm not a coder but I could certainly open a
file and stick a server.redirect or something at the top of it :)

Many thanks indeed for any help offered

Simon
spdale A T gmail.com
 
A

Andrew Brook

just a guess -
When a redirect is performed, the HTTP response to the client contains the
new address to visit, it is then the clients responsibility to request the
new URL. I would think that in your tests, the browser handles the redirect
for you so it looks like it works. Your VB client on the other hand is not
expecting the redirect and does not handle it. Not sure how you could fix
this though without changing the client, what you're essentially after is
the equivlent of a server.transfer in your service...

Andrew
 
R

RYoung

you should try configuring the localhost service with WSE3 and following the
"routing" tutorial. There's a sample called "Permiter Service Router" which
does exactly what you describe.

It allows the client to think it's communicating with the localhost (or
whatever it's referencing), and that service will in turn forward the
request to a different server. The diferent server either responds back to
the contacting server, or to the client directly (can't remember which).

But, if you do that, the client app won't need any changes. It's not
difficult to do. Just get the WSE3 extenstions from msdn.microsoft.com, then
check out the documenting for "routing", also go to the Patterns & Practices
section at MSDN and look for web services patterns, where it describes the
"Permiter Service Router".

Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top