astupidname - 9:53 am on Dec 11, 2011 (gmt 0)
Just a couple things I noted here. The xml content you are trying to send, is there a parameter name via which you should be sending it? You have not shown one and without a parameter name the server on the other end will not know where your xml is within POST. So,
curl_setopt($ch, CURLOPT_POSTFIELDS, urlencode($request));
Should most likely be:
curl_setopt($ch, CURLOPT_POSTFIELDS, 'xml='.urlencode($request));
Change 'xml' in the 'xml=' part to the appropriate parameter name which the server on the other end will be expecting to find the xml within.
Then one other thing, add this in to your code:
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/x-www-form-urlencoded'));
Not saying any of that will help with port addressing issues, just things I observed as missing and most likely needed anyways.