Re: How to deliver Binary Data from SOAP Server to SOAP Client

From: Date: Mon, 18 Oct 2004 06:39:21 +0000
Subject: Re: How to deliver Binary Data from SOAP Server to SOAP Client
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-14935@lists.php.net to get a copy of this message
On Sun, 17 Oct 2004 12:23:20 +0200, Stefan Kisker <stefan@kisker.de> wrote: > Hi, > > ich try to send XML-Data combined with Binary-Files in just one procedure > call, but it will not work. > So this is what i tried: > > The (shortened) public function of the Web Service: > > function doJob($id,$helper,$classname) { > $obj = $this->factory($classname); // just a factory method > $obj->id = $id; > $obj->helper = $helper; > $this->array = $obj->doJob(); > return $this->array; > } > > Building the array with the binary files: > ... > for (){ > ... > $file = new > > SOAP_Attachment($filename,"application/octet-stream",$root.$documents["dir". > [$i]."/".$documents["file"][$i]); > $files[] = $file; > ... > } > ... > The return statement: > > $array['xml'] = $xml; > $array['files'] = $files; > return $array; > > In the soap_fault object i can see that the files have been attached, but > not in the right way. I think the result ist not wellformed. Even > SOAP_Attachment->serialize() has the same result. > I think, transfering binary data has to be a common problem, but i just > found articles about sending attachments to the SOAP server via > SOAP_Attachment. > > Thanks in advance, > > Stefan > I don't know anythnig about SOAP attachments, but you could send it base64encode()d. -- paperCrane --Justin Patrin--

« previous php.pear.general (#14935) next »