0
私はこの要求から自分のXML SOAP応答を解析できない理由を理解しようとすると、過去16時間にわたりテーブルの頭を叩いています。私は解決策を見つけることを試みてstackoverflowの向こうを旅してきたし、正しい答えを見つけることができないようです。PHP CURL SOAP XML構文解析ネームスペース警告
私にはおそらく重要な点はありませんが、私はそれを見つけることができません。私は
// converting
$response1 = str_replace('<RegisterMarketResult xmlns:a="http://schemas.datacontract.org/2004/07/Synectic.TheMarket.Domain.Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">',"",$r);
$response2 = str_replace("</RegisterMarketResult>","",$response1);
は私が手
// converting
$response1 = str_replace("<s:Body>","",$r);
$response2 = str_replace("</s:Body>","",$response1);
に変更する場合は、私に
SimpleXMLElement Object ([RegisterMarketResponse] => SimpleXMLElement Object ([RegisterMarketResult] => SimpleXMLElement Object ()))
の応答を与える
//Response From Server
$r = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><RegisterMarketResponse xmlns="http://tempuri.org/"><RegisterMarketResult xmlns:a="http://schemas.datacontract.org/2004/07/Synectic.TheMarket.Domain.Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><a:Cabinets xmlns:b="http://schemas.datacontract.org/2004/07/Synectic.TheMarket.Domain"><b:Cabinet><b:AssetId>1</b:AssetId><b:AssetNumber>001</b:AssetNumber><b:Model>*****</b:Model><b:ModelCategory>Snack</b:ModelCategory><b:Products>2</b:Products></b:Cabinet></a:Cabinets><a:CompanyId>{*****}</a:CompanyId><a:CompanyName>****</a:CompanyName><a:DateCreated>2016-07-16T07:55:15.84</a:DateCreated><a:Id>1</a:Id><a:MarketNumber>****</a:MarketNumber></RegisterMarketResult></RegisterMarketResponse></s:Body></s:Envelope>';
// converting
$response1 = str_replace("<s:Body>","",$r);
$response2 = str_replace("</s:Body>","",$response1);
// convertingc to XML
$parser = simplexml_load_string($response2);
print_r($parser);
Warning: simplexml_load_string(): namespace error : Namespace prefix a on Cabinets is not defined in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
Warning: simplexml_load_string(): nets xmlns:b="http://schemas.datacontract.org/2004/07/Synectic.TheMarket.Domain" in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
Warning: simplexml_load_string():^in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
Warning: simplexml_load_string(): namespace error : Namespace prefix a on CompanyId is not defined in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
Warning: simplexml_load_string(): /b:ModelCategory><b:Products>2</b:Products></b:Cabinet></a:Cabinets><a:CompanyId in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
Warning: simplexml_load_string():^in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
Warning: simplexml_load_string(): namespace error : Namespace prefix a on CompanyName is not defined in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
Warning: simplexml_load_string(): ><a:CompanyId>{*****}</a:CompanyId><a:CompanyName in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
Warning: simplexml_load_string():^in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
Warning: simplexml_load_string(): namespace error : Namespace prefix a on DateCreated is not defined in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
Warning: simplexml_load_string(): ****}</a:CompanyId><a:CompanyName>**</a:CompanyName><a:DateCreated in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
Warning: simplexml_load_string():^in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
Warning: simplexml_load_string(): namespace error : Namespace prefix a on Id is not defined in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
Warning: simplexml_load_string(): e>**</a:CompanyName><a:DateCreated>2016-07-16T07:55:15.84</a:DateCreated><a:Id in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
Warning: simplexml_load_string():^in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
Warning: simplexml_load_string(): namespace error : Namespace prefix a on MarketNumber is not defined in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
Warning: simplexml_load_string(): :DateCreated>2016-07-16T07:55:15.84</a:DateCreated><a:Id>1</a:Id><a:MarketNumber in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
Warning: simplexml_load_string():^in /Applications/XAMPP/xamppfiles/htdocs/untitled/index.php on line 66
object(SimpleXMLElement)#1 (0) { }
これは正しい方向性のようですが、依然として壊れています。
誰かがこの物を解析するのを助けることができますか?