Posts Tagged: Soap

Symfony Load Twig Template From String

As is always the case with PHP, or open source technology, there’s a gazillion ways to rule the world, or solve a problem. I had a problem with a Symfony app I was building. I needed to load the Twig template from a string variable rather than a file. To do so is easy. All… Read more »

PHP SoapClient Create An Array of Objects

In PHP, you can’t create an array with the same key more than once. You can’t do this. $array[‘transaction’] = “success”; $array[‘transaction’] = “fail”; Obviously, you can DO that, but “fail” will overwrite “success.” But when making Soap calls, it’s often necessary to pass in a structure like this. <users> <user> <firstname>Jamal</firstname> </user> <user> <firstname>Acacia</firstname>… Read more »

PHP Soap Server Repeat the Same Element

In a SOAP service I work on, I needed to generate a response that repeated the same element. Something like this. <SOAP-ENV:Envelope xmlns:SOAP-ENV=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:ns1=”http://www.example.com/WebService/”> <SOAP-ENV:Body> <ns1:getPhoneNumbersResponse> <numbers> <number>123341344</number> <number>329822938</number> </numbers> </ns1:getPhoneNumbersResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Getting this to work in the PHP code took a bit of fussing around. You can’t just create a hash, because the… Read more »

How to Make a SOAP Request with Node.js using raw XML

There are libraries out there that you can use to make SOAP requests from Node.js. But I really just wanted to throw raw XML at my SOAP service. None of the libraries seemed to be able to do that, so I’m using the Node.js http implementation. var http = require(‘http’); var http_options = { hostname:… Read more »

Eclipse Broken Arrow Bug in WSDL Editor

I almost spent a bunch of time on an non-issue. Eclipse is my IDE. I’m currently building a new SOAP service. While messing around with the WSDL, in the WSDL editor graphical mode, I kept seeing a “broken arrow” rather than what I expect. It should look like this. When the arrows aren’t broken, I… Read more »

SOAP Request Generates 500 with Nothing in the Apache or PHP Log

I ran into an odd error to track down. I’ll start off with the fact that I’m not a Soap expert, so this is probably obvious to someone who’s worked with Soap more than myself, but regardless, here’s what happened. I’m setting a new Soap web service, but for some reason I kept getting a… Read more »