i'm trying to make a soap service that is capable of inserting certain values into a microsoft sql database, the server is php and the client calls the server from powershell.
So i have a Soap server setup with NuSOAP and a number of methods, these methods are made like this:
array('query' => 'xsd:string'), // parameter
array('return' => 'xsd:string'), // output
'urn:server', // namespace
'urn:server#helloServer', // soapaction
'rpc', // style
'encoded', // use
'the query you want to execute');
now i can call this method with the following code from the powershell client:
$url = ".../NuSoapServerTest.php?wsdl" $proxy = New-WebServiceProxy $url $proxy | gm -memberType Method $proxy.InsertInDb('Insert into value etc...')
however i want to be able to execute a method like this
$url = ".../NuSoapServerTest.php?wsdl" $soap = [xml]@' <?xml version="1.0" encoding="utf8"?> <soap:Envelope xmlns:xsi=".../NuSoapServerTest.php?wsdl"> <soap:Body> <inventory> <machine> <systemname>example value</systemname> </machine> <hardware> <machine_type>example value</machine_type> </hardware> </inventory> </soap:Body> </soap:Envelope> '@ $ret = Execute-SOAPRequest $soap $url;
with each <'tag'> meaning a layer in the database. i've been looking around the web a lot for examples but as of yet i haven't found any examples that make it clear to me how i can set either the server or client up to execute my methods in the demonstrated way.
Maybe i am misunderstanding the principals of SOAP and how its supposed to work or i'm just being dumb but any help would be appreciated
edit: it might be worth noting this is the first time i am working with powershell.