Как декодировать защищенный ответ от HTTP_Request2 в PHP

Я пытаюсь отправить запрос SOAP в базу данных Oracle, используя PHP с пакетом HTTP_Request2. Похоже, я получаю ответ, но это не тот ответ, которого я ожидаю.

Код, который у меня есть для запроса, приведен ниже:

$request = new HTTP_Request2();
        $request->setUrl($wsdl);
        $request->setMethod(HTTP_Request2::METHOD_POST);
        $request->setConfig(array(
          'follow_redirects' => TRUE
        ));
        $request->setHeader(array(
          'Content-Type' => 'text/xml'
        ));
        $request->setAuth('interface', 'Welcome2',);
        $request->setBody('<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/cdm/foundation/parties/customerAccountService/applicationModule/types/" xmlns:typ1="http://xmlns.oracle.com/adf/svc/types/"> <soapenv:Header/> <soapenv:Body> <typ:findCustomerAccount> <typ:findCriteria> <typ1:fetchStart>0</typ1:fetchStart> <typ1:fetchSize>1</typ1:fetchSize> <typ1:filter> <typ1:group> <typ1:item> <typ1:attribute>AccountNumber</typ1:attribute> <typ1:operator>STARTSWITH</typ1:operator> <typ1:value>UAT</typ1:value> </typ1:item> </typ1:group> </typ1:filter> </typ:findCriteria> <typ:findControl> <typ1:retrieveAllTranslations>false</typ1:retrieveAllTranslations> </typ:findControl> </typ:findCustomerAccount> </soapenv:Body> </soapenv:Envelope>');
        try {
          $response = $request->send();
          if ($response->getStatus() == 200) {
            echo $response->getBody();
          }
          else {
            echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
            $response->getReasonPhrase();
          }
        }
        catch(HTTP_Request2_Exception $e) {
          echo 'Error: ' . $e->getMessage();
        }

Если я просто использую метод getBody в своем ответе, я получаю следующий вывод: Вывод изображения здесь

Если я переключаю эхо на var_dump, чтобы лучше понять, что находится в объекте, он становится немного более полезным, прежде чем разбиваться: результаты Var_Dump

0 ответов

Другие вопросы по тегам