dcsimg
A jaxm question
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Xu_Zhaojun
Posted On:   Tuesday, March 11, 2003 01:23 AM

Hi, I need to send a soap message to a JAXM servlet from a non JAXM Client. The soap message is read from a file and it looks something like this. MessageID: <7903337.1046746560695.JavaMail.iastudent@SG0151D-TDMPH> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_0_3658916.1046746560617" Host: 172.24.51.29:7001 Action: MHubSubmit POST: /mhbweb/mhb/SOAPListenerServlet ------=_Part_0_3658916.1046746560617 Content-Type: text/XML Content-Transfer-Encoding: 7bit SOAPAction: MHub <?xml version="1.0" encoding="UTF-8"?> 1 2 ------=_Part_0_3658916.1046746560617-- the so   More>>

Hi, I need to send a soap message to a JAXM servlet from a non JAXM Client. The soap message is read from a file and it looks something like this.



MessageID: <7903337.1046746560695.JavaMail.iastudent@SG0151D-TDMPH>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="----=_Part_0_3658916.1046746560617"
Host: 172.24.51.29:7001
Action: MHubSubmit
POST: /mhbweb/mhb/SOAPListenerServlet

------=_Part_0_3658916.1046746560617
Content-Type: text/XML
Content-Transfer-Encoding: 7bit
SOAPAction: MHub

<?xml version="1.0" encoding="UTF-8"?> 1 2
------=_Part_0_3658916.1046746560617--


the soap message is then sent to the servlet using the codes below.



FileInputStream instream = new FileInputStream("c:\test\SoapReq.xml"); //Reading the file from the localdir


url = new URL("http://localhost:8080/servlet/NewServerListenerServlet");

httpURL = (HttpURLConnection)(url.openConnection());

httpURL.setRequestMethod("POST");

httpURL.setDoOutput(true);

httpURL.setDoInput(true);

OutputStream op = httpURL.getOutputStream();

BufferedOutputStream bufferedoutputstream = new BufferedOutputStream(op, 20000000);

int j = 0;

while((j = instream.read()) != -1)

bufferedoutputstream.write(j);

bufferedoutputstream.flush();

bufferedoutputstream.close();



Can anyone tell me how to code the JAXM servlet in order to receive the soap message? thanks. I had tried to write a Jaxmservlet with the OnMessage() but it couldn't work

   <<Less
About | Sitemap | Contact