PHP Web Service Using nusoup give error "error on line 1 at column 2: StartTag: invalid element name" -
i'm learning how create web service using c# , php , c# 1 working php 1 giving me error:
error on line 1 @ column 2: starttag: invalid element name
when click on wsdl, , php client not returning code this:
the server (phpwebservice.php):
<!doctype html> <html> <head> <meta charset="utf-8"> <title>php web service</title> </head> <body> <?php require "lib/nusoap.php"; function myfunction($name){ return $name; } $server = new nusoap_server(); $server->configurewsdl("myphpwebservice","urn:phpwebservice"); $server->register("myfunction",array("name"=>"xsd:string"),array("return"=>"xsd:string")); if(isset($http_raw_post_data)){ $http_raw_post_data = $http_raw_post_data; }else{ $http_raw_post_data = "no name!"; } $server->service($http_raw_post_data) ?> </body> </html>
the client (phpclient.php):
<!doctype html> <html> <head> <meta charset="utf-8"> <title>php web service client</title> </head> <body> <?php require "lib/nusoap.php"; $client = new nusoap_client("http://localhost/phpwebservice/phpwebservice.php?wsdl"); $response = $client->call("name",array("name"=>"emad zedan")); echo $response; ?> </body> </html>
the error seeing because nusoap client trying read html server file outputting.
if remove html phpwebservice.php (i.e. isn't between <?php
?>
tags), error should go away.
Comments
Post a Comment