title: How do I call a web service from Java? (I have a perl script that does it)
body: <p>I've got a Java web app that needs to call a web service that sits on a different server. </p>
  
  <p>Here's the code for the perl script I have that calls the service:</p>
  
  <pre><code>#!/usr/bin/perl -w
  
  use SOAP::Lite;
  
  my $user = 'user';
  my $password = 'password';
  
  my $loginURI = "http://someserver:8080/SakaiLogin.jws?wsdl";
  my $scriptURI = "http://someserver:8080/sakai-axis/scripts/RosterService.jws?wsdl";
  
  my $loginsoap = SOAP::Lite
  -&gt; proxy($loginURI)
  -&gt; uri($loginURI);
  
  my $scriptsoap = SOAP::Lite
  -&gt; proxy($scriptURI)
  -&gt; uri($scriptURI);
  
  my $session = $loginsoap-&gt;login($user, $password)-&gt;result;
  
  # doSiteRoster(session, site_id, user_id)
  my $result = $scriptsoap-&gt;doSiteRoster($session, "cfc338aa-acfb-41a6-a998-7e467afc297b", "djswartz")-&gt;result;
  
  my $logout = $loginsoap-&gt;logout($session)-&gt;result;
  
  exit;
  </code></pre>
  
  <p>Now, I'm thinking I can use javax.xml.ws.Service...Although I'm not quite sure how to go about it. Any direction would be awesome.</p>