# Using ActionWebService from PHP

**URL:** <https://www.ruby-forum.com/t/using-actionwebservice-from-php/146180>\
**Category:** Rails\
**Created:** [August 18, 2008, 8:05pm UTC](https://www.ruby-forum.com/t/using-actionwebservice-from-php/146180 "2008-08-18T20:05:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwalsh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/91b2a8/32.png) [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Post date:** [August 18, 2008, 8:05pm UTC](https://www.ruby-forum.com/t/using-actionwebservice-from-php/146180/1 "2008-08-18T20:05:34Z")

</div>

I have an existing Rails API using ActionWebService that is used for  
billing. I have been given a site written in PHP that accepts billing  
information and now needs to submit this information to the  
ActionWebService API. I need to know how I can submit billing  
information from the PHP site to the Rails ActionWebService. Any  
insights on how to make this work (links to other places, other  
suggestions, etc.) would be appreciated.

This is the basic wiring of the API:

class CustomerChangeAPI \< ActionWebService::API::Base

class ServerResponse \< ActionWebService::Struct  
member :successful, :bool  
member :error\_message, :string  
end

class NewCustomerResponse \< ServerResponse  
member :uid, :int  
end

class NewCreditCardResponse \< ServerResponse  
member :cardid, :int  
end  
…  
end

api\_method :new\_customer, :expects =\> [{‘company\_name’=\>:string},  
{‘lead\_sourceid’=\>:int}], :returns =\> [NewCustomerResponse]

api\_method :new\_credit\_card, :expects =\> [{‘uid’=\>:int},  
{‘name\_on\_card’=\>:string}, {‘card\_number’=\>:string},  
{‘exp\_date’=\>:date}, {‘billing\_address’=\>:string},  
{‘billing\_zip’=\>:string}, {‘accountid’=\>:int}], :returns =\>  
[NewCreditCardResponse]

end

---

<div class="post-metadata">

**Author:** ![mwalsh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/91b2a8/32.png) [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Post date:** [August 18, 2008, 8:19pm UTC](https://www.ruby-forum.com/t/using-actionwebservice-from-php/146180/2 "2008-08-18T20:19:05Z")

</div>

On 18 Aug 2008, at 19:04, Matt W. wrote:

> I have an existing Rails API using ActionWebService that is used for  
> billing. I have been given a site written in PHP that accepts billing  
> information and now needs to submit this information to the  
> ActionWebService API. I need to know how I can submit billing  
> information from the PHP site to the Rails ActionWebService. Any  
> insights on how to make this work (links to other places, other  
> suggestions, etc.) would be appreciated.
> 
> This is the basic wiring of the API:

Read up on php’s SOAP clients. ActionWebService will generate a wsdl  
for you

Fred

---

<div class="post-metadata">

**Author:** ![mwalsh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/91b2a8/32.png) [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Post date:** [August 19, 2008, 6:34pm UTC](https://www.ruby-forum.com/t/using-actionwebservice-from-php/146180/3 "2008-08-19T18:34:48Z")

</div>

On 19 Aug 2008, at 17:15, Matt W. wrote:

> > > billing. I have been given a site written in PHP that accepts  
> > > for you
> > 
> > Fred
> 
> Excuse my ignorance but how do I get ActionWebService to generate the  
> WSDL? Any simple examples that I can see somewhere? Thanks.

go to localhost:3000/customer\_change/wsdl (assuming the corresponding  
controller is customer\_change)

Fred

---

<div class="post-metadata">

**Author:** ![mwalsh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/91b2a8/32.png) [@mwalsh](https://www.ruby-forum.com/u/mwalsh)\
**Post date:** [August 19, 2008, 6:16pm UTC](https://www.ruby-forum.com/t/using-actionwebservice-from-php/146180/4 "2008-08-19T18:16:35Z")

</div>

On Aug 18, 12:17 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > suggestions, etc.) would be appreciated.
> 
> > This is the basic wiring of the API:
> 
> Read up on php’s SOAP clients. ActionWebService will generate a wsdl  
> for you
> 
> Fred

Excuse my ignorance but how do I get ActionWebService to generate the  
WSDL? Any simple examples that I can see somewhere? Thanks.
