Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting the format of a WSDL file (Java?)

I work with a system (Salesforce) that can only consume document/literal wrapped WSDL files. However, my customers need me to connect with older systems that generate other formats of WSDL file (RPC literal for example or just doc literal). So I often receive wsdl files in 'unfriendly' formats and I have a Hell Of A time trying to shoehorn it into a format acceptable by Salesforce. Basically, there can be no external references in the wsdl and it must be doc/literal wrapped.

So... I was thinking that a sneaky way to solve this issue might be to consume the wsdl in Java (jax.ws) and then recreate the wsdl from Java programmatically with a single call.

Has this problem been solved before? If not, then am I on the right track? Has anyone solved this wsdl transformation issue before? I assume XSLT could probably do the job for a smarter man than myself, but I've got to work with the brain I was issued and it seems determined to learn the minimum possible about wsdls in order to solve this problem.

TLDR: can I consume/create arbitrary format WSDLs with java so I can create WSDLs in wrapped doc/literal format with no attributes (elements instead) and no imports (a completely self contained WSDL should be the output).

If you can help me solve this problem I will buy you a pizza! That's right. I'll email you a papaJohn/Dominos/Pizzahut coupon (or even call your local pizza joint and buy it for you if you want to give me your home address/phone number - which you probably don't).

like image 847
alan brown Avatar asked Dec 30 '25 12:12

alan brown


1 Answers

I can suggest an approach, but you may or may not find it helpful.

Apache CXF includes a great deal of code for building a model of a service based on a WSDL and then on the other hand building a WSDL based on the model. You might get somewhere by starting with that code and trying to write more code to map the model so that you get the wsdl you want.

I'm tolerable confident that nothing built-in-to JAX-WS is going to help you here, but I surely don't have it memorized. You might also find a deeper pool of relevant expertise at the CXF user mailing list.

like image 189
bmargulies Avatar answered Jan 02 '26 02:01

bmargulies



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!