Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Soap UI Request works; how do I recreate call in java?  RSS feed

 
Eric Fancis
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Soap UI Request that works; how do I recreate the call in java?

How do I execute a Soap call in Java or Groovy?

I have been searching and trying things in the groovy console for about 4 hours. I am very lost.

Is there a recommended resource for this sort of thing?

Thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally speaking you have two options:

1. Use one of the many SOAP toolkit to build a set of client classes that create a SOAP message, send it and retrieve the response.

2. Take the exact text of a SOAP request and use it as a template to add your specific data, send using a HttpURLConnection and parse the returned response as XML or as text.

SOAP messages are, after all, just text in a specific format. There are LOTS of ways to manipulate text in Java.

Given that you have a SOAPui request that works, option 2 should be easy.

I did this for a client and found option 2 MUCH faster than option 1 - but less flexible of course.

Bill
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!