-3
我使用的API,我得到這樣的回答:如何解析這個SOAP響應
<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
<env:Header>
</env:Header>
<env:Body>
<ns1:processRequestResponse xmlns:ns1='ejb.store.microsoft.com'>
<result>
<?xml version="1.0" encoding="UTF-8"?> <CRMMessage language="en_US" currency="USD" isTrustedSAT="false" hostversion="1.00"><RequestCode>GetCustomer</RequestCode><ResponseCode>A</ResponseCode><ResultSet><ResultSetMetaData><RSColumn name="PrimaryPOSRef" type="string" nullable="true"></RSColumn><RSColumn name="FirstName" type="string" nullable="true"></RSColumn><RSColumn name="LastName" type="string" nullable="true"></RSColumn><RSColumn name="EmailAddress" type="string" nullable="true"></RSColumn><RSColumn name="MobilePhoneNumber" type="string" nullable="true"></RSColumn><RSColumn name="Gender" type="string" nullable="true"></RSColumn><RSColumn name="PostalCode" type="string" nullable="true"></RSColumn><RSColumn name="PMACode" type="string" nullable="true"></RSColumn></ResultSetMetaData><Rows><Row id="11551"><Col>0331200000000058</Col><Col>test</Col><Col>Test</Col><Col>[email protected]</Col><Col>0412345678</Col><Col>M</Col><Col>2000</Col><Col>test</Col></Row></Rows></ResultSet></CRMMessage>
</result>
</ns1:processRequestResponse>
</env:Body>
</env:Envelope>
什麼有用的是我如何解析這個
<result></result>
之間的部分XML?
http://stackoverflow.com/search?q=parse+soap+response+php – Gordon
這不是(有效)的XML,由於該聲明作爲結果元素的子元素。 – Andy