简体   繁体   中英

NLog not generating SOAP when using WebService target in VS 2012, Windows 8

I can't seem to get NLog to work properly on my console application . I'm running VS 2012 on a Windows 8 machine. I've targeted the project to use 4.0 Framework.

Using fiddler, I can see that it is trying to send a message to the target, but it only has header information in the request. There is no SOAP envelope. It should generate the SOAP message based on my parameters but does not.

I've also tried this programatically, but that doesn't work either.

Here is my config:

    <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>

Any ideas?

I was able to get it working by going all the way back to version NLog 1.0 Refresh. I'm still in the 4.0 framework but it works. Still doesn't explain how to get it going in the latest version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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