From: Guillaume - m. <myw...@fr...> - 2003-08-29 23:07:31
|
And ?? Not sure to get the point concerning the purpose (and the benefit) of this mail. Nevertheless It was interesting to try to include it the "standard" (NuSOAP) with a "standard" library and keep the downward compatibility without a huge modification of the original one. Guillaume ----- Original Message ----- From: "Scott Nichol" <sni...@sc...> To: <nus...@li...> Sent: Saturday, August 30, 2003 12:31 AM Subject: Re: [Nusoap-general] SOAP attachment A post from me on 8/22 >>>> I have looked into this patch some more. The good news is the class appears to be the Mail_mime class that's maintained by PEAR. The bad news is that that class appears to only support root objects that are text/plain or text/html. For SOAP, one needs a text/xml root. I can easily do a text/xml attachment, but that does not work for SOAP interop. The patch calls setTXTBody for to set the XML as the root, but the content-type is set to text/plain, which is not interoperable with many SOAP implementations. I am continuing to look at this class, but it may be that it is not suitable for an interoperable SOAP attachment implementation. <<<< Another post that appears to have never made it to the list >>>> Good news: by skipping over Mail_mime and just using Mail_mimePart, I can create the desired payload. <<<< In other words, the code need not *all* be in nusoap.php, as Mail_mimePart provides a lot of useful functionality. From your e-mail >>>> > I discover a *nice* behavior : if you specify as a parameter for creating > the SOAP mesg the filename...the cid:... will be in the payload. cool ! <<<< The correct behavior for SOAP attachments where a parameter references an attachment is to have an element that uses href to refer to the cid, such as <theAttachedFile href="cid:9393829292aa"/> Scott Nichol Do not send e-mail directly to this e-mail address, because it is filtered to accept only mail from specific mail lists. ----- Original Message ----- From: "Guillaume - myWebServices" <myw...@fr...> To: <nus...@li...> Cc: "Scott Nichol" <sni...@sc...> Sent: Friday, August 29, 2003 5:22 PM Subject: Re: [Nusoap-general] SOAP attachment > My version is not fully compliant...because > > [...] A SOAP message package is constructed using the Multipart/Related > media type, which is defined in RFC 2387. The rules for the construction of > SOAP message packages are as follows: > > 1.. The primary SOAP 1.1 message must be carried in the root body part of > the Multipart/Related structure. Consequently the type parameter of the > Multipart/Related media header will always equal the Content-Type header for > the primary SOAP 1.1 message, i.e., text/xml. > [...] > > and the header is text/html due to the mime class. I avoided until now to > modify it but it seems necessary...I hate this because now the version is > linked to NuSOAP...and not standard at all compared to the PEAR repository. > > > $soapclient = new soapclient('http://localhost/server/TestMIME.php?wsdl', > true); > $soap_proxy = $soapclient->getProxy(); > $soap_proxy->addAttachment('E:\temp\\test.txt'); > $soap_proxy->File2File('test.txt'); > > Result: > > MIME-Version: 1.0 > Content-Type: multipart/related; > boundary="=_ffce0859b2c8d8450eee029529df0923" > SOAPAction: "http://athlon/php/php.exe" > Content-Length: 978 > > --=_ffce0859b2c8d8450eee029529df0923 > Content-Type: text/html; charset="ISO-8859-1" > Content-Transfer-Encoding: 7bit > > <?xml version="1.0" encoding="ISO-8859-1"?> > <SOAP-ENV:Envelope > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:si="http://soapinterop.org/xsd" > xmlns:tns="http://mywebservices.free.fr/"> > <SOAP-ENV:Body> > <tns:File2File> > <FileName > xsi:type="xsd:string">cid:3ed89de293faaaf0a1805b9c69070f8c</FileName> > </tns:File2File> > </SOAP-ENV:Body> > </SOAP-ENV:Envelope> > --=_ffce0859b2c8d8450eee029529df0923 > Content-Type: application/octet-stream > Content-Transfer-Encoding: base64 > Content-Disposition: inline; filename="test.txt" > Content-ID: <3ed89de293faaaf0a1805b9c69070f8c> > > SGVsbG8= > --=_ffce0859b2c8d8450eee029529df0923-- > > If I remove it: > > MIME-Version: 1.0 > Content-Type: multipart/related; > boundary="=_dc89a6cb7d85716faec9df1dad60de94" > SOAPAction: "http://athlon/php/php.exe" > Content-Length: 958 > > --=_dc89a6cb7d85716faec9df1dad60de94 > Content-Type: text/html; charset="ISO-8859-1" > Content-Transfer-Encoding: 7bit > > <?xml version="1.0" encoding="ISO-8859-1"?> > <SOAP-ENV:Envelope > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:si="http://soapinterop.org/xsd" > xmlns:tns="http://mywebservices.free.fr/"> > <SOAP-ENV:Body> > <tns:File2File> > <FileName xsi:type="xsd:string">ASimpleParameter</FileName> > </tns:File2File> > </SOAP-ENV:Body> > </SOAP-ENV:Envelope> > --=_dc89a6cb7d85716faec9df1dad60de94 > Content-Type: application/octet-stream > Content-Transfer-Encoding: base64 > Content-Disposition: inline; filename="test.txt" > Content-ID: <eb4f1b8dbe5edd77f6b21b8205f24967> > > SGVsbG8= > --=_dc89a6cb7d85716faec9df1dad60de94-- > > ----- Original Message ----- > From: "Guillaume - myWebServices" <myw...@fr...> > To: <nus...@li...> > Cc: "Scott Nichol" <sni...@sc...> > Sent: Friday, August 29, 2003 9:26 PM > Subject: Re: [Nusoap-general] SOAP attachment > > > > [...] This document defines a binding for a SOAP 1.1 message to be carried > > within a MIME multipart/related message in such a way that the processing > > rules for the SOAP 1.1 message are preserved. [...] > > > > So here the version with no choice!!! > > > > Diff+binary > > > > Guillaume > > > > > > ----- Original Message ----- > > From: "Scott Nichol" <sni...@sc...> > > To: <nus...@li...> > > Sent: Friday, August 29, 2003 8:29 PM > > Subject: Re: [Nusoap-general] SOAP attachment > > > > > > The SOAP Messages with Attachments spec > > (http://www.w3.org/TR/SOAP-attachments) requires multipart/related. There > > is no option. > > > > Scott Nichol > > > > Do not send e-mail directly to this e-mail address, > > because it is filtered to accept only mail from > > specific mail lists. > > ----- Original Message ----- > > From: "Guillaume - myWebServices" <myw...@fr...> > > To: <nus...@li...> > > Cc: "Scott Nichol" <sn...@co...> > > Sent: Friday, August 29, 2003 1:15 PM > > Subject: Re: [Nusoap-general] SOAP attachment > > > > > > > Scott, > > > > > > I re-integrate the change in the current NuSOAP lib (1.57). So you will > > find > > > the diff and also the complete lib. > > > > > > I also fix a bug in my hack. > > > > > > A note: > > > > > > > // true for Mixed, false for Related > > > > $soap_proxy->MultipartType = false; > > > > > > By default, the Multipart Related is used even if you do not specify it > > > explicitly. > > > > > > Guillaume Leleu > > > > > > ----- Original Message ----- > > > From: "Guillaume - myWebServices" <myw...@fr...> > > > To: <nus...@li...> > > > Cc: "Scott Nichol" <sn...@co...> > > > Sent: Friday, August 29, 2003 6:20 PM > > > Subject: [Nusoap-general] SOAP attachment > > > > > > > > > > Finally, > > > > > > > > I modified the NuSOAP version for accepting mixed AND related. The way > > to > > > > use: > > > > > > > > $soapclient = new > > soapclient('http://localhost/server/TestMIME.php?wsdl', > > > > true); > > > > $soap_proxy = $soapclient->getProxy(); > > > > // true for Mixed, false for Related > > > > $soap_proxy->MultipartType = false; > > > > $soap_proxy->addAttachment('C:\\Temp\\mydata.txt'); > > > > $soap_proxy->MyMethod('MyParameter'); > > > > > > > > Scott : You will find enclosed to the mail, the diff and also the > NuSOAP > > > > modified. Please note I did a diff with the last version of NuSOAP > 1.57 > > > and > > > > I developped on the previous version, so the last change you did to > the > > > 1.57 > > > > is seen in my diff (hope this is clear!!!!) > > > > > > > > °-) > > > > > > > > Guillaume > > > > > > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Nusoap-general mailing list > > Nus...@li... > > https://lists.sourceforge.net/lists/listinfo/nusoap-general > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Nusoap-general mailing list > Nus...@li... > https://lists.sourceforge.net/lists/listinfo/nusoap-general > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Nusoap-general mailing list Nus...@li... https://lists.sourceforge.net/lists/listinfo/nusoap-general |