Re: [SOAP] problems with sending DIME attachments
| From: | Brodie Thiesfield | Date: | Wed, 16 Jul 2003 01:57:50 +0000 |
| Subject: | Re: [SOAP] problems with sending DIME attachments | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-816@lists.php.net to get a copy of this message | ||
I found the problem - it was both in the client code and a bug in the gSoap server framework.
The client problem was that I had 'text' (the name of the soap element which references the attachment) in the wrong place. I had to move it from the array into the SOAP_Attachment constructor. Like this:
$oDimeAttachment = new SOAP_Attachment( 'text', 'application/octet-stream', '', $a_strText );
$rgParams = array(
'fromLanguage' => $a_strFromLanguage,
'fromEncoding' => $a_strFromEncoding,
'toEncoding' => $a_strToEncoding,
$oDimeAttachment
);
Cheers,
Brodie.
Brodie Thiesfield wrote:
Hi, I'm having some problems sending DIME attachments with PEAR::SOAP 0.7.3 I'm not sure if the problem is at the PEAR::SOAP client or the gSoap server. I would appreciate if someone would have a look at my code to see if I'm doing something wrong. Looking at the data on the wire, there seems to be a DIME message going out, but my server isn't receiving it at all. Below is the function which I am using to call the soap server. $a_strText is to be sent to the server as a DIME attachment, have the data encoding changed to the requested encoding, and then be returned as a DIME attachment. function recode( $a_strFromLanguage, $a_strFromEncoding, $a_strToEncoding, &$a_strText ) {$oDimeAttachment = new SOAP_Attachment( '','application/octet-stream', '', $a_strText );$rgParams = array( 'fromLanguage' => $a_strFromLanguage, 'fromEncoding' => $a_strFromEncoding, 'toEncoding' => $a_strToEncoding, 'text' => $oDimeAttachment ); $oResults = $this->call( 'recode', $rgParams, $this->m_rgSoapParams ); return $oResults;} $this->m_rgSoapParams has the following definition... var $m_rgSoapParams =array( 'namespace' => 'urn:clsoap', 'soapaction' => '', 'style' => 'rpc', 'use' => 'encoded', 'attachments' => 'DIME' );Any help will be much appreciated. Brodie.