putting a soap message in a variable to be sent

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Mar 2007
Posts: 2
Reputation: d_maniger06 is an unknown quantity at this point 
Solved Threads: 0
d_maniger06 d_maniger06 is offline Offline
Newbie Poster

putting a soap message in a variable to be sent

 
0
  #1
Mar 8th, 2007
good day!..

i have this soap message that will be sent to a simple service provider simulator..
since this is only a simulation, i there will be only one service named leave (e.g. vacation leave, sick leave, etc.)

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://leaveprocessor.blueprints.jbi.sun.com/">
  3. <soapenv:Body>
  4. <ns1:processApplication>
  5. <appName>applicant</appName>
  6. <leaveType>type of leave</leaveType>
  7. <numDays>number of days</numDays>
  8. </ns1:processApplication>
  9. </soapenv:Body>
  10. </soapenv:Envelope>

im using tcp for communication between my client and service provider..
basically, i have this code line that would stream my message to the service provider..

  1. output.println(message);

where output there is declared as:

  1. output = new PrintStream(clientSocket.getOutputStream());

i have successfully streamed my message to the service provider when i assigned it a string value like the word "dog"
but what i want to happen is that the message will have the value of the soap message stated above..

how can i do that?
any help in solving this problem will be greatly appreciated..

thanx!..

God bless!..
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: putting a soap message in a variable to be sent

 
0
  #2
Mar 8th, 2007
same thing, it's after all just another string.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 2
Reputation: d_maniger06 is an unknown quantity at this point 
Solved Threads: 0
d_maniger06 d_maniger06 is offline Offline
Newbie Poster

Re: putting a soap message in a variable to be sent

 
0
  #3
Mar 8th, 2007
ive done this but there are too many errors:

  1. import java.io.*;
  2. import java.net.*;
  3.  
  4. public class createrequest
  5. {
  6. public String creator()
  7. {
  8. String message="<?xml version="1.0" encoding="UTF-8"?>
  9. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://leaveprocessor.blueprints.jbi.sun.com/">
  10. <soapenv:Body>
  11. <ns1:processApplication>
  12. <appName>name</appName>
  13. <leaveType>Vacation</leaveType>
  14. <numDays>4</numDays>
  15. </ns1:processApplication>
  16. </soapenv:Body>
  17. </soapenv:Envelope>";
  18.  
  19. return message;
  20. }
  21. }
  22.  

most of the errors occur on the symbols of the soap message such as ":", "<", etc.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: putting a soap message in a variable to be sent

 
0
  #4
Mar 9th, 2007
you can't break a string over multiple lines.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum


Views: 1300 | Replies: 3
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC