dongtan7418 2018-12-13 12:39
浏览 83

来自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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog
    • ¥15 Excel发现不可读取的内容
    • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题