【发布时间】:2018-08-31 15:23:21
【问题描述】:
我有一个XML,我已使用以下PHP 代码将其转换为byteArray:
$xmlStr = file_get_contents('demo2.xml'); // read file to string
$byte_array = unpack('C*', $xmlStr);
echo implode(',', $byte_array) ;
我需要将上面的字节数组传递给文件标记中的下面的肥皂信封。
后端网络服务已经写在.net
<Envelope xmlns="http://example/soap/envelope/">
<Body>
<sample xmlns="http://example.org/">
<User>[string?]</User>
<Password>[string?]</Password>
<File>[anyType?]</File>
</sample>
</Body>
</Envelope>
我正在使用wizdler 拨打服务电话,但我最终收到以下错误:
The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter
The InnerException message was 'Element File from namespace http://example.org/ cannot have child contents to be deserialized as an object.
Please use XmlNode[] to deserialize this pattern of XML.'. Please see InnerException for more details.
在上述场景中,如何将xml 文件作为字节数组 发送?
【问题讨论】:
标签: php .net xml web-services soap