How to call a web-service ofr external validation

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to call a web-service ofr external validation

javaudvikling
Hi,

I tried the xxternal validation sample and its works fine, but I can't see how to change the logic to call a web-service. I have made a web-service operation that takes one parameter, the customer-number and validate it.

Can anyone give me a hint or a sample of how to call this operation, and how to create the request body from the xform.:


            <xf:submission id="validation-submission" ref="instance('user-info')"
                    resource="/apps/xforms-sandbox/samples/howto/external-validation-response.xml"
                    method="post" replace="instance" instance="validation-result">
               
                <xf:delete ev:event="xforms-submit" ref="//@v:*"/>
                <xf:action ev:event="xforms-submit-done">
                   
                    <xf:insert ref="." origin="instance('validation-result')/v:data/*"/>
                   
                    <xf:setvalue iterate="//@v:alert" ref="." value="concat(., ' (save again to revalidate)')"/>
                   
                    <xf:dispatch name="fr-visit-all" targetid="error-summary-incremental"/>
                    <xf:dispatch name="fr-visit-all" targetid="error-summary"/>
                   
                    <xf:refresh/>
                    <xf:dispatch name="fr-update" targetid="error-summary"/>
                </xf:action>
            </xf:submission>

regards
Balatharan
Reply | Threaded
Open this post in threaded view
|

Re: How to call a web-service ofr external validation

Alessandro  Vernet
Administrator
Hi Balatharan,

Are you referring to the how-to linked below? And are you creating your form with Form Builder?

http://wiki.orbeon.com/forms/how-to/logic/external-validation

If that is the case, then this how-to won't help, as it is written for cases where the XForms is written by hand. At this point using HTTP or database services for validation isn't directly supported. However, it can be done, indirectly, through a workaround described here:

https://github.com/orbeon/orbeon-forms/issues/1304

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: How to call a web-service ofr external validation

javaudvikling
Hi Alex,

Thanks for your answer and the link to the workaround...
You are planing to implement this functionality in the near future?

regards
Balatharan
Reply | Threaded
Open this post in threaded view
|

Re: How to call a web-service ofr external validation

Erik Bruchez
Administrator