-1
使用SoapUI,我從我的webService獲得正確的響應。 但是我有一個異常時,我嘗試從PHPwebservice:將xml轉換爲php數組
這是我的代碼:
$mysoap = new SoapClient($wsdlFile,array('trace' => 1));
$result = $mysoap->__call("Myfunction", array("parameters" => array('Entry' => $Entry,'Parm' => $data)));
這是我的$數據,不正確的是(INFOVALUE)
$data = array('appName' => 'Globe',
'exitUrl' => '' ,
'redirectError' => '',
'sessionId' => '' ,
'addInfo' => array(
'Info'=> array(
'InfoName' => 'CLIENT_LAYOUT',
'InfoValue' => '
<![CDATA[
<cartSession xmlns:ns2="com.camel.business.xml.settingsTree-7.1.0.0" xmlns:ns4="com.camel.business.xml.cameleonTree-7.2.0.0" xmlns:ns3="com.camel.business.xml.configurationTree-7.1.0.0">
<cartSessionSettings>
<operationType>createCart</operationType>
<lazyLoading>YES</lazyLoading>
<cartDomainId>-</cartDomainId>
<cartId>CATALOGUE_ON_LINE</cartId>
<cartRelease>1</cartRelease>
<modelName>Default</modelName>
<modelRelease>1</modelRelease>
<layout>cpqUI</layout>
<language>FR</language>
<currency>EUR</currency>
<targetURL>/cartApp.do</targetURL>
<redirectModeOnClose>inside</redirectModeOnClose>
<userGroup>SalesRep</userGroup>
<userId>admin</userId>
<admin</userName>
<ownerGroup>SalesRep</ownerGroup>
<ownerId>admin</ownerId>
<ownerName>admin</ownerName>
<applyDate>20161020 120000</applyDate>
<initAction name="CatalogList">
<param id="catalogServiceNames" value="CATALOGUE_PRODUITS"/>
</initAction>
</cartSessionSettings>
<customSettings>
</customSettings>
<connectorsData>
<services>
<service id="CATALOGUE_PRODUITS" type="edgeConfigurator">
<param id="CPE.Settings.Session.ModelVersion" value=""/>
</service>
</services>
</connectorsData>
</cartSession>]]>'
)
)
);
我怎麼能轉換「INFOVALUE '在PHP上。
這是INFOVALUE要求,
<ns3:Info> <ns3:InfoNom>CLIENT_LAYOUT</ns3:InfoNom> <ns3:InfoValue> <![CDATA[ <cartSession xmlns:ns2="com.camel.business.xml.settingsTree-7.1.0.0" xmlns:ns4="com.camel.business.xml.camelTree-7.2.0.0" xmlns:ns3="com.camel.business.xml.configurationTree-7.1.0.0"> <cartSessionSettings> <operationType>createCart</operationType> <lazyLoading>YES</lazyLoading> <cartDomainId>-</cartDomainId> <cartId>CATALOGUE_EN_LIGNE</cartId> <cartRelease>1</cartRelease> <modelName>Default</modelName> <modelRelease>1</modelRelease> <layout>cpqUI</layout> <language>FR</language> <currency>EUR</currency> <targetURL>/cartApp.do</targetURL> <redirectModeOnClose>inside</redirectModeOnClose> <userGroup>SalesRep</userGroup> <userId>admin</userId> <userName>The administrator</userName> <ownerGroup>SalesRep</ownerGroup> <ownerId>admin</ownerId> <ownerName>The administrator</ownerName> <applyDate>20161129 120000</applyDate> <initAction name="CatalogList"> <param id="catalogServiceNames" value="CATALOGUE_PRODUITS"/> </initAction> </cartSessionSettings> <customSettings> </customSettings> <connectorsData> <services> <service id="CATALOGUE_PRODUITS" type="edgeConfigurator"> <param id="CPE.Settings.Session.ModelVersion" value=""/> </service> </services> </connectorsData> </cartSession>]]></ns3:InfoValeur>
INFOVALUE沒有逃脫XML代碼remplaced
好的......現在你的問題是什麼? –
我的問題是如何更改或轉換「infoValue」來解釋爲一個php數組 – WebDev
你不知道。它是XML片段(CDATA部分)內的XML字符串,將其作爲字符串讀取並使用XML API來解析它。 – ThW