Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Webservice tests with REST api. #699

Merged
7 commits merged into from
May 11, 2015
Merged

Added Webservice tests with REST api. #699

7 commits merged into from
May 11, 2015

Conversation

304NotModified
Copy link
Member

@304NotModified 304NotModified commented May 10, 2015

Added units tests for WebserviceTarget with REST api.

  • httpGet isn't working and throwing an exception. I will create an issue for that. It is skipped for now.
    Error:


 Result Message:    System.Net.ProtocolViolationException : Cannot send a content-body with this verb-type.
 Result StackTrace: 
 at System.Net.HttpWebRequest.CheckProtocol(Boolean onRequestStream)
    at System.Net.HttpWebRequest.BeginGetRequestStream(AsyncCallback callback, Object state)
    at NLog.Targets.WebServiceTarget.<>c__DisplayClass1.<DoInvoke>b__0(AsyncCallback r) in NLog\src\NLog\Targets\WebServiceTarget.cs:line 151
    at NLog.Targets.WebServiceTarget.DoInvoke(Object[] parameters, AsyncContinuation continuation, HttpWebRequest request, Func`2 beginFunc, Func`2 getStreamFunc) in NLog\src\NLog\Targets\WebServiceTarget.cs:line 218
    at NLog.Targets.WebServiceTarget.DoInvoke(Object[] parameters, AsyncContinuation continuation) in NLog\src\NLog\Targets\WebServiceTarget.cs:line 154
    at NLog.Targets.MethodCallTargetBase.Write(AsyncLogEventInfo logEvent) in NLog\src\NLog\Targets\MethodCallTargetBase.cs:line 79
    at NLog.Targets.Target.WriteAsyncLogEvent(AsyncLogEventInfo logEvent) in NLog\src\NLog\Targets\Target.cs:line 215
    at NLog.LoggerImpl.WriteToTargetWithFilterChain(TargetWithFilterChain targetListHead, LogEventInfo logEvent, AsyncContinuation onException) in NLog\src\NLog\LoggerImpl.cs:line 194
    at NLog.LoggerImpl.Write(Type loggerType, TargetWithFilterChain targets, LogEventInfo logEvent, LogFactory factory) in NLog\src\NLog\LoggerImpl.cs:line 97
    at NLog.Logger.WriteToTargets(LogLevel level, IFormatProvider formatProvider, String message) in NLog\src\NLog\Logger.cs:line 480
    at NLog.Logger.Info(String message) in NLog\src\NLog\Logger1.cs:line 636
    at NLog.UnitTests.Targets.WebServiceTargetTests.<>c__DisplayClassc.<TestWebserviceCall_get>b__b() in NLog\tests\NLog.UnitTests\Targets\WebServiceTargetTests.cs:line 326
    at NLog.UnitTests.Targets.WebServiceTargetTests.StartOwinTest(Action tests) in NLog\tests\NLog.UnitTests\Targets\WebServiceTargetTests.cs:line 422
    at NLog.UnitTests.Targets.WebServiceTargetTests.TestWebserviceCall_get() in NLog\tests\NLog.UnitTests\Targets\WebServiceTargetTests.cs:line 323


  • httpPost is only working with [FromBody] which is, ..., akward. Has to do with the "application/x-www-form-urlencoded". Not a lot of people uses "application/x-www-form-urlencoded" with POST to REST.
  • .Net 4.5 Only

This change is Reviewable

@304NotModified 304NotModified added the enhancement Improvement on existing feature label May 10, 2015
ghost pushed a commit that referenced this pull request May 11, 2015
Added Webservice tests with REST api.
@ghost ghost merged commit b04483f into NLog:master May 11, 2015
@304NotModified 304NotModified deleted the webservice-tests branch August 15, 2015 20:48
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement on existing feature webservice-target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant