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 7010937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:03:49+00:00 2026-05-27T22:03:49+00:00

I’m certain this is a dumb newbie question, but this is the first time

  • 0

I’m certain this is a dumb newbie question, but this is the first time I’m working with SOAP, so I guess I qualify. I’m having a heck of a time trying to load a local WSDL file from within my PHP class. I don’t understand where it is looking for the file or how I can reference it locally. I could put the absolute path using the full website url, but that seems like overkill and it would ONLY work on this site. I’d prefer to reference the file using a relative path.

I’m using PHP with a Magento store. The class that handles communication with the SOAP server is Namespace_Module_Model_Carrier_Fedex_Addressvalidation, which is located at app/code/local/Namespace/Module/Model/Carrier/Fedex/Addressvalidation.php. An instance of this class is instantiated using Mage::getModel('shippingrates/carrier_fedex_addressvalidation') from within the Namespace_Module_Model_Carrier_Fedex class. The WSDL location is defined at the top of the address validation class:

protected $_wsdl = 'AddressValidationService_v2.wsdl';

Within the constructor of the model I initialize the SoapClient:

$this->_client = new SoapClient($this->_wsdl);
$this->_client->__setLocation($this->getServiceLocation());//returns a remote URL for their test server

The file is located in the same directory as the Addressvalidation.php file, but I have also tried locating it in the same directory as the Fedex.php script as well as at app/code/local/ but nothing works. I have tried setting the WSDL variable to ./AddressValidationService_v2.wsdl as well as various other options but I always get an exception like this:

Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from './AddressValidationService_v2.wsdl' : failed to load external entity

If someone can please help me understand the scope and where the SoapClient looks for the files I think I’ll have a better understanding of where to put them and how to reference them.

  • 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-27T22:03:49+00:00Added an answer on May 27, 2026 at 10:03 pm

    Usually the WSDL file points to the URL not to a local file.

    So if you have a web service set up and running on your local PC, this is how you could set up your client for testing:

    <?php
    
    $wsdl = "http://127.0.0.1/api/service.wsdl";
    
    $options = [
        'trace'      => 1,
        'exceptions' => true,
        'cache_wsdl' => WSDL_CACHE_NONE,
    ];
    
    $client = new SoapClient($wsdl, $options);
    
    $return = $client->getDetails([$id = 1234]);
    
    echo "Request headers: " . print_r($client->__getLastRequestHeaders(), 1), "\n";
    echo "Request: " . $client->__getLastRequest(), "\n";
    echo "Response headers: " . print_r($client->__getLastResponseHeaders(), 1), "\n";
    echo "Response: " . $client->__getLastResponse(), "\n";
    

    This is actually from a working PHP script on my computer. I test my own SoapServer this way and it works. “getDetails” is a method defined in WSDL file and it expects one parameter, which I pass as $id.

    The debugging lines are output after the call, which is very helpful to me.

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

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I would like to run a str_replace or preg_replace which looks for certain words
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.