title: Java: Simple SOAP Client
body: <p>I'm looking for a SOAP client for Java.</p>
  
  <p>Apache Axis looks very bloated to me. I don't understand why things have to be so complicated in Java. For example, in PHP, all I have to do is:</p>
  
  <pre><code>&lt;?php
  $global_service_wsdl='https://api.betfair.com/global/v3/BFGlobalService.wsdl';
  $betfair=new SoapClient($global_service_wsdl);
  
  $params=array("request"=&gt;
      array("header"=&gt;
           array("clientStamp"=&gt;0,"sessionToken"=&gt;$session_token)),"locale"=&gt;""
  );
  $response=$betfair-&gt;getAllEventTypes($params);
  ?&gt;
  </code></pre>
  
  <p>And my $response object holds all the information I require.</p>
  
  <p>Can anybody suggest how I would implement something like this in Java without too much hassle?</p>
  
  <p>Many thanks in advance,</p>
  
  <p>~Edit 1~</p>
  
  <p>@jarnbjo:</p>
  
  <p>That is very useful to me. The bit I'm stuck on is what imports do I need to get that code to run?</p>
  
  <p>I ran this command:
  sh wsdl2java.sh -o output -a -uri <a href="https://api.betfair.com/global/v3/BFGlobalService.wsdl" rel="noreferrer">https://api.betfair.com/global/v3/BFGlobalService.wsdl</a></p>
  
  <p>And built the output. Do you think this is quicker than PHP? Also, I've got an "asynchronous" option. Does this mean I can make asynchronous calls? That would be very useful. I'd like to run all this inside a Java-based websocket server.</p>