I have been creating SOAP Web Services with Caché/Ensemble for some time now, and it is very easy, it is as easy as use an annotation with Java, the difference is that you have to extend a class (not a big problem, since Caché supports multiple inheritance) besides annotating the method you want to expose as a service. So, I thought that it would be nice and easy to use Caché/Ensemble as a Web Service client. I was wrong.
It all started when I finally got in hands the WSDL describing some services from a software the company had purchased. These services were needed to allow ours systems to integrate with the new software (which is almost a black box to us).
Since I had made some tests creating Web Service clients for another services and WSDLs, I was pretty confident it would be easy. Too wrong, I was, as Master Yoda would say. Using the WS Client generator Wizard, I just got an error screen. Unfortunately, as you can see below, Caché/Ensemble didn't give me quite nice and enough information, so I got some doubts: the WSDL I got from the third-party software-house was broken/wrong/f***ed up, or Caché just doesn't understand some stuff? (At this point, both hypothesis had the same probabilites to me.)
(Screen with WS client generator wizard error)
So, I thought I'd test the Web Service using soapUI, a program made with Java, that allows you to test SOAP Web Services. I talked about it in last post.
Using soapUI, I could not only create the correct structure of SOAP messages, but also execute the service. This led me the conclusion that there were something wrong with Caché's wizard. As I am a curious person, I tried to figure out what was causing trouble in that WSDL. After half day lost, comparing it with other WSDLs and navigating into specs, the answer finally arised: the request message had two elements, when it usually have just one (usually the message object itself):
(the piece of WSDL which was causing me trouble)
I just erased the second element tag from the message, and the wizard worked! I felt relief, since in this WSDL there were other methods (which didn't cause me problems), and the wizard just stopped when it encountered an error. Unfortunately, my relief didn't last long...
With an older version of this Web Service (one that was given to me during the third-party company development), Caché's WS Client wizard worked well, so I had all my implementation based in it. Of course I was expecting some changes, but I didn't thought there were so many (and so big)... I was wrong, very wrong...
To be continued...
quarta-feira, 5 de setembro de 2007
Web Services with Caché/Ensemble - The Quest - chpt 1
Assinar:
Postar comentários (Atom)
0 comentários:
Postar um comentário