JeremyDunn / php-fedex-api-wrapper

This library provides a fluid interface for constructing requests to the FedEx web service API.
269 stars 184 forks source link

Export XML Request #208

Closed cambur closed 2 years ago

cambur commented 2 years ago

Hi Jeremy,

When trying to get help from FedEx tech support team I am often asked for the XML request.

Is there a way to export the request to XML? like a toXml() method?

thank you

TheGr8 commented 2 years ago

@cambur , I had the same question a while ago and someone suggested this, which is working for me:

    //This is where you call the service using Jeremy's wrapper (you should already have a similar line in your code).
    $result = $shipService->getProcessShipmentReply($processShipmentRequest);

    /* Dump Request and Response XML */
    $soapClient = $shipService->getSoapClient();
    $requestXML = $soapClient->__getLastRequest();
    $responseXML = $soapClient->__getLastResponse();
    file_put_contents('tmp/request' . $item_seq . '.xml', $requestXML);
    file_put_contents('tmp/response' . $item_seq . '.xml', $responseXML);
github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 years ago

This issue was closed because it has been inactive for 14 days since being marked as stale.