2 namespace PayPal\Formatter;
3 class PPSOAPFormatter implements IPPFormatter {
5 private static $SOAP_NAMESPACE = ' xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ';
7 public function toString($request, $options=array()) {
9 $customNamespace = ( $request->getBindingInfo('namespace') != null ) ? $request->getBindingInfo('namespace') : "";
10 $soapEnvelope = '<soapenv:Envelope ' . self::$SOAP_NAMESPACE . " $customNamespace >";
12 $soapHeader = '<soapenv:Header>';
13 if($request->getBindingInfo('securityHeader') != null) {
14 $soapHeader .= $request->getBindingInfo('securityHeader');
16 $soapHeader .= '</soapenv:Header>';
18 $soapBody = '<soapenv:Body>';
19 $soapBody .= $request->getRequestObject()->toXMLString();
20 $soapBody .= '</soapenv:Body>';
22 return $soapEnvelope . $soapHeader . $soapBody . '</soapenv:Envelope>';
25 public function toObject($string, $options=array()) {
26 throw new BadMethodCallException("Unimplemented");