How do I send the input response to soapUI

Asked

Viewed 136 times

0

My code:

<html>
  <head>
    <title></title>
    <script type="text/javascript">

       function valor() {
         var form1 = document.frm;
         var dados = form1.dados.value;

         if (dados == "teste"){
            alert('pegando dados');
            form1.dados.focus();
            return false;
         }

         return true;
       }
    </script>
  </head>
  <body>
    <form onSubmit="return valor()" name="frm" method="post" 
          action="http://schemas.xmlsoap.org/soap/envelope/">
      <input name="dados"  placeholder="email">
      <input type="submit" onClick="return valor()" value='Inserir texto'/>
    </form> 
  </body>
</html>
  • To send a SOAP envelope you would have to parse the Form for a valid XML, I think it is not worth the effort, on the other hand you can use SOAPUI to make Restful Mockservice, you can read more about it at the following link: http://www.soapui.org/rest-testing-mocking/Rest-service-mocking.html

  • knows how to make Soap return an xml ?

  • found a plugin that parses the form for SOAP, but I still find it more useful to work with a Web API than with SOAP messages.

1 answer

0

I believe you already have a functional Mockservice in your SOAPUI and know which address and endpoint you need to access.

in this case you can use a jQuery plugin to work with SOAP messages: jQuery SOAP

Your requisition would be something like:

$.soap({
    url: '[coloque o endereço do MockService aqui]',
    method: '[Coloque a Ação a ser executada (Metodo)]',    
    data: {
        dados: "[email protected]"
    },    
    success: function (soapResponse) {
        // soapResponse é a resposta SOAP.
        // você pode usar o método soapResponse.toJSON() para fazer um parse para JSON.
    },
    error: function (soapResponse) {
        // exibir erro.
    }
});
  • okay, thanks guy help enough

Browser other questions tagged

You are not signed in. Login or sign up in order to post.