First of all, for similar phrases like this, I never like to say that they are interchangeable, because that implies that they connotate the same thing. There is usually a best choice to make. While the denotation of the phrases might be interchangeable, providing an incorrect connotation could lead to confusion on the part of the reader or listener of your sentence.
So let discuss connotation with an example.
In doing so:
Bob walked his dog. In doing so, he exercised.
The first phrase in doing so gives the impression that effect of his first action (walking the dog) wasn't at all intended to cause the second. He exercised, but this occurred only as a side benefit.
In this way:
Kathy finished watering her plants and set down the hose. In this way, the hose would be close by for next time.
In this example, the phrase in this way is used. It is implied that Kathy desired the results described in the second sentence. She wants the hose close by. However, it isn't a very strong desire. If her husband comes and stores the hose, she will just get it out again.
Fred went to Law school so that he could get a degree.
In this example, Fred performed the first action (law school) expressly for the purpose of achieving the second action (get a degree). This was his entire goal.
I'll change out the last example with a different phrase for clarity:
Fred went to Law school. In doing so, he could get a degree.
If you said this, a listener might be confused. They might ask "Did he want the degree?" or "Did he have another reason for going?" Maybe Fred's main purpose was to party with college students and blow off classes.
Remember that changing out these phrases for each other will still make sense. It will still be grammatical. But it will connotate a different mindset on the part of the subject.