aspose file tools*
The moose likes Web Services and the fly likes Testing if I can send SOAP Messages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Testing if I can send SOAP Messages" Watch "Testing if I can send SOAP Messages" New topic

Testing if I can send SOAP Messages

David Wendy

Joined: Aug 04, 2005
Posts: 5
I'm working on an application that talks to a client's web application using SOAP. So the client has given use the url to send SOAP messages to.
Anyhow, as part of my validation code, I'll like to check if I can send messages to the client using the URL. The URL we have can be incorrect, point to the wrong place or some other problem.

In my validation can I just check if I can obtain a SocketConnection to the machine? For example:

Do I have to do more than that for my check?
Peer Reynders

Joined: Aug 19, 2005
Posts: 2906
Don't check - but fail gracefully. It should be simple enough to provide the client with an incorrect URL to find out what exception is thrown by your particular SOAP stack (example) - then add code to deal with that exception gracefully. With HTTP you connect to send a request; what request are you going to send? If that URL is a SOAP endpoint you better send a SOAP request; if you have to send a SOAP request you might as well try to get some work done.
[ March 02, 2008: Message edited by: Peer Reynders ]

"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
It is sorta covered in the JavaRanch Style Guide.
subject: Testing if I can send SOAP Messages
Similar Threads
setting socket traffic class option on linux
how to set timeout to throw an exception if the server is down
What is the difference in these two methods : Socket.bind() , Socket.connect()
socket operation
FTP client not working behind proxy