Accessing SOAP service

I am trying to post a transaction to a SOAP service using the
following:

require ‘soap/wsdlDriver’

class CitymainServiceV2

def post_policy(*args)
soap = wsdl.create_rpc_driver
soap.wiredump_file_base = “soap-log.txt”
soap.wiredump_dev = STDERR
response = soap.CreateCustomer(*args)
soap.reset_stream
response
end

private
def wsdl
SOAP::WSDLDriverFactory.new(‘https://citymaintrak.com/
citymainservicev2/citymainservicev2.asmx?WSDL’)
end
end

The api documentation on soap/wsdl is not at all useful and I am
really struggling to find a relevant tutorial. I was hoping to be
able to use this library without having to go into a lot of research.
The webservice is on .net and I would like to know how to accomplish
the following:

  • I can connect to CreateCustomer but how do I specify
    MessageName=“AddCustomerPrimDataType”.
  • for the post data, currently passed into the class a *args, what am
    I meant to be sending in, a fully-constructed xml string using
    builder? Perhaps a hash with appropriate symbol keys?
  • is there a better way?

Thanks,

O.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs