How to pass document_id to a web service

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

How to pass document_id to a web service

pouyan
How to pass document_id when save or send a form to a web service by post method

Here, when I call following web service I could pass all of my form content except document_id


 <property as="xs:string" name="oxf.fr.detail.process.save-draft.legal.*" >
         save
         then send(uri="http://user:pass@localhost:9090/smartform/admin/public/FormWService/formSave",
                   method="post")
         then success-message("save-success")
         recover error-message("database-error")
  </property> 
Reply | Threaded
Open this post in threaded view
|

Re: How to pass document_id to a web service

pouyan

I couldn't find a way to send document_id with "post" method however I pass it with "get" method as below and I could progress for now


 <property as="xs:string" name="oxf.fr.detail.process.save-draft.legal.*" >
         save
         then send(uri="http://user:pass@localhost:9090/smartform/admin/public/FormWService/formSave?documentId={encode-for-uri(xxf:instance('fr-parameters-instance')//document)}&", method="get")
         then success-message("save-success")
         recover error-message("database-error")
  </property> 
Reply | Threaded
Open this post in threaded view
|

Re: How to pass document_id to a web service

Alessandro  Vernet
Administrator
Hi Pouyan,

You can even do simpler: the document id is passed as a request
parameter to your service as the `document` request parameter, if you
add it in the `parameters` argument to send(), e.g.: send(parameter =
"document"). More on this at:

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

Alex

On Thu, Jan 15, 2015 at 9:20 PM, pouyan <[hidden email]> wrote:

>
> I couldn't find a way to send document_id with "post" method however I pass
> it with "get" method as below and I could progress for now
>
>
>  <property as="xs:string" name="oxf.fr.detail.process.save-draft.legal.*" >
>          save
>          then
> send(uri="http://user:pass@localhost:9090/smartform/admin/public/FormWService/formSave?documentId={encode-for-uri(xxf:instance('fr-parameters-instance')//document)}&",
> method="get")
>          then success-message("save-success")
>          recover error-message("database-error")
>   </property>
>
> --
> View this message in context: http://discuss.orbeon.com/How-to-pass-document-id-to-a-web-service-tp4659424p4659444.html
> Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.
>
> --
> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: How to pass document_id to a web service

pouyan
Thank you Alex

One more question, I would like to navigate to diffrent url base on result of "send" (my web service),
my web service return a string , how can I use if condition to check my result from my web service

<property as="xs:string" name="oxf.fr.detail.process.save-draft.legal.*" >
          save
          then send(uri="http://user:pass@localhost:9090/smartform/admin/public/FormWService/formSave?documentId={encode-for-uri(xxf:instance('fr-parameters-instance')//document)}&",
 method="get")          
          if ("//payment")
          then  navigate("/success-payment")
          else  navigate("/success-thankyou")

         recover error-message("database-error")
 </property> 
Reply | Threaded
Open this post in threaded view
|

Re: How to pass document_id to a web service

Alessandro  Vernet
Administrator
Hi Pouyan,

At this point you can't do this in a workflow. (I should say that it
might become possible in the future, as we extend the set of actions
you can run in a workflow, and the workflow "language" itself.) But
for now, the idea is that you would implement this logic of
determining what the target URL is in the service itself. For this to
work, you need to add replace = "all" as a parameter of send(), and
your service need to issue a redirect to the URL you want to send
users to. Is this something that works for you?

Alex

On Mon, Jan 19, 2015 at 10:12 PM, pouyan <[hidden email]> wrote:

> Thank you Alex
>
> One more question, I would like to navigate to diffrent url base on result
> of "send" (my web service),
> my web service return a string , how can I use if condition to check my
> result from my web service
>
> <property as="xs:string" name="oxf.fr.detail.process.save-draft.legal.*" >
>           save
>           then
> send(uri="http://user:pass@localhost:9090/smartform/admin/public/FormWService/formSave?documentId={encode-for-uri(xxf:instance('fr-parameters-instance')//document)}&",
>  method="get")
>           *if ("//payment")*
>           then  navigate("/success-payment")
>           else  navigate("/success-thankyou")
>
>          recover error-message("database-error")
>  </property>
>
> --
> View this message in context: http://discuss.orbeon.com/How-to-pass-document-id-to-a-web-service-tp4659424p4659462.html
> Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.
>
> --
> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet