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

[eluser]Cannyp[/eluser]
Hi there,

I've been struggling with getting NuSOAP integrated with CI in the way I would like.

I have got it working as described on the full example with Xajax (not using the Xajax part) but this is going to break the .NET clients that connect to me I think.

The way I have used NuSOAP before is to define/register all my functions and complex types in one script like so.

Code:
$server = new nusoap_server;
$NAMESPACE = 'http://my.namespace.com/';
$server->configureWSDL('SERVER','http://my.namespace.com/server_xsd/');
$server->wsdl->schemaTargetNamespace = 'http://my.namespace.com/server_xsd/';

$server->wsdl->addComplexType(
    'MyType1',
    //snip for brevity
);

$server->wsdl->addComplexType(
    'MyType2',
    //snip for brevity
);

$server->register('MyFunction1',
    array('id'=>'xsd:int'),
    array('return'=>'tns: MyType1'),$NAMESPACE);

$server->register('MyFunction2',
    array('id'=>'xsd:int'),
    array('return'=>'tns:MyType2'),$NAMESPACE);


function MyFunction1($id)
{
    $row["name"] = "test";
    return $row;
}

function MyFunction2($id)
{
    $row["name2"] = "test2";
    return $row;
}

$server->service($HTTP_RAW_POST_DATA);

//End Server
Then, in the client, in code (using NuSOAP) I would do:
Code:
$client = new nusoapclient("http://my.domain.com/server.php?wsdl",'wsdl');
$result = $client->call("MyFunction1", 123);

//End Client

This is similar to the way it get's called in .NET also. However, with the method described in the tutorial, It seems I cannot use the wsdl and need to point the client code to the individual functions defined on the server - which have been wrapped up in a nested function. What this means for the .NET clients is they will have to point to the wsdl for each function I have defined on my server - .NET provides a utility which generates all the C# stub code so this would generate a file for each function whereas before they just point to the server, it generates one file with all info in that file which they then import into their project. So all they require is the URL of the WSDL and it takes care of everything else, where as in this method they need to know they function names of the wrapper functions in CI. (At least thats my understanding of it so far but please point me in the right direction if im wrong here)

Is there anyway to get NuSOAP working with CodeIgniter as described above?

thanks.
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