简体   繁体   English

Powershell模块未调用CustomSoapExtension

[英]Powershell module not calling CustomSoapExtension

I have a custom dll (CustomSoapExtension.dll) that I use in another webservice client (a web page) that inserts a username/password into the soap stream for authentication. 我有一个自定义的dll(CustomSoapExtension.dll),我在另一个Web服务客户端(一个网页)中使用该DLL,将用户名/密码插入到肥皂流中进行身份验证。 It has been awhile since I created that project so I am not sure I completed all of the appropriate steps to get it working in this powershell module. 自从我创建该项目以来已经有一段时间了,所以我不确定我是否完成了所有适当的步骤才能使其在此Powershell模块中工作。

I have added the reference to the project. 我已将引用添加到项目中。 I have added this section to the app.config 我已将此部分添加到app.config

    <system.web>
    <webServices>
        <soapExtensionTypes>
            <add type="CustomSoapExtension.CustomSoapExtension,CustomSoapExtension" group="High" priority="1"/>
        </soapExtensionTypes>
    </webServices>
</system.web>

I am calling the webservice, but the custom header information is not present. 我正在调用Web服务,但是自定义标头信息不存在。 I'm sure it is something simple that I overlooked. 我敢肯定,这是我忽略的简单事情。

C#, Visual Studio 2k8 C#,Visual Studio 2k8

thanks in advance. 提前致谢。

If you're loading this DLL as a binary module in powershell, the app.config needs to be powershell.exe.config alongside the powershell.exe executable. 如果您要将此DLL作为二进制模块加载到powershell中,则app.config必须与powershell.exe可执行文件一起为powershell.exe.config。 This is impractical for most scenerios as powershell's home folder is under the windows root and the config would also be shared amongst all users of the machine. 对于大多数场景而言,这是不切实际的,因为powershell的主文件夹位于Windows根目录下,并且配置也将在计算机的所有用户之间共享。 Consider adding the soap extension programmatically in the module binary instead. 考虑改为以编程方式在模块二进制文件中添加soap扩展。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM