How to log Dynamics CRM standard SOAP API calls? - dynamics-crm

Context
We have an on-premise CRM (8.0) application, which is integrated with different legacy systems. There are approx 20 entities which are created/updated/upserted via the standard SOAP API by the legacy systems.
Question
I would like to log all the incoming requests and responses as SOAP/XML for diagnostics reasons. How can I accomplish this task?
(Note: I know the trivial, but not exactly fit solution to have workflows for create/update on all affected entities. This seems to be not universal enough + we ultimately must log the request text and response text itself)

I haven't tried it yet, but I think it should be possible to configure the native WCF tracing for the Organization Service. This is something really easy to do (it requires to add some configuration to the web.config file) and you will be able to log any request and response. You can take a look about how to configure it here.
EDIT:
In this link you will be able to see what I've just told you working (it was done for CRM2011 but it should works in newer versions): link

Related

How to get multi-part form data in a self hosted WCF?

I've been searching for a quite while now and not found what I'm looking for. I've self hosted a http WCF in a windows application. Now in one of my service's methods I need to receive a file and some form data fields. In similar questions the case is either sending one single file (Which is done by streaming data and then converting it) or they have hosted WCF in an environment that Asp.Net Compatibility can be turned on to access HttpContext and then getting all the needed data from HttpContext.Current. Any Suggestions ?
After a while I found out that someone has already answered my question. for anyone out there facing a similar problem here is the link to the answer :
https://stackoverflow.com/a/14514351/11797674
this approach also uses stream input but not for a single file. It also can manage to get multiple files and form data by key. the sample presented in the answer is a little bit old. I suggest that you check the git repository and follow the sample there. It works like a charm for Http WCF's that are self hosted on a application type that is not web application and Asp.Net Compatibility mode activation is not a option (Since Sessions are different than web application and no http context is saved by the application which WCF is self hosted on)

How to respond to ajax calls on the server side?

I have been working on a mobile app that sends an ajax call to the server and waits for a response from the server in json format.
I am wondering from the server side, how to respond to an ajax call? Could someone give me an example in code?
I check the server code of my project (written by other members of the team) and could not understand it. I can only see it is written in java and also some keywords such as apache, springframework, etc pop up. I am a total newbie for server side programming and I want to learn more about it. Could someone give me some tips on how to get started with those as well? How does a server work? Is it just like responding to various request? What language could you use to build it and what is Apache? I know this looks like a lot of questions so probably I need to get some basic knowledge first. Any help/tips/suggestions on readings is appreciated.
This is kind of a broad question, as there are a lot of different server-side technologies that can handle server side AJAX requests, but if you want to go the Java route, using Spring Framework makes it very easy.
Spring Framework is a large open-source Enterprise Java framework that has a variety of features which entire books rarely even cover.
(Apache is an open-source project that contains over a hundred different sub-projects, the most popular being a web server.)
Spring does have some specific tools to handle REST calls. Assuming your AJAX is making a REST call (which is what it sounds like), and your project is already using Spring framework, it is fairly straightforward (assuming you already know Java). The Spring framework handles all the hard stuff for you. There are a few different ways to do this using Spring, but check out this link for creating a simple REST service:
https://spring.io/guides/gs/rest-service/
Another route would be to look into PHP, which is a server-side scripting language. With PHP, you can handle AJAX requests without the need for an application server (most basic web servers speak PHP). There are plenty of good resources for this, but one of my favorites is http://www.tutorialspoint.com/php/
BTW - the TutorialsPoint site is great for Java and Spring as well

what are the limitations of a .net web api service?

I admit I am not wholly familiar with the .net webapi, but I have just been handed a project that a previous developer started and explained prior to his leaving that using the webapi services that we could instantiate a service that would continually compare file data with database data if one was newer than the other it would update either the database or the file. The trick is that their is a old PowerBuilder Com piece that extracts or compresses depending on whether it is going to the database or visa versa.
Additionally there will be real time requests for files (data) which will require those requests to be elevated in the process for being sent to the Com object as it were.
With this rather lengthy concept laid out, can a webapi service actually run as a continuous service as described? My understanding was or is that it cannot, and that a different service approach would be required using the webapi to manage the queues and messages for real time requests. Am I missing something here?
Thanks in advance.
Russ
WebApi is not a platform for continuous services. Its purpose is just to provide an interface to your application over HTTP.
In this scenario, WebApi would only be useful in its ability to accept requests. The data in the request can then be used to query your long running internal systems for data, or to update or create new data. WebApi embraces the HTTP verbs (GET, POST etc) for this exact purpose, making HTTP the protocol of your application's state.
Also, with regard to returning data. WebApi simplifies the serialization of a complex object into javascript (by default, overridable if need be). This is useful when your Api is consumed by clients speaking json.

Implementing Real-Time Collaboration On A Page?

I would like to create a web page which would allow multiple users to work together on a page, Imagine a web based editor that allowed to users to change the documents as an example of this type of feature.
How would more experienced programmers go about implementing this as i really cant seem to formulate any way to even begin going about this task. Would there be any programming librarys that make implementing this feature easier or is it just too complex to even think about?
I am creating this webapp primarily using GWT and SmartGWT if that helps.
Thanks for any input you may have.
There is indeed a cometd-like library for gwt - http://code.google.com/p/gwteventservice/
Wiki:
In web development, Comet is a neologism to describe a web application model in which a long-held HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it. Comet is an umbrella term for multiple techniques for achieving this interaction. All these methods rely on features included by default in browsers, such as JavaScript, rather than on non-default plugins.
In practice:
In normal way client can receive resources by request->responce. It is no possible to send data directly to client without request. With comet you can hold realtime connection between client and server and exchange data in realtime.
Check out: docs.google.com. They are using comet.
Etherpad.com is a service that used to do this. It has been since bought by Google, and the code released as open-source. You can see several links on the etherpad.com page for the source download and related information.

simple user-feedback collection service

Short: I am looking for a very simple (configuration/maintenance wise) solution, that would allow to collect user-feedback/bug-reports from my apps/web-sites over the internet.
Long:
Right now I have very simple web-app written using ASP.NET MVC that receives http-post requests at http://localhost/feedback and saves them as c:\temp\{guid}-feedback.txt. I used UltiDev HttpVpn (BTW it's very cool) to expose this page to the internet without having to put my app in DMZ. I collect following information (through a feedback form in the app, or a web-site's feedback page): user name, e-mail, type of the message (feature request, bug report, comment), application name (hard-coded in the app that sends the feedback), and message-text/comment.
About E-mail:
E-mail is not good enough, since there will be no e-mail client on most of the computers my apps are running at (also, it takes too many clicks to send an e-mail).
About JIRA:
IMHO JIRA is too heavy for what I need. I might be wrong, since I have never installed/configured it myself. Does it have a http-post interface (so I can put my own interface on)?
.NET on Windows solution preferred
FREE is a requirement
To my opinion http://www.useresponse.com is a nice alternative to SaaS services (will be once released on December 2011) you can install on your site and customize up to your satisfaction (both look and functionality).
Commercial, though. Don't think you'll have enough functionality from free scripts (neither support and new features).
Worth checking out FogBugz. I used it many versions ago and it has changed a lot since then.
But it allows you to report app crashes / bugs, etc. through a number of mechanisms (see link for details): http://www.fogcreek.com/FogBUGZ/LearnMore.html?section=NewPlatform#hist_PullCases

Resources