# Attributes for Soap elements

**URL:** <https://www.ruby-forum.com/t/attributes-for-soap-elements/86281>\
**Category:** Ruby\
**Created:** [February 21, 2007, 4:01am UTC](https://www.ruby-forum.com/t/attributes-for-soap-elements/86281 "2007-02-21T04:01:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roy\_Britten](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a5b964/32.png) [@Roy\_Britten](https://www.ruby-forum.com/u/Roy_Britten)\
**Post date:** [February 21, 2007, 4:01am UTC](https://www.ruby-forum.com/t/attributes-for-soap-elements/86281/1 "2007-02-21T04:01:42Z")

</div>

Hi,

I’m accessing a web service that is largely using attributes rather  
than elements for the request. How can I create a request containing  
attributes?

I create the SOAP driver with

require ‘soap/wsdlDriver’  
driver = SOAP::WSDLDriverFactory.new(wsdlURL).create\_rpc\_driver

and can elicit appropriate responses from the server for requests that  
pass the data as elements:

driver.getSomething(:foo=\>“bar”)

However, most requests require the data to be passed as attributes.  
For example, a simplified WSDL reads in part

How will I craft a request to the GetItem service with appropriate  
values for X and Y?

Thanks,  
Roy.
