Solved

Error when I try my server php

Posted on 2016-08-10
6
75 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 58

Accepted Solution

by:
Julian Hansen earned 250 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 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 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
WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

 
LVL 1

Author Closing Comment

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

Expert Comment

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

Expert Comment

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses how to create an extensible mechanism for linked drop downs.
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 count occurrences of each item in an array.

630 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