add XML mime filter

This commit is contained in:
Andreas Schamberger
2012-01-29 14:38:12 +01:00
parent 7f96a20f66
commit 7819c31644
4 changed files with 104 additions and 4 deletions

View File

@ -21,12 +21,32 @@ class AttachmentRequest extends AttachmentType
{
}
class base64Binary
{
public $_;
public $contentType;
}
class AttachmentType
{
public $fileName;
public $binaryData;
}
class AttachmentRequest extends AttachmentType
{
}
$options = array(
'soap_version' => SOAP_1_1,
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // make sure that result is array for size=1
'trace' => true, // enables use of the methods SoapClient->__getLastRequest, SoapClient->__getLastRequestHeaders, SoapClient->__getLastResponse and SoapClient->__getLastResponseHeaders
'attachment_type' => BeSimpleSoapHelper::ATTACHMENTS_TYPE_MTOM,
'cache_wsdl' => WSDL_CACHE_NONE,
'classmap' => array(
'base64Binary' => 'base64Binary',
'AttachmentRequest' => 'AttachmentRequest',
),
);
/*
@ -42,10 +62,13 @@ $sc = new BeSimpleSoapClient('MTOM.wsdl', $options);
//var_dump($sc->__getTypes());
try {
$b64 = new base64Binary();
$b64->_ = 'This is a test. :)';
$b64->contentType = 'text/plain';
$attachment = new stdClass();
$attachment = new AttachmentRequest();
$attachment->fileName = 'test123.txt';
$attachment->binaryData = 'This is a test.';
$attachment->binaryData = $b64;
var_dump($sc->attachment($attachment));

View File

@ -80,10 +80,10 @@
</binding>
<service name="MTOMSample">
<port name="MTOMSampleSOAP12port_http" binding="tns:MTOMServiceSOAP12Binding">
<soap12:address location="http://192.168.0.104:8080/axis2/services/MTOMSample.MTOMSampleSOAP12port_http/"/>
<soap12:address location="http://localhost:8080/axis2/services/MTOMSample.MTOMSampleSOAP12port_http/"/>
</port>
<port name="MTOMSampleSOAP11port_http" binding="tns:MTOMServiceSOAP11Binding">
<soap:address location="http://192.168.0.104:8080/axis2/services/MTOMSample.MTOMSampleSOAP11port_http/"/>
<soap:address location="http://localhost:8080/axis2/services/MTOMSample.MTOMSampleSOAP11port_http/"/>
</port>
</service>
</definitions>