473,326 Members | 2,048 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,326 software developers and data experts.

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 /RequestListenerServlet 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 2240
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 GetRequestStream 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.com

"Das" <Da*@discussions.microsoft.com> wrote in message
news:00**********************************@microsof t.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 /RequestListenerServlet 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 GetRequestStream 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.com

"Das" <Da*@discussions.microsoft.com> wrote in message
news:00**********************************@microsof t.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 /RequestListenerServlet 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 NetworkCredentials, where you can set a username and password.

Then, call the GetRequestStream, 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.com

"Das" <Da*@discussions.microsoft.com> wrote in message
news:0F**********************************@microsof t.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 GetRequestStream 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.com

"Das" <Da*@discussions.microsoft.com> wrote in message
news:00**********************************@microsof t.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 /RequestListenerServlet 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
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...
3
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...
1
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...
1
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...
1
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...
3
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...
3
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...
7
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...
3
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.