Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: SUSHI SOAP Request

  1. #1
    Junior Member
    Join Date
    Apr 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default SUSHI SOAP Request

    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()
    Last edited by egghunter; April 10th, 2014 at 08:32 AM.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    4,860
    My Mood
    Mellow
    Thanks
    179
    Thanked 631 Times in 618 Posts

    Default Re: SUSHI SOAP Request

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

Similar Threads

  1. Simple Java SOAP client
    By andy in forum Java Networking
    Replies: 3
    Last Post: December 16th, 2010, 03:05 PM
  2. Soap With Attachment AXIS Fault
    By anoopasta in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 23rd, 2010, 10:09 AM
  3. SOAP / WSDL Simple (ish) Problem
    By Mezz in forum Java Networking
    Replies: 0
    Last Post: September 29th, 2010, 12:01 PM
  4. Not able to receive SOAP response
    By abhisekh in forum What's Wrong With My Code?
    Replies: 2
    Last Post: May 12th, 2010, 07:20 AM
  5. SOAP Message Factory response error
    By Buglish in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: November 6th, 2008, 12:42 PM

Tags for this Thread