The SOAP protocol service-side configuration WSDL has been faulted, ask Daniel for guidance

Source: Internet
Author: User
The SOAP protocol service-side configuration WSDL has been error-seeking, Daniel pointing
This post was last edited by I_bruce on 2014-06-24 10:16:24

The error prompts are as follows,
Fatal error:soap-error:parsing wsdl:couldn ' t find in ' http://test.soaptest.com/soap/Service.php?wsdl ' in/data/app/ www/soaptest/client.php on line 4 call stack:0.0003 324360 1. {main} ()/data/app/www/soaptest/client.php:0 0.0003 324796 2. Soapclient->soapclient ()/data/app/www/soaptest/client.php:4

Client calling code clients
Date_default_timezone_set ("PRC");
Ini_set (' soap.wsdl_cache_enabled ', "0"); Turn off the WSDL cache
$soap = new SoapClient (' http://test.soaptest.com/soap/Service.php?wsdl ');
Echo $soap->add (28, 2);
echo $soap->__soapcall (' Add ', Array (28,2));//or call

Server-side Code service.php

Class Service {

Public Function HelloWorld () {
return "Hello";
}

Public function Add ($a, $b) {
return $a + $b;
}

}
$server = new SoapServer (' service.wsdl ', Array (' soap_version ' = soap_1_2));

$server->handle (); Processing requests
?>

Generate WSDL file create_wsdl.php
Date_default_timezone_set ("PRC");
Include ("service.php");
Include ("SoapDiscovery.class.php");
$disco = new Soapdiscovery (' Service ', ' soap '); The first parameter is the name of the class (the generated WSDL file is named after it), the service class, and the second parameter is the name (which can be written casually).
$disco->getwsdl ();
~


Generating a WSDL file class
 
/**
* Copyright (c) 2005, Braulio Jos? Solano Rojas
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, is
* Permitted provided that the following conditions is met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* Conditions and the following disclaimer.
* redistributions in binary form must reproduce the above copyright notice, this list of
* Conditions and the following disclaimer in the documentation and/or other materials
* Provided with the distribution.
* Neither the name of the Solsoft de Costa Rica S.A. nor the names of its contributors may
* be used to endorse or promote products derived from this software without specific
* Prior written permission.
*
* This software are provided by the COPYRIGHT holders and
* CONTRIBUTORS ' as is ' and any EXPRESS OR implied warranties,
* including, LIMITED to, the implied warranties of
* merchantability and FITNESS for A particular PURPOSE is
* disclaimed. In NO EVENT shall the COPYRIGHT OWNER OR
* CONTRIBUTORS is liable for any DIRECT, INDIRECT, incidental,
* Special, exemplary, OR consequential damages (including, but
* LIMITED to, procurement of substitute GOODS OR SERVICES;
* LOSS of Use, DATA, OR profits; OR business Interruption)
* However caused and on any theory of liability, WHETHER in
* Contract, STRICT liability, or TORT (including negligence OR
* OTHERWISE) arising in any-out-of-the----of this software,
* Even IF advised of the possibility of SUCH DAMAGE.
*
*
* @version $Id: SoapDiscovery.class.php 2013-04-10 07:12:21z IDEAA $
* @copyright 2005
*/

/**
* Soapdiscovery Class that provides Web Service Definition Language (WSDL).
*
* @package Soapdiscovery
* @author Braulio Jos? Solano Rojas
* @copyright Copyright (c) 2005 Braulio Jos? Solano Rojas
* @version $Id: SoapDiscovery.class.php 2013-04-10 07:12:21z IDEAA $
* @access Public
* */
Class Soapdiscovery {

Private $class _name = ";
Private $service _name = ";

/**
* SOAPDISCOVERY::__CONSTRUCT () Soapdiscovery class Constructor.
*
* @param string $class _name
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.