Sunday, August 14, 2005

Remote ArcIMS server in a frameless html viewer

There have been some questions about how to run Frameless HTML Viewer in a separate web server and access a remote ArcIMS Server from it. Javascript has the same origin policy which prevents a webpage loaded from one server communicating to a different server for security reason. To work around this problem in the HTML Viewer, there is a property in the Servlet Connector called redirect which allows forwarding the ArcXML requests to the remote ArcIMS server. Thus by installing the Servlet Connector on a web server and setting it to redirect to any remote server, we can 'fool' the Javascript to think that it's loading the response from the same server.
I initially thought this would work for the frameless viewer too. On further testing, it appeared that the redirection in servlet connector works only with the form based requests.
There is still another work around though. This is to create a web application in jsp/ASP/Servlet etc and deploy it on the web server. The web application needs to simply forward the ArcXML requests to the remote ArcIMS Server and get back the responses. It is pretty simple to create such application using one of the connectors.
For instance, here is the JSP code to do this:

<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="com.esri.aims.mtier.io.ConnectionProxy" %>
<%
String server = "http://www.geographynetwork.com";
String service = "ESRI_World";
ConnectionProxy mcp = new ConnectionProxy();
mcp.setConnectionType(ConnectionProxy.HTTP);
mcp.setService(service);
mcp.setUrl(new java.net.URL(server));
int reqLength = request.getContentLength();
byte[] reqByte;
if (reqLength > 0) {
reqByte = new byte[reqLength];
int data = 1;
int offset = 0;
while (data > 0) {
data = request.getInputStream().read(reqByte, offset,reqLength - offset);
offset = offset+ data;
}
String axl = new String(reqByte);
String res = mcp.send(axl);
out.println(res);
} else
out.println("Error");
%>

16 Comments:

At 6:29 AM, Anonymous Anonymous said...

Hi all!
That was useful info...thanks and Welcome to live chat FETISH. If you search the aldactone? Click here - aldactone
Enjoy

 
At 4:18 PM, Anonymous Anonymous said...

Hello. Alone on Valentine's Day? Adult Live Chat & movie pages Try to find partner in your area!
for fun

 
At 1:02 AM, Anonymous Anonymous said...

Hi. Use these helpful search engines TFO search & skelaxin and try to find all you need in your area!
Enjoy

 
At 12:15 PM, Anonymous Anonymous said...

http://www.You4Dating.com 100% Free Dating website!

1.Our Website - is a great way to find new friends or partners, for fun, dating and long term relationships. Meeting and socializing with people is both fun and safe.

2.Common sense precautions should be taken however when arranging to meet anyone face to face for the first time.

3.You4Dating Free Online Dating ,You4Dating is a Free 100% Dating Site, There are No Charges ever. We allow You to Restrict who can Contact You, and Remove those unfit to Date.

4. You4Dating is Responsible for Creating Relationships per Year proving it is possible to Find Love Online. It will Quickly become a Leader in the Internet Dating Industry because of its Advanced Features and matching Systems,and most of all,Because is a 100% Free-There are No Charges Ever.

5. You4Dating is an International Dating Website Serving Single Men and Single Women Worldwide. Whether you're seeking Muslim,Christian,Catholic, Singles Jewish ,Senor Dating,Black Dating, or Asian Dating,You4Dating is a Right Place for Members to Browse through, and Potentially Find a Date.
Meet more than 100000 Registred Users

6. Multy Language Dating Site.

http://www.You4Dating.com

 
At 1:05 AM, Anonymous Anonymous said...

hmmm.. some free dating sites make money with adsense etc..



---------------
dating agency

 
At 2:28 PM, Anonymous Anonymous said...

well, if you're disabled u have it pretty tough in the dating game but there are specialist dating sites for disabled people



---------------
dating singles

 
At 4:24 PM, Anonymous Anonymous said...

think it make sense to think many dating sites operate diffrently with diverse opportunities



---------------
filipino girls

 
At 3:32 PM, Anonymous Anonymous said...

Howdy,

Do you guys watch movies in theater or on internet? I use to rent DVD movies from [b]Netflix.com[/b]. Recently I discovered that we can watch all new movies on internet on day, they are released. So why should I spend money on renting movies??? So, can you guys please tell me where I can [url=http://www.watchhotmoviesfree.com]watch latest movie Iron Man 2 2010[/url] for free?? I have searched [url=http://www.watchhotmoviesfree.com]Youtube.com[/url], [url=http://www.watchhotmoviesfree.com]Dailymotion.com[/url], [url=http://www.watchhotmoviesfree.com]Megavideo.com[/url] but, Could not find a good working link. If you know any working link please share it with me.


Thanks

 
At 7:32 AM, Anonymous Listing of certified pilots in Louisiana said...

Hi all! That was useful info...thanks and Welcome to live chat FETISH. If you search the aldactone? Click here - aldactone Enjoy

 
At 3:47 PM, Anonymous vrnjacka banja said...

I will bookmark this site and visit again. It is very informative. Thanks for sharing.
vrnjacka banja smestaj
vrnjacka banja privatni smestaj

 
At 7:34 AM, Anonymous pepa prase said...

I'm so excited. I really appreciate sharing this great post. Keep up your excellent work.
bojanke za decu
bojanke
gledanje u solju

 
At 5:48 AM, Anonymous banja srbija said...

Excellent post. I want to thank you for this informative read. I will bookmark this site and visit again..
Banje u Srbiji
Banje Srbije

 
At 2:58 PM, Anonymous knjigovodstvena agencija beograd said...

Hey, man! Excellent post! Thanks.
Ekologija
recepti
advokatska kancelarija
trake za fiskalne kase

 
At 2:34 PM, Anonymous Anonymous said...

alatni celici
biografija zarko lauĊĦevic

 
At 6:01 PM, Blogger Kzaxcpnd Molluskxbny said...

Labor vanquishes all---not inconstant , spasmodic, or ill-directed labor; but RuneScape Gold faithful, unremitting, daily effort toward RS Gold a well-directed purpose. Just as truly as eternal vigilance is RuneScape Gold the price of liberty, so is eternal industry the price of noble and enduring success.

 
At 6:02 PM, Blogger Kzaxcpnd Molluskxbny said...

Children in famine, victims tortured RS Gold by oppressors, helpless old people a hated RS GP burden to their sons, and the whole world of loneliness, poverty, and pain make Runescape Gold a mockery of what human life should be. I long to alleviate the evil, but I cannot, and I too suffer.

 

Post a Comment

<< Home