Ruby Forum Ruby on Rails > Using ActionWebService from PHP

Posted by Matt White (Guest)
on 18.08.2008 20:05
(Received via mailing list)
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
Posted by Frederick Cheung (Guest)
on 18.08.2008 20:19
(Received via mailing list)
On 18 Aug 2008, at 19:04, Matt White 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
Posted by Matt White (Guest)
on 19.08.2008 18:16
(Received via mailing list)
On Aug 18, 12:17 pm, Frederick Cheung <frederick.che...@gmail.com>
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.
Posted by Frederick Cheung (Guest)
on 19.08.2008 18:34
(Received via mailing list)
On 19 Aug 2008, at 17:15, Matt White 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