473,799 Members | 3,159 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

passing xml to servlet file

Das
Hi all,
I'm writig an application that sends an http request to java servlet file.
I have to pass an xml file to the servlet.

How should I pass xml file to the file.

When I try to access the url directly it shows me

Forbidden
You do not have permission to access /RequestListener Servlet on this server.

Additionally, error 403 Forbidden was encountered while attempting to use
ErrorDocument to handle the request.
Thanks in advance,

das
Nov 16 '05 #1
3 2264
Das,

This sounds like a permissions issue to me. How are you making the
request? I recommend that you use the HttpWebRequest class, and configure
the Credentials property to provide a user that can access the page.

As for sending the XML file, once you have the HttpWebRequest instance,
you can call GetRequestStrea m and you will get a stream that will enable you
to write directly to the request stream.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Das" <Da*@discussion s.microsoft.com > wrote in message
news:00******** *************** ***********@mic rosoft.com...
Hi all,
I'm writig an application that sends an http request to java servlet file.
I have to pass an xml file to the servlet.

How should I pass xml file to the file.

When I try to access the url directly it shows me

Forbidden
You do not have permission to access /RequestListener Servlet on this
server.

Additionally, error 403 Forbidden was encountered while attempting to use
ErrorDocument to handle the request.
Thanks in advance,

das

Nov 16 '05 #2
Das
Hi Nicholson,
Thanks a lot for the reply, at the moment I'm not looking at the code. Ya
I'm using HttpWebRequest class can you please write some code for setting the
credential & passing the xml file to the server.

The main objective is setting the credentials and passing the xml file to
the target server.

Thanks a lot...
Regards,

das

"Nicholas Paldino [.NET/C# MVP]" wrote:
Das,

This sounds like a permissions issue to me. How are you making the
request? I recommend that you use the HttpWebRequest class, and configure
the Credentials property to provide a user that can access the page.

As for sending the XML file, once you have the HttpWebRequest instance,
you can call GetRequestStrea m and you will get a stream that will enable you
to write directly to the request stream.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Das" <Da*@discussion s.microsoft.com > wrote in message
news:00******** *************** ***********@mic rosoft.com...
Hi all,
I'm writig an application that sends an http request to java servlet file.
I have to pass an xml file to the servlet.

How should I pass xml file to the file.

When I try to access the url directly it shows me

Forbidden
You do not have permission to access /RequestListener Servlet on this
server.

Additionally, error 403 Forbidden was encountered while attempting to use
ErrorDocument to handle the request.
Thanks in advance,

das


Nov 16 '05 #3
Das,

It's simple. Just call the Credentials property and set it to an
instance of NetworkCredenti als, where you can set a username and password.

Then, call the GetRequestStrea m, and then call the methods on the Stream
returned to write the file to the request stream. You might have to change
the content type of the request, but that should be too hard (it's just
another property on the HttpWebRequest) .
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Das" <Da*@discussion s.microsoft.com > wrote in message
news:0F******** *************** ***********@mic rosoft.com...
Hi Nicholson,
Thanks a lot for the reply, at the moment I'm not looking at the code. Ya
I'm using HttpWebRequest class can you please write some code for setting
the
credential & passing the xml file to the server.

The main objective is setting the credentials and passing the xml file to
the target server.

Thanks a lot...
Regards,

das

"Nicholas Paldino [.NET/C# MVP]" wrote:
Das,

This sounds like a permissions issue to me. How are you making the
request? I recommend that you use the HttpWebRequest class, and
configure
the Credentials property to provide a user that can access the page.

As for sending the XML file, once you have the HttpWebRequest
instance,
you can call GetRequestStrea m and you will get a stream that will enable
you
to write directly to the request stream.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Das" <Da*@discussion s.microsoft.com > wrote in message
news:00******** *************** ***********@mic rosoft.com...
> Hi all,
> I'm writig an application that sends an http request to java servlet
> file.
> I have to pass an xml file to the servlet.
>
> How should I pass xml file to the file.
>
> When I try to access the url directly it shows me
>
> Forbidden
> You do not have permission to access /RequestListener Servlet on this
> server.
>
> Additionally, error 403 Forbidden was encountered while attempting to
> use
> ErrorDocument to handle the request.
>
>
> Thanks in advance,
>
> das


Nov 16 '05 #4

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

Similar topics

1
3478
by: Chris Morgan | last post by:
I'm trying to get php to run on my webserver as a Java Servlet, it works the first time but fails the second time and crashes the JVM with the following error: I have tried the latest versions of PHP 4. (release and dev) I would appreciate any help with this issue. -- Chris
3
4803
by: TheLetti | last post by:
Hy! I've just downloaded the latest Java 2 SDK (j2sdk1.4.2_01). For my surprise in this version the servlet-classes are not integrated (e.g. the class javax.servlet). So I found all the servlet-classes I needed on the java.sun.com-Homepage and downloaded the javax.servlet-Package. (Maybe this file-description may help you understanding my problem:
1
3900
by: Hai Tran | last post by:
Any help is appreciated. Installed Tomcat 4.1 and Mysql on a WinXP. I've manage to get Tomcat up and was able to view my first application ( myhome ) simple home page. Tomcat was installed under C:\Tomcat4\ with C:\Tomcat4\webapps\myhome\WEB-INF\classes to store all my java.class files. Under WEB-INF, I've have edit the web.xml file as <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD...
1
19613
by: Barry Parker | last post by:
Is there a way to pass parameters (variables?) from a JSP page to a servlet when it is called? This way I can use a generic servlet to do several different tasks. The call to the servlet is made by using the JSP forward tag. Cheers in advance, Barry
1
4264
by: Vasil Slavov | last post by:
I apologize for the long email. I hope somebody will have time to read it and give some suggestions. I am working on a school project written in Python (using mod_python) and I need to upload a file to a java servlet. Here are the high-level instructions given by the servlet authors (the instructions are geared towards my C#/VB competition (and I really want to show them how cool Python is): - Open the file for reading.
3
1567
by: krishna81m | last post by:
Hello, I am looking for a solution to update a .jsp page (kind of progress bar) which shows current progress in a huge simulation when users have to wait for longer periods and the way to do it was have the jsp page refresh often and the page data update by a bean containing the properties file details. The main servlet class continously running on the server regularly updates the properties file. I am currently using a properties file,...
3
2294
by: vijaykumardahiya | last post by:
Dear Sir, I have two queries. First question is: I have a Html page. On which Have two buttons Submit and Issue. I want when I click on Sumit button request should be go to submit.jsp. and When I click on Issue button then request should be go to Issue.jsp.But When I click on submit button request do to Issue.jsp. Second Question is How I reterive the input parameter of html page to submit.jsp. Please review.. My files are: login.html:
7
8884
by: vinodsk101 | last post by:
Hi all, I have one doubt, can we pass a variable from javascript to servlet??? In Brief, i am getting some values in javascript through jsp and the same values i want in servlet. Ya i know i can get this values in servlet by using request.getParameter(""); But thise values are dynamically generated so i dont know how many values will be. so i am planning to put some array list so that i can forward this values to servlet. but i can't...
3
3088
by: vijaykumardahiya | last post by:
Hello To Every One, I want to know that when I upload the File like a image from html page Its not show on servlet page using appropriate logic. I read the FileUpload Home page.But I am still confused. Is that true that file uploaded image can not show on servlet.Its store to database or memory..?? Please assist me. Thanks.
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9538
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10470
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10247
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10023
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9067
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7561
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5459
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2935
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.