Ripa,
I imagine you're asking the question in the context a form created with Form Builder. At this point, there is no direct way to use the value returned by a service for validation, and we have an RFE for this:
https://github.com/orbeon/orbeon-forms/issues/1304Instead, you need to call your service, store the result in the value of an "internal" field, and then use the value of that control to validate your field. Often authors create a "internal" section at the top of the form with such fields; the fields are just used for internal purpose and not intended to be visible to users, so the section is marked as non visible, i.e. its visibility is set to false().
I hope this helps,
Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet