Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Error when I try my server php

Posted on 2016-08-10
6
Medium Priority
?
102 Views
Last Modified: 2016-08-10
Hello guys,

I am studying php soap server, but when I try to run it, I got this message:

"This service does not provide a Web description"

this is my script

<?php
  require_once('lib/nusoap.php');
  
  $servername = "mysql01.teachmenow1.hospedagemdesites.ws";
  $username   = "teachmenow1";
  $password   = "xxxxxxxx";
  $dbnome     = "teachmenow1";  

  $server = new nusoap_server;

  //register a function that works on server
  $server ->register('listadownloads', array('value' => 'xsd:string'), array('return' => 'xsd:string'), 'urn:server', 'urn:server# listadownloads');

  // create the function to fetch Data’s from Database
  function listadownloads ()
  {
          $conn = mysql_connect($servername, $username, $password, false) or print (mysql_error());
          mysql_select_db($dbnome);
		  $sql = "SELECT * FROM CADDOWNLOAD";
		  $retval = mysql_query( $sql, $conn);
          
          $q = mysql_query($sql);

          $items = array();
          while($row = mysql_fetch_array($q))
          {

                $items [] = array(
                              'nome'=>$row['nome'],
                              'cidade'=>$row['cidade']
                           );
          }
          return $items;

   }

  $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
  $server ->service($HTTP_RAW_POST_DATA);
?>

Open in new window



What is wrong? This is my link:

http://www.teachmenow.com.br/nusoap/server.php

Thanks
Alexandre
0
Comment
Question by:hidrau
  • 2
  • 2
  • 2
6 Comments
 
LVL 60

Accepted Solution

by:
Julian Hansen earned 1000 total points
ID: 41750270
Try adding this between line 9 and 12
  $server->configureWSDL("listadownloads");

Open in new window

Also you might want to consider migrating of the mysql library - it has been deprecated in later versions of PHP in favour of mysqli / PDO.
1
 
LVL 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 1000 total points
ID: 41750271
I don't think I can debug this for you, but I can suggest an alternative to SOAP.  I recommend using RESTful client/server methods to communicate between applications.  SOAP has largely been abandoned because of its opaque complexity, and support (when it still exists) is usually relegated to "legacy" status.  REST, on the other hand, is popular, transparent, and easy to understand.  

Here's an introductory article that may help you get started with a RESTful API.
https://www.experts-exchange.com/articles/12239/Introduction-to-Application-Programming-Interfaces.html

Here's some background about how servers communicate.
https://www.experts-exchange.com/articles/11271/Understanding-Client-Server-Protocols-and-Web-Applications.html

Here's why Julian wisely recommends that you get away from MySQL.
https://www.experts-exchange.com/articles/11177/PHP-MySQL-Deprecated-as-of-PHP-5-5-0.html

HTH, ~Ray
1
 
LVL 1

Author Comment

by:hidrau
ID: 41750289
Hello Julian Hansen,

thanks a lot for your example, it worked fine.

Ray Paseur

Thanks a lot for your advice, for me everything is new and the proposal of my task is to make a communication from a desktop aplication and web database to storage data from my application.

My application was developed by delphi tools and now I need that resource, I need to send data to my database and backup them into another application that is another place.

You gave me many thinks to read and check, if I need to invest time, I can do it in right way :)
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Author Closing Comment

by:hidrau
ID: 41750291
Thanks a lot
1
 
LVL 60

Expert Comment

by:Julian Hansen
ID: 41750298
You are welcome.
2
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 41750404
Best of luck with your project!
1

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question