Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/252.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php和带附件的soap_Php_Soap_Attachment - Fatal编程技术网

php和带附件的soap

php和带附件的soap,php,soap,attachment,Php,Soap,Attachment,我对PHP和web服务都是新手。我需要向web服务发送文件,但找不到正确的方法。WS现在将该文件作为java代码中的变量dh,如下所示: QName qnameAttachment = new QName("xsd:ASCII"); call.registerTypeMapping(DataHandler.class, qnameAttachment, JAFDataHandlerSerializerFactory.class, JAFDataHandlerDeserializerFactory

我对PHP和web服务都是新手。我需要向web服务发送文件,但找不到正确的方法。WS现在将该文件作为java代码中的变量dh,如下所示:

QName qnameAttachment = new QName("xsd:ASCII");
call.registerTypeMapping(DataHandler.class, qnameAttachment, JAFDataHandlerSerializerFactory.class, JAFDataHandlerDeserializerFactory.class);
DataHandler dh = new DataHandler(new FileDataSource(this.idh));
然后dh变量被发送到WS-SOAP调用,WS生成以下XML标记:

<dh href="cid:2643CE40EEF7B2F167ED283AE8BC6326" xsi:type="xsd:ASCII"/>
$dh假设一个类似于cnwicubnweiv87723re2的值。 然后我尝试将$dh变量作为普通字符串传递给WS,但结果如下:

<dh> cnwicubnweiv87723re2 </dh>
WS不将变量识别为标记的属性。 我显然错误地将$dh作为普通字符串发送,我不知道如何传递它以让WS知道如何将其用作属性

有人能帮我吗

<dh> cnwicubnweiv87723re2 </dh>