Where do I set transaction protocol? - web-services

I have set up a sample WCF service with transactions that use Transaction Flow - it builds and seems to be running as far as the debug client is concerned.
I know that, as of .NET Framework 4, there are two different transaction protocols in Windows Communication Foundation:
OLETransactions Protocol
WS-AtomicTransaction Protocol
However, I have no idea how to configure my service to use either of these, and which protocol my service is using by default. So - how do I do that?
Obligatory "show your work" part of the post
According to MSDN, I should probably set that at binding level, but the <binding> element
<bindings>
<wsHttpBinding>
<binding name="transactionBinding" transactionFlow="true" />
</wsHttpBinding>
</bindings>
doesn't seem to have any protocol-related attribute.
I also searched for relevant annotations to use along with [ServiceContract] or [OperationContract], but I couldn't find any, either.
All my attempts at Googling gave me MSDN I already read and loads of copy-pasted programming tutorials parroting each other that all talk about how there are two protocols without any mention how to actually set them up.
I suspect that by using <wsHttpBinding> I am using WS-Atomic, but there's no mention of WS-Atomic in a relevant MSDN page. Even if that turned out to be true, I still wouldn't know how to switch to OLE.

Related

How to rename Liferay's default cookies?

I have JSP project which uses Liferay framework. There are default Liferay cookies named COOKIE_SUPPORT and GUEST_LANGUAGE_ID in Liferay. I dont want hackers to view any of my technology information by any means. How can I rename these cookie?
If you want to protect the framework you're using, you won't have to worry about the names of the cookies. Worry about server identification, elements of the DOM, structure and mechanics of URLs, secure&hardened setup of your server, common translations, default content, standard error messages, etc.
In other words: If you don't want to give away, which standard framework you're using (and this is not limited to Liferay) you'll have to roll your own. Good luck with getting this as powerful and as well tested as any standard framework.
Rather worry about keeping your systems updated all the time and protect from well known vulnerabilities in older systems. For hardening Liferay specifically, you might want to start with my blog series on securing Liferay (linking chapter 1 which refers to the other chapters)
Promoting a comment into this answer: One way to find out how to change them is to search for their names in the source code and identify the kind of plugin you need to provide different values - most likely this will be an ext-plugin. After all, Liferay's source is available. I don't see anything short of this.

Getting Started with Axis/C MIME/DIME and MTOM

I am about to start some work on Axis/C. I have a fair idea of C and webservices separately. I am also fairly ok with *nix.
Can someone tell me about the complexity related to creating a webservice with support for MIME/DIME and MTOM with Axis/C? The webservice will be invoked from Java as well as C++ clients.
Does Axis/C have any known limitations in this regard? What are the best starting points for learning Axis/C in general and MTOM et al. support in particular.
I would advise against Apache Axis/C or Axis2c for that matter. Both these projects lack active development and member contribution. Last Axis2c release was in 2009 and Axis/c release page link doesn't even work.
I have developed a reasonably complex web-services implementation (both client and server), and I have ran into these issues:
Documentation is just OK. Nothing great.
Returning status codes of your choice is not easy.
Some HTTP verbs have bugs - for example I couldn't get DELETE to work.
I have faced issues with the supplied XML library guththila. libxml worked better for me.
It's hard to build complex REST routes for your application.
Handling incoming XML objects is quite cumbersome and inconvenient. I ended up writing a library of convenience functions.
JSON support is missing.
Your application will tend to become large with each server-side service implementation running into at lease a hundred lines of code.
WSO2 seems to be another option as far as web-services in C is concerned. The Axis2C team is mostly full of WSO2 people anyways. I haven't tried it though, but definitely looks more promising than Axis2C.
I had to modify the code to get it axis 1 to compile on fedora 13 + I believe I had to add a pure virtual some where in the code

A better C++ HTTP client library

We are looking for a better C++ HTTP client library, and we're willing to pay for it.
The product we want needs to be a statically linked, and to work on these platforms:
Windows XP, Vista, 7
OS X 10.4, 10.5, and 10.6
We want it to do the following tasks really well:
1. Make HTTP GET and POST requests
2. Handle meta refresh and http redirection responses automatically
3. Automatically use proxy settings from 'Internet Options', 'ProxyCfg', or 'preferences.plist', if present
4. Optionally utilize user-supplied proxy settings
5. Efficiently provide http and proxy authentication handling if required
6. Implement proxy auto-config and WPAD
There are a few free libraries that provide some of these requirements: boost.asio, curl, winhttp, Qt/wxWidgets, udrl, ultimate tcp/ip, but we haven't found any that satisfy all our requirements. We currently use libcurl to do much of this stuff in our current product, but we're not network programmers, and we'd like to replace our code with a better solution written by experts.
Is there a commercial product that would fill our needs?
Also, it would be really nice if there were a product that provided filter-recognition capability for HTTP responses. This would be really cool, and it would save us from having to write up a bunch of parsing code for filter detection. We already detect a few popular filters such as Websense, DeepNines, LightSpeed, Network Composer, Dans Guardian, SonicWALL, Privoxy, Bsecure, and SmartFilter. But it would be great if someone else did it for us, more completely and more up-to-date.
Has anyone heard of such a product?
Have you looked at NEON? It has pretty much everything you need.
I know it's not C++ specific, but it's C so you could integrate it very easily in your C++ project.
These guys have been around forever and are very well known to provide good networking SDK's: /n software

What would be a good Coldfusion-based bug tracking software?

What I am looking for is a tool that easily or automatically sends coldfusion error messages to their system.
Then I can use the web-based interface, to manage priorities, track who fixed what and so forth.
But I want to use this to help us deal with errors better, but also to show the importance of a bug tracking system to my fellow works.
System Requirements: Apache, Windows, Coldfusion 8 Standard, Sql Server 2005.
Financial Requirements: Free or Open Source
Goal Or Purpose: To encourage my fellow workers to want and use a bug tracking system.
Does this re-write make more sense?
Thanks
Craig
Wiki has a list of issue tracking software, maybe this list could help.
http://en.wikipedia.org/wiki/Comparison_of_issue_tracking_systems
You may be able to find a hosted service and use either email or web services to create the ticket using onError. With that said, a simple issue tracking app could be created for your site using the same DB used to drive the content. 2 or 3 tables would take care of the data storage and you're already using CF so the application layer is already there.
HTH.
I have been heavily using this type of a setup for several years by email only, and the last 3 years with a Bug Tracking Software.
I must say, the bug tracking software has made my life so much more peaceful. Nothing is left, forgotten, or slips through the cracks. It's easy to find trends in errors, and remember "all the times" it happened.
Our setup is like this:
1) Coldfusion + Appropriate framework with error reporting - It doesn't matter what you use. I have used Fusebox extensively and am making the transition to ColdBox. Both are very capable, in addition to Mach-II, FW/1, Model-Glue, etc. The key part you have to find in them is their ability to catch "onError", usualy in the application CFC.
2) Custom OnError Script - Wherever an error occurs, you want to capture the maximum amount of information about that error and email it in. What we do is, when an error occurs, we log the user out with a message of "oops, log in again". Before logging them out, the application captures the error and emails it to Fogbugz. Along with it, at the top we include the CGI variables for the IP address, browser being used, etc. Over time you will find the things you need to add.
3) Routing in Fogbugz. A 2 user version of Fogbugz is free, and hosted online. There are two main ways to submit bugs. One is to email one in at a time. So if an error happens 2000 times, you get 2000 emails, and 2000 cases. Not always the best to link them together, etc. They have a feature called BugzScout, which is essentially an HTTP address that you do a form post to with cfform with all of the same information you would have put into the email. There's plenty of documentation on this and something I've always wanted to get around to. I had a scenario of 2000 emails for the first time happen a few weeks ago so I'll be switching over to this.
Hope that helps. Share what you ended up doing and why so we all can learn too!
I'm surprised no one mentioned LighthousePro (http://lighthousepro.riaforge.org). Open source - 100% free - and ColdFusion. As the author I'm a bit biased though. :)
Hard question to answer not knowing what kind of restrictions are there? Do you have any permissions to install anything? Also most bug-tracking systems require some kind of database support.
I have a suggestion. You can put in place a basic bug-tracking system, that just allows people to create tickets, and allows you/someone else to close it.
More Windows based tools are mentioned here
Good open-source bug tracking / issue tracking sofware for Windows
Any reason why coldfusion specifically?
I really like Fogbugz from the makers of Stack Overflow. For one user it's quite reasonably priced. I enter some bugs manually and have others emailed in.
A lot of bug tracking software will expose SOAP methods for entering data into them.
For example, we used Axosoft's OnTime and that exposed some WSDL pages that I consumed in my application. I was told that Jira did as well.
There are few in CF411 list: Bug Tracking/Defect Tracking/Trouble Ticket/Help Desk Tools Written in CFML
We use HopToad. There is another bug-tracking app called LightHouse that integrates with HopToad so you can easily create a [bug] ticket from an incoming exception. HopToad has an API of which there are many clients, you want the CF based one:
http://github.com/timblair/coldfusion-hoptoad-notifier
Even if you dont use HopToad and you end up using a different service or roll your own, if you needed to write your own API client you could leverage the code or pattern(s) of the above HopToad client.
A lot of good information from everyone, and I really do appreciate the efforts given. But not the answer i was looking for. Which maybe means, that what i want does not exist, yet.
So i may have to roll my own solution...Or maybe integrate with another existing app...
Thank You all.

Is anyone using a ColdFusion framework that has specific path requirements without mapping or locating resources in the server root?

Let me first say I am aware of this faq for Mach-II, which discusses using application specific mappings as a third option when:
locating the framework in the server root is not possible and
creating a server wide mapping to the Mach-II framework directory is impossible
Using application specific mappings would also work for other ColdFusion frameworks with similar requirements (ColdSpring). Here is my issue however: my (I should say "their") production servers are all running ColdFusion MX7, and application specific mappings were introduced in ColdFusion 8. I most likely will be unable to do option 1 or 2 because they involve creating server wide changes that could conflict with other applications (I don't have a final word on this but I am preparing for that to be the case).
That said, is there anybody out there who was in similar bind and has done an option 4, in any ColdFusion version, or with any similar framework? The only option 4 I can think of is modifying the entire framework to change this hardcoded path, and even if that worked it would be time consuming and risky. I'm fairly sure that if there was a simple modification or other simple solution it would already be included in the framework (maybe it's included in version 1.8 of Mach-II and I don't know about it yet).
Any thoughts on solving this problem or even unorthodox setups with libraries that have specific path requirements would be appreciated. Any thoughts from Team Mach-II would especially appreciated...we're on the same team here Matt! ;-)
EDIT
Apparently, the ColdBox framework includes a refactor.xml ANT task which includes a target that refactors the ColdBox code to use a different absolute path as a base along with several other useful refactoring targets. So problem solved for ColdBox users.
Looking at the build.xml for Mach-II (1.6 and 1.8) I don't see any target in there that would allow me to refactor the code. I thought about creating a feature request ticket for such a task for Mach-II but frankly I don't think creating such an ANT task is a big priority for the MachII team since the need really only relates to either
a) users of ColdFusion versions below 8
b) someone who wants to use multiple Mach-II versions in the same application, a use I doubt they want to support
The ColdSpring code I have doesn't come with any ANT tasks at all, although I do have unit tests, and I bet if I poked around the SVN I'd find a few build scripts.
Using Ant tasks to refactor and retest the code, or the simpler (and sort of cop out) solution of creating a separate ColdFusion instance for the application are the best answers I've been able to come up with. I don't need this application to exist in the shared scope of other applications, so my first solution is going to be to try and get a dedicated CF instance for this application.
I'm also going to look at the ColdBox refactor.xml ANT task however and see if I can modify it to work generically to recognize and refactor CFC references with modified absolute paths. If I complete this task I'll be sure to post the code somewhere and edit create an answer to link to it. If anybody else wants to take a crack at that or help me out with it feel free.
Until then I'll leave this question open and see if someone comes up with a better solution.
Fusebox is not so strict, I think.
In XML mode (maybe I call this not 100% correcly, just mean using the Application.cfm) it's just proper include in index.cfm, something like:
<cfinclude template="fusebox5/fusebox5.cfm" />
In non-XML mode it will need proper extending in the root Application.cfc:
<cfcomponent extends="path.to.fusebox5.Application" output="false">
All you need is to know the path.
Perhaps you could create a symbolic link and let the operating system resolve the issue for you?
I've been playing with FW/1 lately, and while it may look like you need to add a mapping and extend org.corfield.framework, you can actually move the framework.cfc file into your web root and just extend="framework". It's dead simple, and gets you straight into a great framework with no mess and very little overhead.
It should be as simple as dropping the 'MachII' folder at the root of your domain (i.e. example.com/MachII). No mappings are required to use Mach-II if you just deploy at the root of the domain of your website.
Also:
Please file a ticket for the ANT task you mentioned in your question. Team Mach-II would love to have this issue logged:
Enter a new ticket on the Mach-II Trac
If you want to tackle an ANT task for us, we can get stuff like this incorporated into the builds faster than waiting to for a Team member to work on the ticket. Code submissions from the community are welcome and appreciated.
We don't keep an eye on Stack Overflow very often so we invite you to join our official community group at called "Mach-II for ColdFusion" at Google Groups. The Google Group is the best place to ask questions or comments like this if you want feedback from the Team.