3

I'm in need of advice. I reckon this is no stack overflow but that's probably for the best as I wouldn't feel as comfortable posting there as I am doing it here. So, back to the question: I'm currently working with legacy code, written in .NET 2.0. This code is responsible for calling upon PEC services in order to finally create personal smart cards. I was tasked with the job of creating a repository system that would allow the program to call on the old legacy services or the new ones without any distinction. We are talking about SOAP services in both cases. The issues is: the new service definition is comprised of soap policies. This wouldn't be a problem per se, with more modern version of the framework, but with .NET 2.0? Yes, it is. It doesn't support policies and signing the body with a certificate right out of the box. How can I manage this? I feel like the only way would be letting the proxy class do its thing up until the very last moment: intercept the SOAP request before its sent and modify it according to the specifications. But I reckon this is very bad practice. Is there any other way out of this?

Thanks for anyone that would like to help. 🙂

Comments
  • 1
    Idk if he can help but: @jAsE
  • 1
    might help: first google result..

    https://codeproject.com/Articles/...

    (so yes, intercept.)
  • 0
    @iKameo no, unfortunately it is not. The problem is actually that. I red that with .NET 3.5 there's the possibility to define custom bindings and custumize how the SOAP envelope is built. But it's not a possibility in this case, I'm afraid. I don't know if any of you experienced this problem before... I'm pretty new to SOAP and I'm used to working with .NET 4 and REST, so this is all pretty frustrating. Maybe we will discuss with the client the possibility to change and upgrade the target framework as this is getting out of hand 😕
  • 0
    Their code is also amazingly bad. They even got swear words in their logging system (when it is used), syntax and grammar errors, services which replies with either "OK" or "KO", no documentation whatsoever, mixed logic, functions that constantly update parameters via reference as well as returning a result and comments which are not commenting on the line they are sitting on top of but rather are leftovers resulting from moving code around different places in the progeam How lucky am I? 😂

    P.s. ironically, comments are mostly absent but when they are not, they are either confunsing or plain wrong.
  • 0
    We actually went for the Rest implementation after wanting to deal with Soap and its madness ever again.
  • 0
    *not wanting
Add Comment