Re: Sending XML via http post, using servlet

Vishnu <[email protected]> Tue, 14 Mar 2006 12:29:17 +0530
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
This is a multi-part message in MIME format.

------=_NextPart_000_003B_01C64762.E93C0630
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hey,

I Hope response.sendRedirect() calls the doGet() method of the servlet.

Instead Try Calling the doPost Method of the servlet where you are =
trying to send the xml stream.

protected void doPost(HttpServletRequest request, HttpServletResponse =
response){
   =20
    servletInstance.doPost(request,response);
}

----- Original Message -----=20
  From: Corey Crandell=20
  To: [email protected]=20
  Sent: Tuesday, March 14, 2006 1:56 AM
  Subject: Sending XML via http post, using servlet


  Hey I am hopeing someone may be able to help. I am trying to send and =
xml stream via http post. I am using a servlet using goPost. The server =
I am sending the request to will return with a response as long as the =
stream is sent via http post, as of right now I am getting an error from =
the remote server saying im not sending the xml stream via post.

  my imports are :

  import java.io.*;
  import java.net.*;

  import javax.servlet.*;
  import javax.servlet.http.*;

  throws:

  throws ServletException, IOException {

  and using goPost:

  protected void doPost(HttpServletRequest request, HttpServletResponse =
response)

  whats included in the xml stream is a simple domain search, when a =
client types in a domain search on my website the servlet grabs that =
info and sends it to the remote server via sendRedirect basically temp =
files.. here is where the xml doc is being sent to:

  =
response.sendRedirect("http://pirin.names4ever.com/TestXAPI/Pirin2Test.ex=
e?"+test);

  Maybe somewhere there I need make another POST call.. not sure..

  Can someone send me in the right direction please, I would certainly =
appriciate it. If you need more info let me know.

  Corey C=20
  =
_________________________________________________________________________=
__ To unsubscribe, send email to [email protected] and include in =
the body of the message "signoff SERVLET-INTEREST".=20
  Archives: http://archives.java.sun.com/archives/servlet-interest.html =
Resources: http://java.sun.com/products/servlet/external-resources.html =
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html=20



___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html


------=_NextPart_000_003B_01C64762.E93C0630
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3D"Trebuchet MS" color=3D#0000ff =
size=3D2>Hey,</FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Trebuchet MS" color=3D#0000ff size=3D2>I =
Hope&nbsp;</FONT><FONT=20
face=3D"Trebuchet MS" color=3D#0000ff size=3D2>response.sendRedirect() =
calls the=20
doGet() method of the servlet.</FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Trebuchet MS" color=3D#0000ff size=3D2>Instead Try =
Calling the=20
doPost Method of the servlet where you are trying to send the xml=20
stream.</FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" color=3D#0000ff size=3D2></FONT><FONT=20
face=3D"Trebuchet MS" color=3D#0000ff size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Trebuchet MS" color=3D#0000ff size=3D2><FONT =
face=3DArial=20
color=3D#ff0000>protected void doPost(HttpServletRequest request,=20
HttpServletResponse response){</FONT></FONT></DIV>
<DIV><FONT face=3DArial color=3D#ff0000 size=3D2>&nbsp;&nbsp;&nbsp; =
</FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" color=3D#0000ff =
size=3D2>&nbsp;&nbsp;&nbsp;=20
servletInstance.doPost(request,response);</FONT></DIV>
<DIV><FONT face=3D"Trebuchet MS" color=3D#0000ff size=3D2><FONT =
face=3DArial=20
color=3D#ff0000>}<BR><BR></FONT></FONT>----- Original Message ----- =
</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A [email protected] =
href=3D"mailto:[email protected]">Corey=20
  Crandell</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
  [email protected]=20
  =
href=3D"mailto:[email protected]">[email protected]=
OM</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Tuesday, March 14, 2006 =
1:56=20
  AM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Sending XML via http =
post, using=20
  servlet</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3DArial size=3D2><SPAN class=3DspnMessageText =
id=3Dmsg>Hey I am=20
  hopeing someone may be able to help. I am trying to send and xml =
stream via=20
  http post. I am using a servlet using goPost. The server I am sending =
the=20
  request to will return with a response as long as the stream is sent =
via http=20
  post, as of right now I am getting an error from the remote server =
saying im=20
  not sending the xml stream via post.<BR><BR>my imports are =
:<BR><BR><FONT=20
  color=3Dred>import java.io.*;<BR>import java.net.*;<BR><BR>import=20
  javax.servlet.*;<BR>import=20
  javax.servlet.http.*;</FONT><BR><BR>throws:<BR><BR><FONT =
color=3Dred>throws=20
  ServletException, IOException {</FONT><BR><BR>and using =
goPost:<BR><BR><FONT=20
  color=3Dred>protected void doPost(HttpServletRequest request,=20
  HttpServletResponse response)</FONT><BR><BR>whats included in the xml =
stream=20
  is a simple domain search, when a client types in a domain search on =
my=20
  website the servlet grabs that info and sends it to the remote server =
via=20
  sendRedirect basically temp files.. here is where the xml doc is being =
sent=20
  to:<BR><BR><FONT color=3Dred>response.sendRedirect("<A=20
  href=3D"http://pirin.names4ever.com/TestXAPI/Pirin2Test.exe?"=20
  target=3D_blank><FONT=20
  =
color=3D#000000>http://pirin.names4ever.com/TestXAPI/Pirin2Test.exe?</FON=
T></A>"+test);</FONT><BR><BR>Maybe=20
  somewhere there I need make another POST call.. not sure..<BR><BR>Can =
someone=20
  send me in the right direction please, I would certainly appriciate =
it. If you=20
  need more info let me know.</SPAN></FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV align=3Dleft><SPAN=20
  style=3D"FONT-SIZE: 11pt; COLOR: black; FONT-FAMILY: Verdana; =
mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times =
New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; =
mso-bidi-language: AR-SA"><STRONG>Corey=20
  C=20
  =
</STRONG></SPAN></DIV>___________________________________________________=
________________________=20
  To unsubscribe, send email to [email protected] and include in the =
body of=20
  the message "signoff SERVLET-INTEREST".=20
  <P>Archives: =
http://archives.java.sun.com/archives/servlet-interest.html=20
  Resources: =
http://java.sun.com/products/servlet/external-resources.html=20
  LISTSERV Help: http://www.lsoft.com/manuals/user/user.html=20
  <P></P></BLOCKQUOTE></BODY></HTML>
___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".
<p>
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
<p>

------=_NextPart_000_003B_01C64762.E93C0630--