Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3286354
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:22:13+00:00 2026-05-17T20:22:13+00:00

As per the title, is it possible to output the XML that a new

  • 0

As per the title, is it possible to output the XML that a new SoapClient has created before trying to run a __soapCall() to ensure it’s correct before actually sending it to the SOAP server?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T20:22:14+00:00Added an answer on May 17, 2026 at 8:22 pm

    You could use a derived class and overwrite the __doRequest() method of the SoapClient class.

    <?php
    //$clientClass = 'SoapClient';
    $clientClass = 'DebugSoapClient';
    $client = new $clientClass('http://www.webservicex.com/CurrencyConvertor.asmx?wsdl');
    $client->sendRequest = false;
    $client->printRequest = true;
    $client->formatXML = true;
    
    $res = $client->ConversionRate( array('FromCurrency'=>'USD', 'ToCurrency'=>'EUR') );
    var_dump($res);
    
    class DebugSoapClient extends SoapClient {
      public $sendRequest = true;
      public $printRequest = false;
      public $formatXML = false;
    
      public function __doRequest($request, $location, $action, $version, $one_way=0) {
        if ( $this->printRequest ) {
          if ( !$this->formatXML ) {
            $out = $request;
          }
          else {
            $doc = new DOMDocument;
            $doc->preserveWhiteSpace = false;
            $doc->loadxml($request);
            $doc->formatOutput = true;
            $out = $doc->savexml();
          }
          echo $out;
        }
    
        if ( $this->sendRequest ) {
          return parent::__doRequest($request, $location, $action, $version, $one_way);
        }
        else {
          return '';
        }
      }
    }
    

    prints

    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.webserviceX.NET/">
      <SOAP-ENV:Body>
        <ns1:ConversionRate>
          <ns1:FromCurrency>USD</ns1:FromCurrency>
          <ns1:ToCurrency>EUR</ns1:ToCurrency>
        </ns1:ConversionRate>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    NULL
    

    But you’d have to change the actual code a bit for this to work which I try to avoid when possible (i.e. let tools do the work).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As per title i am trying to measure page performance in IE6 that has
as per the title; is it possible to have nested comments in valid HTML?
As per the title, is this possible? By tri-state, I mean the parent node
As per the title, is it possible to change the first day of the
Is it possible to return querysets that return only one object per foreign key?
As per title, I am simply trying to install pecl_http extension for php in
As per the title, it seems only Chrome isn't playign along. Note that form
As per the title really. If notice that if I check $(elem).css('margin-top') it returns
I am building a quiz that has several questions that have 3 possible choices
As per the title, is it possible to declare type-negating constraints in c# 4

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.