[英]Using SOAP to generate XML attributes in PHP
我發現你可以在php中用SOAP生成這個:
<foo bar="blah">12345</foo>
有了這個:
array("foo" => array("_" => 12345, "bar" => "blah"));
但是,當值不是數字和字符串,而是嵌入的xml代碼時,下划線方法似乎不起作用。 你會怎么做呢?
<foo bar="blah">
<aaa a="b">blah</aaa>
</foo>
這是此人提問的延伸: http : //www.bigresource.com/Tracker/Track-php-uQwDoUib/
我沒有快速的測試方法,但也許這會起作用:
$a = array(
'foo' => array(
'bar' => 'blah',
'aaa' => array(
'_' => 'blah',
'a' => "b",
),
),
);
如何將屬性添加到作為函數的節點;
$update = $soap->UpdateMember($pRecord);
要么
$update = $soap->__soapCall('UpdateMember', array($Updates));
我需要在這里將namescape或xmlns屬性添加到實際的函數名稱中。 我得到以下內容;
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.sample.net/">
<SOAP-ENV:Body>
<ns1:UpdateMember>
MORE XML HERE
</ns1:UpdateMember>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
但是我需要
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.sample.net/">
<SOAP-ENV:Body>
<ns1:UpdateMember xmlns="http://www.sample.net/">
MORE XML HERE
</ns1:UpdateMember>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
需要ns1:UpdateMember xmlns:ns1 =“http://www.sample.net/”或類似的東西。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.