PEAR::Missing content type response when using attachment
| From: | Nicolas Maurent | Date: | Wed, 13 Nov 2002 10:24:12 +0000 |
| Subject: | PEAR::Missing content type response when using attachment | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-300@lists.php.net to get a copy of this message | ||
Hi,
I tried to make a SOAP request with a MIME attachment, but the SOAP server
always replies with the following fault (Missing content type):
INCOMING
HTTP/1.1 500 Server Error
Server: Netscape-Enterprise/6.0
Date: Wed, 13 Nov 2002 08:50:33 GMT
Content-length: 461
Content-Type: text/xml; charset=utf-8
Set-Cookie:
JSESSIONID=9SSZqqJzauQOBcd1or7CGEIy3s2ZVYoodpddSErK1WOKmvr1vKc7!-855779458!1
053981868!7000!7222!NONE; path=/
Cache-control: no-cache="set-cookie"
Connection: close
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Protocol</faultcode>
<faultstring>Missing content type.</faultstring>
<faultactor>/soap/SOAPRPCRouterServlet/</faultactor>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The SOAP request i sent is the following one:
OUTGOING:
POST /soap/SOAPRPCRouterServlet/ HTTP/1.0
User-Agent: PEAR-SOAP 0.7.0
Host: [ my host ]
Content-Type: multipart/related; type=text/xml;
boundary="=_c36a52927b165bf98dd43a330ba43581"
Content-Length: 1447
SOAPAction: ""
--=_c36a52927b165bf98dd43a330ba43581
Content-Type: text/xml; charset="UTF-8"
Content-Transfer-Encoding: base64
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCg0KPFNPQVAtRU5WOkVudmVs
b3BlICB4bWxuczpTT0FQLUVOVj0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvc29hcC9lbnZl
bG9wZS8iDQogeG1sbnM6eHNkPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSINCiB4
bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIg0KIHht
bG5zOlNPQVAtRU5DPSJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy9zb2FwL2VuY29kaW5nLyIN
CiB4bWxuczpuczQ9InVybjpUcmlwRmxvdyINCiBTT0FQLUVOVjplbmNvZGluZ1N0eWxlPSJodHRw
Oi8vc2NoZW1hcy54bWxzb2FwLm9yZy9zb2FwL2VuY29kaW5nLyI+DQo8U09BUC1FTlY6Qm9keT4N
Cg0KPG5zNDpwcm9jZXNzPg0KPGl0ZW0gaHJlZj0iY2lkOjNhNjcxYTQ2YTgyYmVlZWU0MmU5ZjA4
MzAxYjZiMzRjIi8+PC9uczQ6cHJvY2Vzcz4NCjwvU09BUC1FTlY6Qm9keT4NCjwvU09BUC1FTlY6
RW52ZWxvcGU+DQo=
--=_c36a52927b165bf98dd43a330ba43581
Content-Disposition: attachment.xml
Content-Type: text/plain
Content-Transfer-Encoding: base64
Content-ID: <3a671a46a82beeee42e9f08301b6b34c>
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPENvbnN1bHRJbnB1
dD4NCgk8VFJBTlNBQ1RJT05fSUQ+Q29uc3VsdDwvVFJBTlNBQ1RJT05fSUQ+DQoJPFNJVEU+TEk0
PC9TSVRFPg0KCTxMQU5HVUFHRT5HQjwvTEFOR1VBR0U+DQoJPFBBUkFNRVRFUj5TSVRFX0FERF9E
QVRFX0ZPUk1BVDwvUEFSQU1FVEVSPg0KCTxMSVNUPk5PX1NMX0FJUkxJTkVfREVTQ1JJUFRJT048
L0xJU1Q+DQoJPEVSUk9SPjEwPC9FUlJPUj4NCgk8UkVTT1VSQ0U+MDwvUkVTT1VSQ0U+DQo8L0Nv
bnN1bHRJbnB1dD4NCg==
--=_c36a52927b165bf98dd43a330ba43581--
The source code i use is the following one:
<?php
require_once('SOAP/Client.php');
$filename = 'attachment.xml';
$v = new SOAP_Attachment('','text/plain',$filename);
$methodValue = new SOAP_Value('process', 'Struct', array($v));
$client = new SOAP_Client('[my SOAP RPC router servlet]');
$resp = $client->call('process',array($v),
array('Attachments'=>'Mime',
'namespace'=>'[my urn]'));
?>
Can anyone give me some help to resolve this problem ?
Thks for your help.
Nicolas.