Re: __doRequest()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for the info, Rob, it helps.  Is there any way to print $request to
see what's actually being sent to the web service?  I'm trying to debug my
request and need to see what's going on since the call to processRequest
fails every time.  I figured since you can load the $request as a DOM
Document, it has to be available to print as well.

Thanks again.



Rob Richards wrote:
> 
> miarde wrote:
>> 1.  Is __doRequest() implicitly called when a new SOAPClient is
>> instantiated
>> or does it need to be explicitly called?  The reason I ask is because I
>> need
>> to extend SOAPClient to add certain parts of the request body using DOM. 
>> Without extending the class, I would do something like:
>> 
>> $wsdl_url = "urlForWSDLHere";
>> $paramArray = array("param1","param2","param3");
>> $client = new SOAPClient();
>> $response = client->processRequest($paramArray);
>> 
>> At what point in the code above is __doRequest() called in SOAPClient?
> 
> It is automatically called during execution of your processRequest() 
> method. It happens after the SOAP message has been assembled and just 
> prior to sending it to the server. This allows you to make modifications 
> before it's sent.
> 
>> 
>> 2.  If I extend the class so that I can modify the request, I assume I'd
>> override __doRequest() - the problem is that I can't find what the
>> arguments
>> could be.  I know __doRequest takes $request, $location, $action, and
>> $version but what exactly are these?  I gather the following:
>> 
>> $request = the actual XML request that I can modify.  Is this sitting in
>> a
>> variable somewhere when I create a new SOAPClient?
> not really as there is no request until you call your method which in 
> turn creates the SOAP message.
> 
>> $location = I assume this is the location of the WSDL file?
> location (URL) of the service.
> 
>> $action = don't know what these values could be
> SOAPAction HTTP request header (depends upon the service you are calling)
> 
>> $version = not sure what these values could be either
> SOAP version (SOAP_1_1 or SOAP_1_2)
> 
> In most cases you would probably just be modifying $request and leaving 
> the rest untouched.
> 
>> The documentation is a little lax so any additional info you could
>> provide
>> is appreciated.  I've seen examples on the net where people are
>> overriding
>> __doRequest but the only part that is ever shown is the overriding class,
>> not the part of code where they show how they're actually using their new
>> class.  Does anyone know of a COMPLETE example of using a class that
>> extends
>> SOAPClient?  Something that expands upon what George has at his site at
>> http://www.schlossnagle.org/~george/blog/index.php?/archives/235-Salesforce.com-and-PHP.html
>> would be very helpful.
> 
> http://www.cdatazone.org/index.php?/pages/source.html
> Take a look at any of the Example Usage of WS-* examples.
> 
> Rob
> 
> -- 
> PHP Soap Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/__doRequest%28%29-tf3424980.html#a9554894
Sent from the Php - Soap mailing list archive at Nabble.com.

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux