コンソール アプリケーションで NLog を正しく動作させることができないようです。Windows 8 マシンで VS 2012 を実行しています。プロジェクトで 4.0 Framework を使用するようにしました。
フィドラーを使用すると、ターゲットにメッセージを送信しようとしていることがわかりますが、リクエストにはヘッダー情報しか含まれていません。SOAP エンベロープはありません。パラメータに基づいて SOAP メッセージを生成する必要がありますが、そうではありません。
私もプログラムでこれを試しましたが、それもうまくいきません。
これが私の設定です:
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
</configSections>
<nlog internalLogLevel="Trace" throwExceptions="true" autoReload="true" internalLogFile="C:\TestDocs\Fail.txt" xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="ws" xsi:type="WebService" protocol="Soap11" namespace="http://tempuri.org/" url="http://xxxxxx.com/Services/LogService.asmx" methodName="WriteLog">
<parameter name="appDate" layout="${date}" type="System.String"/>
<parameter name="msg" layout="${message}" type="System.String"/>
</target>
</targets>
<rules>
<logger name="*" writeTo="ws" />
</rules>
</nlog>
何か案は?