I'm trying to write a piece of code that will send a SOAP request to obtain a SUSHI Counter Report from EBSCONET. What's the best way to go about this? I've never used SOAP before.
I'm getting the error "Exception in thread "main" mava.io.IOException: Server returned HTTP response code: 415 for URL: http://wushi.ebscohost.com/EpSushiSe...shiService.svc
at sun.new.http://www.protocol.http.HttpURLConn...Stream(Unknown Source)"
Here's the relevant code
import java.net.*; import java.io.*; import java.util.*; public class SoapRequest { public static void main(String args[]) throws Exception { String soapXml = getXMLTest(); // jEdit: = buffer.getText(0,buffer.getLength()) java.net.URL url = new java.net.URL("http://sushi.ebscohost.com/EpSushiService/SushiService.svc"); java.net.URLConnection conn = url.openConnection(); // Set the necessary header fields conn.setRequestProperty("SOAPAction", "http://sushi.ebscohost.com/"); conn.setDoOutput(true); // Send the request java.io.OutputStreamWriter wr = new java.io.OutputStreamWriter(conn.getOutputStream()); wr.write(soapXml); wr.flush(); }//end main()