Welcome Guest, Not a member yet? Register   Sign In
Nusoap in Code Igniter 1.5.4
#14

[eluser]Cannyp[/eluser]
What I did to get it working was declare all the functions inside the index() function.

E.g.
Code:
<?php

class Soapy extends Controller
{

    function Soapy()
    {
        parent::Controller();    

        $this->load->library('Nusoap');
        $this->load->helper('functions');
        $this->nusoap_server = new nusoap_server();
        $this->nusoap_server->configureWSDL('Soapy',"http://example.com/Soapy_xsd/");
        $this->namespace = "www.example.com";
           $this->nusoap_server->wsdl->schemaTargetNamespace = "http://example.com/Soapy_xsd/";

        $this->nusoap_server->register('Login',
            array('username'=>'xsd:string', 'password' => 'xsd:string'),
            array('return'=>'xsd:string'),$this->namespace);
            
        $this->nusoap_server->register('Test',
            array('id'=>'xsd:int'),
            array('return'=>'xsd:string'),$this->namespace);
    }


    function index()
     {
        if($this->uri->segment(3) == "wsdl")
            $_SERVER['QUERY_STRING'] = "wsdl";
        else
            $_SERVER['QUERY_STRING'] = "";

        function Test($id)
        {
            return "Test Worked: $id";
        }
        
        /*
         * This get's called at the beginning of a session.
         *
         */
        function Login($username, $password)
        {
            $CI =& get_instance();
            // do your login whatever
        }

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


Then if you client has code generation from the WSDL type stuff you can do:
E.g. (with Python)

wsdl2py --url=http://www.example.tv/soap/soapy/wsdl


And then in the file it creates, you need to remove the "/wsdl" from the wsdl URL that it will generate. I hope that makes sense. I have tried this from Python and .NET and it works. This is what I had to do anyway becuase I dont allow ? query params which Nusoap expects.

I can't remember if I had to patch NuSoap to get around the ? problem. Feel free to PM me if that doesnt work and I will send you my nusoap.php file and a link to a live site.

Martin


Messages In This Thread
Nusoap in Code Igniter 1.5.4 - by El Forum - 08-29-2007, 02:58 PM
Nusoap in Code Igniter 1.5.4 - by El Forum - 09-12-2007, 06:42 PM
Nusoap in Code Igniter 1.5.4 - by El Forum - 09-13-2007, 03:10 PM
Nusoap in Code Igniter 1.5.4 - by El Forum - 09-14-2007, 04:54 AM
Nusoap in Code Igniter 1.5.4 - by El Forum - 11-19-2007, 06:31 AM
Nusoap in Code Igniter 1.5.4 - by El Forum - 12-06-2007, 11:59 AM
Nusoap in Code Igniter 1.5.4 - by El Forum - 12-06-2007, 02:27 PM
Nusoap in Code Igniter 1.5.4 - by El Forum - 04-09-2008, 10:13 PM
Nusoap in Code Igniter 1.5.4 - by El Forum - 04-09-2008, 11:28 PM
Nusoap in Code Igniter 1.5.4 - by El Forum - 05-04-2008, 04:34 AM
Nusoap in Code Igniter 1.5.4 - by El Forum - 05-04-2008, 10:34 AM
Nusoap in Code Igniter 1.5.4 - by El Forum - 11-25-2008, 12:56 AM
Nusoap in Code Igniter 1.5.4 - by El Forum - 04-13-2010, 08:31 AM
Nusoap in Code Igniter 1.5.4 - by El Forum - 04-13-2010, 09:09 AM
Nusoap in Code Igniter 1.5.4 - by El Forum - 04-13-2010, 09:13 AM
Nusoap in Code Igniter 1.5.4 - by El Forum - 04-13-2010, 09:21 AM
Nusoap in Code Igniter 1.5.4 - by El Forum - 10-25-2010, 10:57 AM
Nusoap in Code Igniter 1.5.4 - by El Forum - 10-25-2010, 09:39 PM
Nusoap in Code Igniter 1.5.4 - by El Forum - 04-13-2011, 01:57 PM
Nusoap in Code Igniter 1.5.4 - by El Forum - 04-13-2011, 03:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB