# ActionWebService - need response in XML

**URL:** <https://www.ruby-forum.com/t/actionwebservice-need-response-in-xml/176860>\
**Category:** Ruby\
**Created:** [October 7, 2009, 6:33am UTC](https://www.ruby-forum.com/t/actionwebservice-need-response-in-xml/176860 "2009-10-07T06:33:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![srikanth\_j](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a5b964/32.png) [@srikanth\_j](https://www.ruby-forum.com/u/srikanth_j)\
**Post date:** [October 7, 2009, 6:33am UTC](https://www.ruby-forum.com/t/actionwebservice-need-response-in-xml/176860/1 "2009-10-07T06:33:27Z")

</div>

Hi i have used actionwebservice gem.  
I have processed a SOAP request & in the service api i expect an api\_key  
& url.

class ServicesApi \< ActionWebService::API::Base  
api\_method :verify\_url, :expects =\>  
[{:api\_key=\>:string},{:url=\>:string}], :returns =\> [{:response  
=\>:string}]  
end

Processing the api\_key & url, i have generated an XML. when i return  
response, the XML is converted into string.

“\<?xml version=\"1.0\" encoding=\"UTF-8\"?\>\n\<records type="array"\>\n  
\n nil\n  
url is Invalid \n  
102\n Failure\n  
\n\n”

The response which i expect is XML.

Is there any method to convert the string to XML?  
Or is there any way to return the response as a XML?

Thanks,  
Srikanth J

> **[Srikanth Jeeva's technical Blog](http://www.srikanthjeeva.com/)**
>
> my blog is abt wht i have learnt technically, mostly in Ruby on Rails, Javascript, node.js 
> hope this share a little bit of info & adds a bit stuff., 
> Thanks.

---

<div class="post-metadata">

**Author:** ![srikanth\_j](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a5b964/32.png) [@srikanth\_j](https://www.ruby-forum.com/u/srikanth_j)\
**Post date:** [October 7, 2009, 10:27am UTC](https://www.ruby-forum.com/t/actionwebservice-need-response-in-xml/176860/2 "2009-10-07T10:27:47Z")

</div>

I have used xml\_in method from xmlsimple,  
Its working now

Thanks,  
Srikanth J

[http://srikanthjeeva.blogspot.com](http://srikanthjeeva.blogspot.com)
