title: SOAP Endpoint url through ruby for Java SOAP Client
body: <p>I'm trying to invoke a Ruby SOAP Web Service using Java SOAP Client. And I am unable to get the response for this url:</p>
  
  <pre><code>http://localhost:8080/calculation?wsdl 
  </code></pre>
  
  <p>(I'm afraid if the above endpoint url is wrong for the below web service)</p>
  
  <p><strong>Ruby SOAP WS:</strong></p>
  
  <pre><code>require "soap/rpc/standaloneserver"
  
  begin
    class MyServer &lt; SOAP::RPC::StandaloneServer
  
      # Expose our services
      def initialize(*args)
        super
        add_method(self, 'add', 'a', 'b')
        add_method(self, 'div', 'a', 'b')
      end
  
      # Handler methods
      def add(a, b)
        return a + b
      end
      def div(a, b)
        return a / b
      end
    end
    server = MyServer.new("MyServer",
                          'urn:ruby:calculation', 'localhost', 8080)
    trap('INT'){
      server.shutdown
    }
    server.start
  rescue =&gt; err
    puts err.message
  end
  </code></pre>
  
  <p><em>I'm getting the error as :</em></p>
  
  <pre><code>in `success_content': unexpected response: #&lt;HTTP::Message::Headers:0x00000004328c10 @http_version="1.1", @body_size=0, @chunked=false, @request_method="GET", @request_uri=#&lt;URI::HTTP http://localhost:8080/calculation?wsdl&gt;, @request_query=nil, @request_absolute_uri=nil, @status_code=405, @reason_phrase="Method Not Allowed ", @body_type=nil, @body_charset=nil, @body_date=nil, @body_encoding=#&lt;Encoding:ISO-8859-1&gt;, @is_request=false, @header_item=[["Allow", "POST"], ["Content-Type", "text/html; charset=ISO-8859-1"], ["Server", "WEBrick/1.3.1 (Ruby/2.2.5/2016-04-26)"], ["Date", "Wed, 10 Aug 2016 05:02:29 GMT"], ["Content-Length", "297"], ["Connection", "close"]], @dumped=false&gt; (HTTPClient::BadResponseError)
  </code></pre>
  
  <p>Is the endpoint url wrong? I invoked with the Rub Client and it worked (diff url). Is there a way to invoke using JAVA Client?</p>
  
  <p><strong>Ruby SOAP Client:</strong></p>
  
  <pre><code>#!/usr/bin/ruby
  
  require 'soap/rpc/driver'
  
  NAMESPACE = 'urn:ruby:calculation'
  URL = 'http://localhost:8080/'
  
  begin
    driver = SOAP::RPC::Driver.new(URL, NAMESPACE)
  
    # Add remote sevice methods
    driver.add_method('add', 'a', 'b')
  
    # Call remote service methods
    puts driver.add(200, 130)
  rescue =&gt; err
    puts err.message
  end
  </code></pre>