I am using WAMP & CakePHP, and trying to add a NuSOAP server in the mix. I can generate a dynamic WSDL via NuSOAP, but there is a parameter at the bottom that is being set by NuSOAP, and doesn't make any sense:
<soap:address location="http://localhost/cakephp/app/webroot/index.php"/>
The correct line is:
<soap:address location="http://localhost/cakephp/web_service/web_service"/>
I cannot figure out how to change this, or even where NuSOAP is picking up that location at all (I have absolutely no reference to it in my code).
This is my code that I am using:
class WebServiceController extends AppController {
var $components = array('RequestHandler');
public function web_service()
{
$this->layout = FALSE;
$this->autoRender = FALSE;
Configure::write('debug', 0);
$this->RequestHandler->respondAs('xml');
App::import('Vendor', 'nusoap', array('file' => 'nusoap'.DS.'lib'.DS.'nusoap.php'));
include 'local_functions.php';
if ( !isset( $HTTP_RAW_POST_DATA ) ) $HTTP_RAW_POST_DATA =file_get_contents( 'php://input' );
$server = new soap_server();
$namespace = "http://localhost/web_service/web_service";
$server->configureWSDL("web-service", $namespace);//, "urn:web-service");
$server->wsdl->schemaTargetNamespace = $namespace;
include 'wsdl_types.php';
$server->register("Subscribe", array("accessKey" => "xsd:string","publisher" => "xsd:string","subscribeData" => "xsd:string"), array("return" => "xsd:string"), "urn:web-service", "urn:web-service#Subscribe", "rpc", "encoded", "Subscribe to mail or mobile list(s)");
$server->register("SendEmailFromWeb", array("accessKey" => "xsd:string","publisher" => "xsd:string","sendEmailFromWebData" => "xsd:string"), array("return" => "xsd:string"), "urn:web-service", "urn:web-service#SendEmailFromWeb", "rpc", "encoded", "Send email from web interface");
$server->register("SendEmailFromMobile", array("accessKey" => "xsd:string","publisher" => "xsd:string","sendEmailFromMobileData" => "xsd:string"), array("return" => "xsd:string"), "urn:web-service", "urn:web-service#SendEmailFromMobile", "rpc", "encoded", "Send email from mobile interface");
$server->register("UpdateProfile", array("accessKey" => "xsd:string","publisher" => "xsd:string","updateProfileData" => "xsd:string"), array("return" => "xsd:string"), "urn:web-service", "urn:web-service#UpdateProfile", "rpc", "encoded", "Update subscriber profile (name, etc.)");
$server->register("Unsubscribe", array("accessKey" => "xsd:string","publisher" => "xsd:string","unsubscribeData" => "xsd:string"), array("return" => "xsd:string"), "urn:web-service", "urn:web-service#Unsubscribe", "rpc", "encoded", "Unsubscribe from mail or mobile list(s)");
$server->register("SMSTriggeredEmailNotify", array("accessKey" => "xsd:string","publisher" => "xsd:string","smsTriggeredEmailNotifyData" => "xsd:string"), array("return" => "xsd:string"), "urn:web-service", "urn:web-service#SMSTriggeredEmailNotify", "rpc", "encoded", "Still working on this");
$server->service($HTTP_RAW_POST_DATA);
}
}
I found the answer:
$server->configureWSDL("web-service", $namespace);
Should be:
$endpoint = "http://localhost/web_service/web_service";
$server->configureWSDL("web-service", $namespace, $endpoint);