I'm pretty sure WSO2 would help you do what you want to do. They have a bunch of sample code in the scripts that come with the install. I'm not at all sure what you do with the pfx and p7b files but I do know that the WSF/PHP stuff from WSO2 will let you contact a web services XML page and instantiate a proxy object which lets you make function calls to the gateway.
It also supports WS security tokens and SSL.
Beyond that, I don't know a lot about it. I would recommend installing WSF/PHP on your server and looking into some of the example code. WSO2 is also pretty responsive when you post questions on their forum. There are some smart folks over there.
Some code I implented that uses it looks like this:
$policy = new WSPolicy(array(
"security" => array(
"useUsernameToken" => TRUE,
"includeTimeStamp" => TRUE
)
));
$securityToken = new WSSecurityToken(array(
"user" => "sneakyimp",
"password" => "foobar",
"passwordType" => "Digest",
"ttl" => 300
));
$client = new WSClient(array(
"wsdl"=> 'somefile.xml',
"useWSA" => TRUE,
"policy" => $policy,
"securityToken" => $securityToken,
"timeout" => 60
));
$proxy = $client->getProxy();
/* create request obj */
$request = array(
'arg1' => $myarg1,
'arg2' => $myarg2
);
$returnValue = $proxy->bulkImport(array(
"request" => $request,
"param2" => $param2,
"param3" => $param3
));