• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with nuSoap library and wsdl XML link call

#1
[eluser]Unknown[/eluser]
I am trying to implement a webservice using nusoap library.

Everything looks fine but I'm not able to see the XML file, if I click on the "View the WSDL for the service" link, it goes to codeigniter default controller.

For example: http://www.chiringocloud.com/webservice/webservice its my url for the codeigniter webservice

Being first webservice the codeigniter project in Apache and the second webservice the webservice controller I am trying to implement.

So If I click on the WSDL link it points to http://www.chiringocloud.com/webservice/index.php?wsdl

I have realised that If I put manually http://www.chiringocloud.com/webservice/...index/wsdl then it shows the xml of all the definitions of my webservice.

I've tried to use routes.php config file as many guides I've checked suggest, but without luck. The entry I use is:
$route['Webservice/obtieneMiembro/wsdl'] = 'Webservice/index/wsdl';

But I don't really know how does routes works or if that is not the problem.

The code of the webservice controller:
Code:
class Webservice extends CI_Controller {
    
    function Webservice() {
        parent::__construct();          
        $this->load->library("nusoap_lib");  
        $this->nusoap_server = new soap_server();
        
        $this->nusoap_server->configureWSDL("MiembroWSDL", "urn:MiembroWSDL");

        $this->nusoap_server->wsdl->addComplexType(
            "Miembro",
            "complexType",
            "array",
            "",
            "SOAP-ENC:Array",
            array(
                "id"=>array("name"=>"id", "type"=>"xsd:int"),
                "nombre"=>array("name"=>"nombre", "type"=>"xsd:string"),
                "apellido"=>array("name"=>"apellido", "type"=>"xsd:string")
            )
         );    

        $this->nusoap_server->register(
            "obtenerMiembro",
            array(
                "id" => "xsd:int",
            ),
            array("return"=>"tns:Miembro"),
            "urn:MiembroWSDL",
            "urn:MiembroWSDL#obtenerMiembro",
            "rpc",
            "encoded",
            "Obtiene la informaci√≥n de un miembro especificado"
        );
    }
        
     function index() {
         if($this->uri->segment(3) == "wsdl") {
            $_SERVER['QUERY_STRING'] = "wsdl";
         } else {
            $_SERVER['QUERY_STRING'] = "";
        }

        $this->nusoap_server->service(file_get_contents("php://input"));
    }

    function obtener_miembro() {
        function obtenerMiembro($idMiembro) {
            $CI =& get_instance();
            
            $CI->load->model("Miembro");
            
            $row = $CI->Miembro->obtenerMiembro($idMiembro);
            
            return $row;
        }
        
        $this->nusoap_server->service(file_get_contents("php://input"));
    }
}


Messages In This Thread
Problems with nuSoap library and wsdl XML link call - by El Forum - 06-16-2011, 05:09 AM
Problems with nuSoap library and wsdl XML link call - by El Forum - 06-29-2011, 12:27 AM
Problems with nuSoap library and wsdl XML link call - by El Forum - 06-29-2011, 01:49 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme ¬© 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.