Sunday, September 28, 2008

Using cURL for SOAP

How to issue a SOAP request (to Sonoa's ServiceNet) using cURL from the command line:

shell command:
curl \
-H "SOAPAction: urn:getCustomerDetails" \
-H "Content-Type: text/xml" \
-d "@getCustomerDetails.xml" \
http://192.168.96.132:8080/samples/services/CustomerInfoService
where getCustomerDetails.xml is a file in the current directory.

getCustomerDetails.xml:
xmlns:soapenv=
"http://schemas.xmlsoap.org/soap/envelope/"
xmlns:cus=
"http://www.sonoasystems.com/schemas-samples/2007/1/26/customer">
12
shell output:
xmlns:soapenv=
"http://schemas.xmlsoap.org/soap/envelope/">
xmlns=
"http://www.sonoasystems.com/schemas-samples/2007/1/26/customer">
12
City 12
USA
Name 12
CA
Street 12
Zip 12

Thursday, September 25, 2008

ExpressionEngine Category for Entry

I wanted to display the category of an entry so that the end result would look like the following, where Ruby on Rails is the category:

RUBY ON RAILS
Scaling ActiveRecord
Thursday September 25, 2008 at 10:26pm

I couldn't find any examples, but the snippets in TextMate helped me out. Here is the code:

{exp:weblog:entries weblog="posts"}
{categories weblog="posts"}
{category_name}
{/categories}
{gmt_entry_date format="%l %F %d, %Y at %g:%i%a"}
{/exp:weblog:entries}