# Accessing SOAP service

**URL:** <https://www.ruby-forum.com/t/accessing-soap-service/177366>\
**Category:** Rails\
**Created:** [October 15, 2009, 6:40pm UTC](https://www.ruby-forum.com/t/accessing-soap-service/177366 "2009-10-15T18:40:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![icke](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e19adc/32.png) [@icke](https://www.ruby-forum.com/u/icke)\
**Post date:** [October 15, 2009, 6:40pm UTC](https://www.ruby-forum.com/t/accessing-soap-service/177366/1 "2009-10-15T18:40:00Z")

</div>

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/](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.
