title: Beginner: Soap Request Response call from java
body: <p>I try to do a SOAP request and get SOAP response by Java, and then call it from the JSP page.  I researched many sites, and try many ways, it doesn't seem to able to get it working.</p>
  
  <pre><code>URL u = new URL("http://www.mysitename.com/mysoaprequest.wsdl");
  URLConnection uc = u.openConnection();
  HttpURLConnection connection = (HttpURLConnection) uc;
  </code></pre>
  
  <p>....</p>
  
  <p>Can I just create a wsdl file with the soap request xml inside?</p>
  
  <p>I read something about Web Service, do I have to get some Web Service working to make it work?</p>
  
  <p>I use some wsdl to test <a href="http://www.webservicex.net/AustralianPostCode.asmx?WSDL" rel="nofollow noreferrer">http://www.webservicex.net/AustralianPostCode.asmx?WSDL</a> </p>
  
  <p>I kept getting this error </p>
  
  <blockquote>
    <p>java.io.IOException: Server returned HTTP response code: 500 for URL: <a href="http://www.webservicex.net/AustralianPostCode.asmx?WSDL" rel="nofollow noreferrer">http://www.webservicex.net/AustralianPostCode.asmx?WSDL</a> </p>
  </blockquote>
  
  <p>If anyone can point me to the right direction will be greatly appreciated.</p>
  
  <hr>
  
  <p>This is the actual soap request I need to make</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.application.tvcc.dmv.ca.gov/"&gt;
      &lt;soapenv:Header/&gt;
      &lt;soapenv:Body&gt;
          &lt;ser:getNewCourseCompletion&gt;
              &lt;arg0&gt;
                  &lt;userDto&gt;
                      &lt;password&gt;********&lt;/password&gt;
                      &lt;userId&gt;anyone@somecourt.com&lt;/userId&gt;
                  &lt;/userDto&gt;
              &lt;/arg0&gt;
          &lt;/ser:getNewCourseCompletion&gt;
      &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>