我正在编写一个powershell脚本,每隔10分钟就会对一个soap webservice进行ping操作,以保持它的热度和活力,从而提高性能.我们已经在IIS中尝试了许多技术,其中包括应用程序池空闲超时以及为wsdl创建http req.但似乎我们必须向sql服务器发出真正的请求,否则空闲90分钟将使其对要求变慢.
我必须构建一个相当复杂的搜索对象,以便能够进行智能搜索,以保持服务层缓存和热.肥皂请求应如下所示:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fund="http://www.example.com/cmw/fff/fund" xmlns:tcm="http://www.example.com/cmw/fff/">
<soapenv:Body>
<fund:Get>
<!--Optional:-->
<fund:inputDTO>
<fund:Fund>
<fund:Identity>
<fund:Isin>SE9900558666</fund:Isin>
<fund:FundBaseCurrencyId>SEK</fund:FundBaseCurrencyId>
</fund:Identity>
</fund:Fund>
<fund:InputContext>
<tcm:ExtChannelId>Channelman</tcm:ExtChannelId>
<tcm:ExtId>Rubberduck</tcm:ExtId>
<tcm:ExtPosReference>Rubberduck</tcm:ExtPosReference>
<tcm:ExtUser>Rubberduck</tcm:ExtUser>
<tcm:LanguageId>809</tcm:LanguageId>
</fund:InputContext>
</fund:inputDTO>
</fund:Get>
</soapenv:Body>
</soapenv:Envelope>`
Run Code Online (Sandbox Code Playgroud)
我尝试使用New-WebServiceProxy,它在powershellguy的这个例子中非常优雅.我从technet构建我自己的对象作为这个例子.
到目前为止我尝试过的powershell代码是这样的:
$fundSrvc = New-WebServiceProxy -uri http://myColdServer:82/WSFund.svc?wsdl -NameSpace "tcm"
# all the type are now defined since we called New-WebServiceProxy they are prefixed
# with ns tcm
[tcm.FundInput] $myFundGoofer = new-object tcm.FundInput
[tcm.Fund] $myFund = new-object tcm.Fund
[tcm.Context] $myInputContext = new-object tcm.Context
[tcm.FundIdentity] $myFundIdentity = …Run Code Online (Sandbox Code Playgroud)