how to call WSDL web service using AsyncHttpAPI?

Hi,

Ho to call WSDL web service using AsyncHttpAPI?

Thank you.

Dave van der Veen
Add the attribute

Add the attribute [ScriptService] to the webservice. This will allow the Webservice to respond with json.

[ScriptService]

public class MobileClient : System.Web.Services.WebService

{

          [WebMethod]

          public String[] GetData

          {

               ...

          }

}

Then call the webservice from ruby.

require 'rho'

require 'json'

class WebServiceHelper

  def self.DoCall( function, params = {} )

    

  result = Rho::AsyncHttp.post(

    :url => 'http://localhost/Webservice/MobileClient.asmx/' + function,

    :headers => { 'Content-Type' => 'application/json' },

    :body => params.to_json   

    )

    return result[ 'body' ][ 'd' ]

  end

end

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments