Welcome to JavaRanch!
Originally posted by wil loo:
I've tried how to invoke external webservices which uses HTTP GET binding (passing in parameter using URL). My question is how to invoke external webservices which uses SOAP1/2 binding?
SOAP web services always use HTTP POST - that is the only way you can pass the SOAP request envelope to the web server. It would be possible to send a SOAP response as a result of a HTTP GET request - however that combination is
highly unlikely as the request would not be able to use SOAP's extension features.
To get a sense of how SOAP (implemented with Java (JAX-WS)) works have a look at
]this topic.
See also
Basic doubts in Web services
Originally posted by wil loo:
Because the file size will be around 10k, I can only use SOAP binding, am I right about this?
File transfer is not limited to SOAP. Does this "web service provider" already exist?. Because right now it doesn't even seem like the
style (SOAP, RESTful, XML-over-HTTP, etc.) of web service has been selected yet.
Even if you have to use SOAP there are a a variety of protocols for "file attachments" like DIME (never standardized and not well supported under Java), SOAP with Attachments (SwA, fairly well supported under Java SOAP stacks but not necessarily on SOAP stacks for other implementation platforms), or the
SOAP Message Transmission Optimization Mechanism (MTOM, the most recent protocol only supported by fairly recent SOAP stacks). Not every SOAP stack supports all these protocols and each protocol may have a different API for each SOAP stack implementation. Of course you could also simply transfer the file as base64 encoded data (see:
Send binary data without using attachments).
A RESTful web service would probably expose a URL for a "parent resource" that accepts your (possibly binary) file through an HTTP-POST. That parent resource would then create a new "child resource" from your file and return a URL that makes your new resource identifiable (a URL is a URI) and addressable (as the URI also happens to be a URL). You can then use that new URI to refer to your file in any future interactions with the web service.
An XML-over-HTTP web service would probably accept the file as an XML document through an HTTP-POST; the document would specify meta data like the filename and would also contain the base64 encoded content of the file.
Have a look over the
web service faq for further information.