来自powershell的肥皂插入请求xml格式

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: $server->register('InsertInDb', 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.

duanhuangyun3887
duanhuangyun3887 这样做然后运行所述代码返回以下错误消息:Execute-SOAPRequest:无法处理参数'SOAPRequest'上的参数转换。无法转换值“<?xmlversion=”1.0“encoding=”utf8“?>
一年多之前 回复
dqp4933
dqp4933 删除转换为[xml]或将$soap.OuterXml传递给函数-SOAP端点期望参数为字符串
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐