Tuesday, December 30, 2008

working with rails

Sending message:
 
In the Ruby on Rails implementation using Soap4r gem, the SOAP Toolkit  has been
used together with ruby Script Version 1.8.6 . The SOAP Toolkit can be downloaded from http://dev.ctor.org/soap4r.
         The code in ruby is listed here.
require 'rubygems'
gem 'soap4r'
require 'soap/rpc/driver'
require "soap/wsdlDriver"

wsdl_url="http://us.ipx.com/api/services2/SmsApi51?wsdl"
soap = SOAP::WSDLDriverFactory.new(wsdl_url).create_rpc_driver
h=Hash.new
h['originatingAddress']= short_code #provided by ericsson 
h['originatorTON'] = '0' 
h['userDataHeader'] =N
h['DCS'] = '17'
h['PID'] = '-1'
h['relativeValidityTime'] = '-1'
h['deliveryTime'] =N
h['statusReportFlags'] = '0'
h['accountName'] = N
h['tariffClass'] = 'USD0'
h['VAT'] ='-1'
h['referenceId'] = N
h['contentCategory'] =N
h['contentMetaData'] =N
h['username']= USERNAME # provided by IPX
h['password'] = PASSWORD # provided by IPX
h['correlationId'] = sms.correlation_id # set by user sending message
h['destinationAddress'] = sms.destination_address # destination addess
h['userData'] = sms.message #actual message
responce=soap.send(h)
puts responce

You can then find the responce codes and reason code as per the table listed in part 2.
Receiving message:
User have to set the callback url from its IPX account. on which the received message will be forwarded by the IPX. The variables those will be received are listed in part 2 of this blog.
 


No comments: