I found how to do it:
My Webservice has some methods, some with and some without parameters. But there's a problem with consuming ASP.Net web services, but ill explain later.
I designed it so i could return DataSets for .Net clients and XMLDataDocument for non . Net clients like PHP.
These are 2 of the functions
VB Code:
<WebMethod(Description:="Returns a DataSet, usefull if coding in .Net; Params Example: @id=1234567890;@abc=12345")> _
Public Function execProcedureAsDataSet(ByVal ProcNaam As String, ByVal params As String) As Data.DataSet
Dim dSet As New Data.DataSet("OK")
//Fill DataSet here
Return dSet
End Function
VB Code:
<WebMethod(Description:="Returns a XMLDataDocument, usefull if coding in other language; Params Example: @id=1234567890;@abc=12345")> _
Public Function execProcedureAsXmlDataDocument(ByVal ProcNaam As String, ByVal params As String) As System.Xml.XmlDataDocument
Return New System.Xml.XmlDataDocument(execProcedureAsDataSet(ProcNaam, params))
End Function
As you can see its one line of code, to change a dataset into a readable format for non .Net clients.
Now for some code to consume a ASP.Net webservice from a PHP client, using nusoap.
With parameters:
Code:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php
require_once('lib\nusoap.php');
$wsdl="http://localhost/nDP/Service.asmx?WSDL";
$client=new soapclient($wsdl,true);//'wsdl'
$param=array('parameters'=>array('ProcNaam'=>'Obj_Kaart','params'=>'@kaart=1'));
$res = $client->call('execProcedureAsXmlDataDocument',$param);
echo "<pre>";
var_dump($res);
echo "</pre>";
?>
</body>
</html>
Without parameters:
Code:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php
require_once('lib\nusoap.php');
$wsdl="http://localhost/nDP/Service.asmx?WSDL";
$client=new soapclient($wsdl,true);//'wsdl'
$res = $client->call('getProcedureListAsXmlDataDocument');
echo "<pre>";
var_dump($res);
echo "</pre>";
?>
</body>
</html>
As you can see the param variable is an array within an array, apperantly an ASP.Net webservice wants it this way.(Cost me a day to figure it out)
Well i hope i saved someone else a lot of work.
Cheers Figa