解析curlsoap响应

解析curlsoap响应,curl,soap,response,Curl,Soap,Response,我正在做一个SOAP呼叫(一个特定的商业服务)并得到以下响应 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <ipgapi:IPGApiActionResponse xmlns:ipgapi="http://ipg-online.com/ipgapi/

我正在做一个SOAP呼叫(一个特定的商业服务)并得到以下响应

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
    <SOAP-ENV:Body>
        <ipgapi:IPGApiActionResponse xmlns:ipgapi="http://ipg-online.com/ipgapi/schemas/ipgapi" xmlns:a1="http://ipg-online.com/ipgapi/schemas/a1" xmlns:pay_1_0_0="http://api.clickandbuy.com/webservices/pay_1_0_0/" xmlns:v1="http://ipg-online.com/ipgapi/schemas/v1">
        <ipgapi:successfully>true</ipgapi:successfully>
        <ipgapi:DataStorageItem>
            <a1:CreditCardData>
                <v1:CardNumber>111</v1:CardNumber>
                <v1:ExpMonth>11</v1:ExpMonth>
                <v1:ExpYear>11</v1:ExpYear>
                <v1:Brand>CARD</v1:Brand>
            </a1:CreditCardData>
        </ipgapi:DataStorageItem>
    </ipgapi:IPGApiActionResponse>
</SOAP-ENV:Body>

真的
111
11
11
卡片

这就是,文档建议使用curl进行SOAP调用,到目前为止,我一直在尝试遵循这一建议。以上是我从curl_exec得到的回应。我对SOAP不太熟悉,但这不是一个标准的xml响应,是吗?我不能仅仅用标准方法(simplexml)解析它,对吗


那么,我应该如何着手呢?我可以用preg_match或其他东西“过滤”我需要的数据吗?这是一个可行的解决方案吗?

我用简单的xml实现了这一点:
我在
$curl…

$string = str_replace('ipgapi:', '', $curl);
$string = str_replace('SOAP-ENV:', '', $string);
$return = simplexml_load_string($string);
...
然后解析
$return