0

私はこれについてしっかりした答えを探しましたが、見つけられませんでした。

私はSOAPも初めてですが、PHPには非常に精通しています。

CURL を使用して SOAP リクエストを送信すると、レスポンスは次のように返されます。

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetFeatureResponse xmlns="http://www.supportsite.com/webservices/">
  <GetFeatureResult>**string**</GetFeatureResult>
</GetFeatureResponse>
</soap:Body>
</soap:Envelope>

->GetFeatureResult 'string' を XML なしで MySQL データベースに保存する必要があります。私が試みるすべては空白を返します。これが私が今使っているものです:

$result = curl_exec($curl);
curl_close ($curl);

$resultXML = simplexml_load_string($result);


$item = $resultXML->GetFeatureResponse->GetFeatureResult;
4

1 に答える 1

1

PHP にはSOAP クライアントが組み込まれています。それはずっと簡単です。適切な WSDL ファイルを指している限り、すぐに使用できる PHP オブジェクトが返されます。

編集:私が周りに持っていた例を掘り起こしました...

  $sc = new SoapClient($wsdl, array(
    'location' => "https://$host:$port/path/",
    'login' => $user,
    'password' => $pass
  ));

  //$sc will now contain methods (maybe properties too) defined by the WSDL file
  //Getting the info you need could be as easy as
  $info = $sc->getInfo(array('parameter'=>'value'));
于 2013-08-02T20:12:54.360 に答える