Exposing SOAP Response Message to user - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Exposing SOAP Response Message to user

Last post 05-11-2023 07:05 AM by matts. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 04-17-2023 01:37 AM

    • matts
    • Not Ranked
    • Joined on 05-25-2020
    • Posts 9

    Exposing SOAP Response Message to user

    Good day! I have an InfoPath 2013 Form that is filled out by users in the InfoPath Filler application. The form is submitted to our custom web service via the "Web Server (HTTP)" method in Infopath. In order to leverage the possibility to perform client-side "on-before-submit" validation (i.e. using InfoPath rules/actions), I am now considering making the form submittable to a SOAP Web Service (a necessary change, since the Submit to Web Server (HTTP) method is not available as an action in the rules area! (Why?)). So far so good, however, with the "Web Server (HTTP)" submit method I could have any error messages returned by the server (as HTML in the HTTP 40X Response Body) displayed to the user, which has been very useful! I am not clear how I could achieve something similar with the Submit to Web Service (SOAP) option. If I include the error message in the SOAP Response Message, how can I have this displayed to the user? Any ideas/advice much appreciated!
  • 04-18-2023 08:40 AM In reply to

    Re: Exposing SOAP Response Message to user

    We've used receive connections to our SOAP service instead of submit so that we can get back the error info, as well as some other identifier information returned by the form. That may require code, however, depending on your web service, for passing in the form XML as a string, I'm not sure on that.... You could also use validation rules in the form to try to prevent errors prior to submit?
    Hilary Stoupa

  • 04-20-2023 12:53 AM In reply to

    • matts
    • Not Ranked
    • Joined on 05-25-2020
    • Posts 9

    Re: Exposing SOAP Response Message to user

    Thanks Hilary for the suggestion. I managed to create a Receive Connection for the SOAP Web Service. And to use this connection in the Submit Actions. However, I am not clear how I can include the entire XML instance document in the SOAP Request Message (without using code. So far I have managed to stay away from code, and would prefer to keep it this way!). Currently all my validation rules are associated with the form fields. This captures any validation issues up-front and provides immediate feedback to the user, which is good, but some validation rules are rather complex and affect the performance/responsiveness of the form, so it would be nice to have these checked just before the form is submitted instead.
  • 04-20-2023 07:44 AM In reply to

    Re: Exposing SOAP Response Message to user

    Yeah, I'm not sure about how to include the entire XML without code - but in terms of checking prior to submit, you could just use rules for your submit, and then use a submit connection to your SOAP service, which makes submitting the entire XML string easy. If you use rules for your submit, you can check if your necessary validation passes, and only submit to the SOAP service if it does....
    Hilary Stoupa

  • 05-11-2023 06:38 AM In reply to

    • matts
    • Not Ranked
    • Joined on 05-25-2020
    • Posts 9

    Re: Exposing SOAP Response Message to user

    Thanks Hilary for your suggestions. Yes, using rules for the submission is exactly what I wanted to do (as it allows me to check some more complex validation rules before submitting), however, here the Submit to HTTP-Webserver option is not available, and if I go for the SOAP submit option instead, then it seems the server response, unlike for the HTTP-Webserver option, cannot be displayed to the user (including fault messages which may be returned by the server when validating the form server-side)... I was hoping that InfoPath could pick up the standard SOAP Fault response messages, provided I have declared them in the WSDL, however I haven't managed to succeed with this. Maybe I am missing something? Exposing the server response message to the user should be a common use case, no?
  • 05-11-2023 07:05 AM In reply to

    • matts
    • Not Ranked
    • Joined on 05-25-2020
    • Posts 9

    Re: Exposing SOAP Response Message to user

    Oh, I just noticed that I have been using the wrong HTTP status code for the SOAP fault responses (400 instead of 500). I thought I had fixed that. Now the fault response message is displayed to the user as expected. (Although, I liked the HTML-formatted response messages with the HTTP Webserver method better! :))
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.