Debugging an web service call to the service tier

tedcjohnston
Member Posts: 41
Is there a way to get the web service to dump copies of XML files at each http post? (Not sure if this even makes sense, sorry if it does not.)
I'm working with an external vendor who is inserting a sales order via a web service. He is trying to mix Item and Resource lines. When he tries just items it works. When he tries items and resources he gets an error saying the resource with the item number cannot be found. He claims he is not sending the type. I would like to be able to dump the XML as it comes it to see from my side what he is sending.
Does this make sense?
I'm working with an external vendor who is inserting a sales order via a web service. He is trying to mix Item and Resource lines. When he tries just items it works. When he tries items and resources he gets an error saying the resource with the item number cannot be found. He claims he is not sending the type. I would like to be able to dump the XML as it comes it to see from my side what he is sending.
Does this make sense?
"There are only two truly infinite things: the universe and stupidity. And I am unsure about the universe." - Albert Einstein
Corollary- Build and idiot proof system and nature will build a better idiot.
Corollary- Build and idiot proof system and nature will build a better idiot.
0
Comments
-
If he is not sending the type, then I guess he should?
The only way I can see the message is to use packet sniffer software like wireshark.0 -
Would be a very nice feature to help troubleshoot issues- especially with outside programmers.
A debugging flag set on the Service Tier that dumped the XML into a directory would be very helpful."There are only two truly infinite things: the universe and stupidity. And I am unsure about the universe." - Albert Einstein
Corollary- Build and idiot proof system and nature will build a better idiot.0 -
they should be using SOAPUI and see how the xml file should be generated.
In IE you save the WSDL for the webservice as xml file. Then in SOAPUI you open that file. It will show you how to generate the xml file.0 -
I've used a combo of wireshark and some custom code to dump my XML DOM object to disk. I also use the built in WCF logging features described below.
Look for Microsoft.Dynamics.Nav.Server.exe.config in directory: C:\Program Files\Microsoft Dynamics NAV\60\Service. If it's a x64 system the Program Files might look like "Program Files (x86)". With this file you can turn on the tracing and message logging feature of a WCF service. You'll be able to see the messages at the transport and service level layers as well as the traces which is handy in finding errors kicked out in the service tier. It's not perfect but it's the best visibility I've found as what's going on at the service tier. You can then use the Microsoft Service Trace Viewer (svctraceviewer.exe) to view these log files. On my dev box this is located at C:\Program Files\Microsoft SDks\Windows\v6.0A\Bin. I think this might be part of the Visual Studio install.
If you have Visual Studio you can find a tool to edit this .config file. Tools -> WCF Service Configuration Editor. That makes it easy to turn stuff on and off. Otherwise you'll have to be familiar with editing the config by hand.
This might be a bit hacked up but it would look something like this:<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.diagnostics> <assert assertuienabled="false" /> <sources> <source name="System.ServiceModel" switchValue="Warning,ActivityTracing" propagateActivity="true"> <listeners> <add type="System.Diagnostics.DefaultTraceListener" name="Default"> <filter type="" /> </add> <add name="ServiceModelTraceListener"> <filter type="" /> </add> </listeners> </source> <source name="System.ServiceModel.MessageLogging" switchValue="Verbose,ActivityTracing"> <listeners> <add type="System.Diagnostics.DefaultTraceListener" name="Default"> <filter type="" /> </add> <add name="ServiceModelMessageLoggingListener"> <filter type="" /> </add> </listeners> </source> </sources> <sharedListeners> <add initializeData="C:\NAV Service Logs\Microsoft.Dynamics.Nav.Server_tracelog.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelTraceListener" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack"> <filter type="" /> </add> <add initializeData="C:\NAV Service Logs\Microsoft.Dynamics.Nav.Server_messages.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelMessageLoggingListener" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack"> <filter type="" /> </add> <trace autoflush="true" /> </system.diagnostics> <system.serviceModel> <diagnostics wmiProviderEnabled="true" performanceCounters="All"> <messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" /> </diagnostics> </system.serviceModel> </configuration>
I've also been experimenting with this project: http://ukadcdiagnostics.codeplex.com/ and sending these WCF logs to a SQL table. It does add a bit of overhead to web service calls and I'm not sure I'd put it in a production environment but it's sometimes easier than using the WCF trace viewer.
Bill0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions