I am trying to post a test transaction to the Forms as a Service for the first time, and I am getting a Timeout error. I am posting from a secure URL, but after hanging for a few seconds, the web service returns with a Timeout Error. No other details are given or indications of why it timed out. So I'm pretty clueless as to what I am doing wrong. Can someone please look at this see if there is something wrong with how I am posting to it?
I'm going to include the server logs output and a code snippet below.
First, here are the server logs. I am writing out the actual XML that is being posted to the console, and you see the Timeout Error at the bottom:
2013-04-30T16:10:26.349084+00:00 app[web.2]: '<CnPAPI xmlns="urn:APISchema.xsd">
2013-04-30T16:10:26.349084+00:00 app[web.2]: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2013-04-30T16:10:26.349084+00:00 app[web.2]: XML to post:
2013-04-30T16:10:26.349084+00:00 app[web.2]: <Engine>
2013-04-30T16:10:26.349084+00:00 app[web.2]: <Request>
2013-04-30T16:10:26.349084+00:00 app[web.2]: <Operation>
2013-04-30T16:10:26.349084+00:00 app[web.2]: <Version>12</Version>
2013-04-30T16:10:26.349084+00:00 app[web.2]: <OperationType>Transaction</OperationType>
2013-04-30T16:10:26.349084+00:00 app[web.2]: Going to post to: https://paas.cloud.clickandpledge.co...rvice.svc?wsdl
2013-04-30T16:10:26.349084+00:00 app[web.2]: <IPAddress>75.115.250.126</IPAddress>
2013-04-30T16:10:26.349404+00:00 app[web.2]: <Authentication>
2013-04-30T16:10:26.349404+00:00 app[web.2]: <AccountGuid>[MyGUID]</AccountGuid>
2013-04-30T16:10:26.349404+00:00 app[web.2]: </Operation>
2013-04-30T16:10:26.349404+00:00 app[web.2]: </Authentication>
2013-04-30T16:10:26.349404+00:00 app[web.2]: <Order>
2013-04-30T16:10:26.349404+00:00 app[web.2]: <AccountID>[MyAccountID]</AccountID>
2013-04-30T16:10:26.349404+00:00 app[web.2]: <CardHolder>
2013-04-30T16:10:26.349404+00:00 app[web.2]: <BillingFirstName>Arin</BillingFirstName>
2013-04-30T16:10:26.349404+00:00 app[web.2]: <OrderMode>Test</OrderMode>
2013-04-30T16:10:26.349404+00:00 app[web.2]: <BillingInformation>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingEmail>[email protected]</BillingEmail>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingAddress>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingAddress1>Post Office Box 1000</BillingAddress1>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingMI>W</BillingMI>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingAddress2></BillingAddress2>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingLastName>Sime</BillingLastName>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingAddress3></BillingAddress3>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <BillingCountryCode>840</BillingCountryCode>
2013-04-30T16:10:26.349654+00:00 app[web.2]: </BillingInformation>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingCity>Blacksburg</BillingCity>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <BillingStateProvince>VA</BillingStateProvince>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <PaymentMethod>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <PaymentType>CreditCard</PaymentType>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingPhone>123.456.7890</BillingPhone>
2013-04-30T16:10:26.349903+00:00 app[web.2]: </BillingAddress>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <NameOnCard>Arin Sime</NameOnCard>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <Cvv2>123</Cvv2>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <CardNumber>4111111111111111</CardNumber>
2013-04-30T16:10:26.350156+00:00 app[web.2]: </PaymentMethod>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <BillingPostalCode>12346-4563</BillingPostalCode>
2013-04-30T16:10:26.350156+00:00 app[web.2]: <ExpirationDate>04/15</ExpirationDate>
2013-04-30T16:10:26.350156+00:00 app[web.2]: </CreditCard>
2013-04-30T16:10:26.350156+00:00 app[web.2]: <OrderItemList>
2013-04-30T16:10:26.350156+00:00 app[web.2]: </CardHolder>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <CreditCard>
2013-04-30T16:10:26.350400+00:00 app[web.2]: <UnitDeductible>1000</UnitDeductible>
2013-04-30T16:10:26.350400+00:00 app[web.2]: </OrderItem>
2013-04-30T16:10:26.350156+00:00 app[web.2]: <OrderItem>
2013-04-30T16:10:26.350156+00:00 app[web.2]: <Quantity>1</Quantity>
2013-04-30T16:10:26.350156+00:00 app[web.2]: <UnitPrice>1000</UnitPrice>
2013-04-30T16:10:26.350400+00:00 app[web.2]: <Receipt>
2013-04-30T16:10:26.350400+00:00 app[web.2]: <SendReceipt>true</SendReceipt>
2013-04-30T16:10:26.350156+00:00 app[web.2]: <ItemID>1</ItemID>
2013-04-30T16:10:26.350400+00:00 app[web.2]: </OrderItemList>
2013-04-30T16:10:26.350156+00:00 app[web.2]: <ItemName>Donation</ItemName>
2013-04-30T16:10:26.350400+00:00 app[web.2]: <WID>[MyWID]</WID>
2013-04-30T16:10:26.350400+00:00 app[web.2]: <Transaction>
2013-04-30T16:10:26.350400+00:00 app[web.2]: </Receipt>
2013-04-30T16:10:26.350645+00:00 app[web.2]: <TotalDeductible>1000</TotalDeductible>
2013-04-30T16:10:26.350645+00:00 app[web.2]: <Total>1000</Total>
2013-04-30T16:10:26.350400+00:00 app[web.2]: <TransactionType>Authorize</TransactionType>
2013-04-30T16:10:26.350645+00:00 app[web.2]: </CurrentTotals>
2013-04-30T16:10:26.350645+00:00 app[web.2]: </Transaction>
2013-04-30T16:10:26.350400+00:00 app[web.2]: <CurrentTotals>
2013-04-30T16:10:26.350645+00:00 app[web.2]: </Order>
2013-04-30T16:10:26.350645+00:00 app[web.2]: </Request>
2013-04-30T16:10:26.350645+00:00 app[web.2]: </CnPAPI>'
2013-04-30T16:10:26.350645+00:00 app[web.2]: </Engine>
2013-04-30T16:09:58.170161+00:00 heroku[router]: at=info method=GET path=/list/AHIP/39 host=www.wishlisting.org fwd="67.51.76.53" dyno=web.1 connect=2ms service=71ms status=200 bytes=14645
2013-04-30T16:11:26.426943+00:00
app[web.2]: app/controllers/donations_controller.rb:150:in `create'
2013-04-30T16:11:26.426943+00:00 app[web.2]:
2013-04-30T16:11:26.426943+00:00 app[web.2]: Timeout::Error (Timeout::Error):
2013-04-30T16:11:26.426943+00:00 app[web.2]:
2013-04-30T16:11:26.426943+00:00 app[web.2]:
2013-04-30T16:11:26.426943+00:00 app[web.2]: app/controllers/donations_controller.rb:150:in `block in create'
2013-04-30T16:11:26.427217+00:00 app[web.2]: Completed 500 Internal Server Error in 60089ms
2013-04-30T16:11:26.427217+00:00 app[web.2]: Processing by DonationsController#create as HTML
Now, here is the Ruby code that I am using to make the post (note that I am using some hardcoded values in the XML right now):
#Send the user to the Click and Pledge Form as a Service
url= URI.parse('https://paas.cloud.clickandpledge.com/PaymentService.svc?wsdl')
puts "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
puts "Going to post to: #{url}"
request = Net::HTTP::Post.new(url.path)
request.add_field 'Content-Type', 'application/xml'
request.body = %Q{'<CnPAPI xmlns="urn:APISchema.xsd">
<Version>12</Version>
<Engine>
<Request>
<Operation>
<OperationType>Transaction</OperationType>
<IPAddress>75.115.250.126</IPAddress>
</Operation>
<Authentication>
<AccountGuid>[My guid was here]</AccountGuid>
<AccountID>[my account id was here]</AccountID>
</Authentication>
<Order>
<OrderMode>Test</OrderMode>
<CardHolder>
<BillingInformation>
<BillingFirstName>Arin</BillingFirstName>
<BillingMI>W</BillingMI>
<BillingLastName>Sime</BillingLastName>
<BillingEmail>[email protected]</BillingEmail>
<BillingPhone>123.456.7890</BillingPhone>
</BillingInformation>
<BillingAddress>
<BillingAddress1>Post Office Box 1000</BillingAddress1>
<BillingAddress2></BillingAddress2>
<BillingAddress3></BillingAddress3>
<BillingCity>Blacksburg</BillingCity>
<BillingStateProvince>VA</BillingStateProvince>
<BillingPostalCode>12346-4563</BillingPostalCode>
<BillingCountryCode>840</BillingCountryCode>
</BillingAddress>
<PaymentMethod>
<PaymentType>CreditCard</PaymentType>
<CreditCard>
<NameOnCard>Arin Sime</NameOnCard>
<CardNumber>4111111111111111</CardNumber>
<Cvv2>123</Cvv2>
<ExpirationDate>04/15</ExpirationDate>
</CreditCard>
</PaymentMethod>
</CardHolder>
<OrderItemList>
<OrderItem>
<ItemID>1</ItemID>
<ItemName>Donation</ItemName>
<Quantity>1</Quantity>
<UnitPrice>1000</UnitPrice>
<UnitDeductible>1000</UnitDeductible>
</OrderItem>
</OrderItemList>
<Receipt>
<SendReceipt>true</SendReceipt>
<WID>64906</WID>
</Receipt>
<Transaction>
<TransactionType>Authorize</TransactionType>
<CurrentTotals>
<TotalDeductible>1000</TotalDeductible>
<Total>1000</Total>
</CurrentTotals>
</Transaction>
</Order>
</Request>
</Engine>
</CnPAPI>'}
puts "XML to post:"
puts request.body
response = Net::HTTP.start(url.host, url.port) {|http| http.request(request)}
puts "Response Received:"
puts response.inspect
puts "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
I'm going to include the server logs output and a code snippet below.
First, here are the server logs. I am writing out the actual XML that is being posted to the console, and you see the Timeout Error at the bottom:
2013-04-30T16:10:26.349084+00:00 app[web.2]: '<CnPAPI xmlns="urn:APISchema.xsd">
2013-04-30T16:10:26.349084+00:00 app[web.2]: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2013-04-30T16:10:26.349084+00:00 app[web.2]: XML to post:
2013-04-30T16:10:26.349084+00:00 app[web.2]: <Engine>
2013-04-30T16:10:26.349084+00:00 app[web.2]: <Request>
2013-04-30T16:10:26.349084+00:00 app[web.2]: <Operation>
2013-04-30T16:10:26.349084+00:00 app[web.2]: <Version>12</Version>
2013-04-30T16:10:26.349084+00:00 app[web.2]: <OperationType>Transaction</OperationType>
2013-04-30T16:10:26.349084+00:00 app[web.2]: Going to post to: https://paas.cloud.clickandpledge.co...rvice.svc?wsdl
2013-04-30T16:10:26.349084+00:00 app[web.2]: <IPAddress>75.115.250.126</IPAddress>
2013-04-30T16:10:26.349404+00:00 app[web.2]: <Authentication>
2013-04-30T16:10:26.349404+00:00 app[web.2]: <AccountGuid>[MyGUID]</AccountGuid>
2013-04-30T16:10:26.349404+00:00 app[web.2]: </Operation>
2013-04-30T16:10:26.349404+00:00 app[web.2]: </Authentication>
2013-04-30T16:10:26.349404+00:00 app[web.2]: <Order>
2013-04-30T16:10:26.349404+00:00 app[web.2]: <AccountID>[MyAccountID]</AccountID>
2013-04-30T16:10:26.349404+00:00 app[web.2]: <CardHolder>
2013-04-30T16:10:26.349404+00:00 app[web.2]: <BillingFirstName>Arin</BillingFirstName>
2013-04-30T16:10:26.349404+00:00 app[web.2]: <OrderMode>Test</OrderMode>
2013-04-30T16:10:26.349404+00:00 app[web.2]: <BillingInformation>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingEmail>[email protected]</BillingEmail>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingAddress>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingAddress1>Post Office Box 1000</BillingAddress1>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingMI>W</BillingMI>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingAddress2></BillingAddress2>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingLastName>Sime</BillingLastName>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingAddress3></BillingAddress3>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <BillingCountryCode>840</BillingCountryCode>
2013-04-30T16:10:26.349654+00:00 app[web.2]: </BillingInformation>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingCity>Blacksburg</BillingCity>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <BillingStateProvince>VA</BillingStateProvince>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <PaymentMethod>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <PaymentType>CreditCard</PaymentType>
2013-04-30T16:10:26.349654+00:00 app[web.2]: <BillingPhone>123.456.7890</BillingPhone>
2013-04-30T16:10:26.349903+00:00 app[web.2]: </BillingAddress>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <NameOnCard>Arin Sime</NameOnCard>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <Cvv2>123</Cvv2>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <CardNumber>4111111111111111</CardNumber>
2013-04-30T16:10:26.350156+00:00 app[web.2]: </PaymentMethod>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <BillingPostalCode>12346-4563</BillingPostalCode>
2013-04-30T16:10:26.350156+00:00 app[web.2]: <ExpirationDate>04/15</ExpirationDate>
2013-04-30T16:10:26.350156+00:00 app[web.2]: </CreditCard>
2013-04-30T16:10:26.350156+00:00 app[web.2]: <OrderItemList>
2013-04-30T16:10:26.350156+00:00 app[web.2]: </CardHolder>
2013-04-30T16:10:26.349903+00:00 app[web.2]: <CreditCard>
2013-04-30T16:10:26.350400+00:00 app[web.2]: <UnitDeductible>1000</UnitDeductible>
2013-04-30T16:10:26.350400+00:00 app[web.2]: </OrderItem>
2013-04-30T16:10:26.350156+00:00 app[web.2]: <OrderItem>
2013-04-30T16:10:26.350156+00:00 app[web.2]: <Quantity>1</Quantity>
2013-04-30T16:10:26.350156+00:00 app[web.2]: <UnitPrice>1000</UnitPrice>
2013-04-30T16:10:26.350400+00:00 app[web.2]: <Receipt>
2013-04-30T16:10:26.350400+00:00 app[web.2]: <SendReceipt>true</SendReceipt>
2013-04-30T16:10:26.350156+00:00 app[web.2]: <ItemID>1</ItemID>
2013-04-30T16:10:26.350400+00:00 app[web.2]: </OrderItemList>
2013-04-30T16:10:26.350156+00:00 app[web.2]: <ItemName>Donation</ItemName>
2013-04-30T16:10:26.350400+00:00 app[web.2]: <WID>[MyWID]</WID>
2013-04-30T16:10:26.350400+00:00 app[web.2]: <Transaction>
2013-04-30T16:10:26.350400+00:00 app[web.2]: </Receipt>
2013-04-30T16:10:26.350645+00:00 app[web.2]: <TotalDeductible>1000</TotalDeductible>
2013-04-30T16:10:26.350645+00:00 app[web.2]: <Total>1000</Total>
2013-04-30T16:10:26.350400+00:00 app[web.2]: <TransactionType>Authorize</TransactionType>
2013-04-30T16:10:26.350645+00:00 app[web.2]: </CurrentTotals>
2013-04-30T16:10:26.350645+00:00 app[web.2]: </Transaction>
2013-04-30T16:10:26.350400+00:00 app[web.2]: <CurrentTotals>
2013-04-30T16:10:26.350645+00:00 app[web.2]: </Order>
2013-04-30T16:10:26.350645+00:00 app[web.2]: </Request>
2013-04-30T16:10:26.350645+00:00 app[web.2]: </CnPAPI>'
2013-04-30T16:10:26.350645+00:00 app[web.2]: </Engine>
2013-04-30T16:09:58.170161+00:00 heroku[router]: at=info method=GET path=/list/AHIP/39 host=www.wishlisting.org fwd="67.51.76.53" dyno=web.1 connect=2ms service=71ms status=200 bytes=14645
2013-04-30T16:11:26.426943+00:00
app[web.2]: app/controllers/donations_controller.rb:150:in `create'
2013-04-30T16:11:26.426943+00:00 app[web.2]:
2013-04-30T16:11:26.426943+00:00 app[web.2]: Timeout::Error (Timeout::Error):
2013-04-30T16:11:26.426943+00:00 app[web.2]:
2013-04-30T16:11:26.426943+00:00 app[web.2]:
2013-04-30T16:11:26.426943+00:00 app[web.2]: app/controllers/donations_controller.rb:150:in `block in create'
2013-04-30T16:11:26.427217+00:00 app[web.2]: Completed 500 Internal Server Error in 60089ms
2013-04-30T16:11:26.427217+00:00 app[web.2]: Processing by DonationsController#create as HTML
Now, here is the Ruby code that I am using to make the post (note that I am using some hardcoded values in the XML right now):
#Send the user to the Click and Pledge Form as a Service
url= URI.parse('https://paas.cloud.clickandpledge.com/PaymentService.svc?wsdl')
puts "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
puts "Going to post to: #{url}"
request = Net::HTTP::Post.new(url.path)
request.add_field 'Content-Type', 'application/xml'
request.body = %Q{'<CnPAPI xmlns="urn:APISchema.xsd">
<Version>12</Version>
<Engine>
<Request>
<Operation>
<OperationType>Transaction</OperationType>
<IPAddress>75.115.250.126</IPAddress>
</Operation>
<Authentication>
<AccountGuid>[My guid was here]</AccountGuid>
<AccountID>[my account id was here]</AccountID>
</Authentication>
<Order>
<OrderMode>Test</OrderMode>
<CardHolder>
<BillingInformation>
<BillingFirstName>Arin</BillingFirstName>
<BillingMI>W</BillingMI>
<BillingLastName>Sime</BillingLastName>
<BillingEmail>[email protected]</BillingEmail>
<BillingPhone>123.456.7890</BillingPhone>
</BillingInformation>
<BillingAddress>
<BillingAddress1>Post Office Box 1000</BillingAddress1>
<BillingAddress2></BillingAddress2>
<BillingAddress3></BillingAddress3>
<BillingCity>Blacksburg</BillingCity>
<BillingStateProvince>VA</BillingStateProvince>
<BillingPostalCode>12346-4563</BillingPostalCode>
<BillingCountryCode>840</BillingCountryCode>
</BillingAddress>
<PaymentMethod>
<PaymentType>CreditCard</PaymentType>
<CreditCard>
<NameOnCard>Arin Sime</NameOnCard>
<CardNumber>4111111111111111</CardNumber>
<Cvv2>123</Cvv2>
<ExpirationDate>04/15</ExpirationDate>
</CreditCard>
</PaymentMethod>
</CardHolder>
<OrderItemList>
<OrderItem>
<ItemID>1</ItemID>
<ItemName>Donation</ItemName>
<Quantity>1</Quantity>
<UnitPrice>1000</UnitPrice>
<UnitDeductible>1000</UnitDeductible>
</OrderItem>
</OrderItemList>
<Receipt>
<SendReceipt>true</SendReceipt>
<WID>64906</WID>
</Receipt>
<Transaction>
<TransactionType>Authorize</TransactionType>
<CurrentTotals>
<TotalDeductible>1000</TotalDeductible>
<Total>1000</Total>
</CurrentTotals>
</Transaction>
</Order>
</Request>
</Engine>
</CnPAPI>'}
puts "XML to post:"
puts request.body
response = Net::HTTP.start(url.host, url.port) {|http| http.request(request)}
puts "Response Received:"
puts response.inspect
puts "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
Comment