There are many examples within the OFBiz out-of-the-box code base of web service clients that call real world web services and pass XML documents as part of the payload. These web services clients use the HttpClient
as described in the previous recipe in addition to XML document preparation utilities to build the necessary message content used to communicate with external web services.
In this section, we discuss how to write your own web service client(s) and exchange XML documents with one or more external-to-OFBiz web services providers.
The first step in writing any web services client is to gather the following facts about how the target web service operates:
The URL on the web for the service provider
Any connection parameters and/or HTTP/HTTPS request message header settings that must be passed as required by the service provider
The HTTP/HTTPS connection verb (get,
post
, or other)
To write a web service client that passes one...