Is Service B a Flow service running on a second Integration Server (Server B)? If so, define a remote server entry for Server B using Administrator and then use pub.remote:invoke built-in service to invoke service B.
Design service B to accept as input the data that A needs to send and to return the desired document type. You can even build it initial on Server A, test it using a normal invoke step and then when it is working copy it to Server B and change the normal invoke to a remote invoke.
This is pretty basic stuff. You might benefit from going through the Developer 4.6 Tutorial avalable on Advantage. It’s a bit dated, but still useful for learning basic Flow language stuff. Another help would be to work through the examples in the WmSamples package (you have to download this package from Advantage beginning in IS 6.5).
Mark
#Flow-and-Java-services#webMethods#Integration-Server-and-ESB