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 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
    • ¥15 关于#hadoop#的问题
    • ¥15 (标签-Python|关键词-socket)
    • ¥15 keil里为什么main.c定义的函数在it.c调用不了
    • ¥50 切换TabTip键盘的输入法
    • ¥15 可否在不同线程中调用封装数据库操作的类
    • ¥15 微带串馈天线阵列每个阵元宽度计算
    • ¥15 keil的map文件中Image component sizes各项意思