How can I call my HTTP Service on submit button

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

How can I call my HTTP Service on submit button

pouyan
 
I have created an HTTP Service through Form builder (I used test button and it works well), How can I call
my HTTP Service on submit button

here is code for my HTTP Service in Form builder

<xf:submission id="HTTP_DB_SRV-submission" class="fr-service"
                     ref="instance('fr-service-request-instance')"
                     resource="http://localhost:9090/smartform/admin/public/FormWService/formSubmission"
                     method="post"
                     serialization="application/x-www-form-urlencoded"
                     mediatype="application/x-www-form-urlencoded"
                           replace="instance"
                           instance="fr-service-response-instance"
                           xxf:username="user_test"
                           xxf:password="123456"/>
Reply | Threaded
Open this post in threaded view
|

Re: How can I call my HTTP Service on submit button

Erik Bruchez
Administrator
What do you want to do exactly upon form submission? Asking because you might be able to do this by customizing the send/submit process instead:

    https://github.com/orbeon/orbeon-forms/wiki/Form-Runner-~-Buttons-and-Processes

-Erik
Reply | Threaded
Open this post in threaded view
|

Re: How can I call my HTTP Service on submit button

pouyan
Thank Erik

I have added following to "properties-local.xml"
Can I pass username and password on following http call
 
<property
  as="xs:string"
  name="oxf.fr.detail.process.send.*.*"
  value='require-valid
         then send(
                   uri="http://localhost:9090/smartform/admin/public/FormWService/formSubmission",
                   method="post",
                   replace  = "none",
                   content  = "metadata"

                  )
         then navigate("/success")
         recover navigate("/failure")' />

</properties>
Reply | Threaded
Open this post in threaded view
|

Re: How can I call my HTTP Service on submit button

Erik Bruchez
Administrator
Which username and password? The current user'? The called service's?

-Erik
Reply | Threaded
Open this post in threaded view
|

Re: How can I call my HTTP Service on submit button

pouyan
 As you suggested I use "send" and define my HTTP URI
I don't need HTTP Service anymore however my servlet
("http://localhost:9090/smartform/admin/public/FormWService/formSubmission")
is protected by HTTP Authentication and I have to pass username and password
when I call it

Thx
Reply | Threaded
Open this post in threaded view
|

Re: How can I call my HTTP Service on submit button

Erik Bruchez
Administrator
URLs can embed username and password with the following standard syntax:

http://username:password@localhost:9090/smartform/admin/public/FormWService/formSubmission")

-Erik