-1

I just want a simple example of a WebService Client in HTML5 that sends a integer number to a link on my network.

I've tried but it didn't work, the client side that I used is below if necessary.

Thanks in advance.

<!DOCTYPE html>
<html>
<head><style type="text/css"></style></head><body><form action="http://192.168.0.251:9080/wsa/wsa1/wsdl?targetURI=urn:services-progress-com:Agrosys:Agroserver" method="post" target="_blank">
<table>
  <tbody><tr>
    <td>Numero:</td>
    <td>
    <input id="number" type="text" size="2">
    </td>
  </tr>
  <tr>
    <td></td>
    <td align="right">
     <input type="submit" value="send" class="button">
     </td>
  </tr>
</tbody></table>
</form>
<script></script></body>
Cfreak
  • 19,191
  • 6
  • 49
  • 60

1 Answers1

0

It looks like you're attempting to invoke a SOAP web service (based on the ?wsdl on the end of the URL).

There are some things to keep in mind here. First, unless you implement CORS, you cannot invoke an endpoint from a domain that's different than where your HTML was served. Second, SOAP endpoints don't have simple envelopes. You have to pass a lot of data back and forth, so it's kind of nonsensical to try to just submit a form to a SOAP endpoint. For example, a SOAP endpoint has a notion of "methods" with "parameters" just like a class has. What you're attempting to do is closer to the REST pattern (though not exactly the same as REST).

All that said, if you use jQuery, there's a plugin that allows you to invoke methods on SOAP endpoints.

Calphool
  • 188
  • 7
  • Thanks, what's the name of this plugin? –  Feb 13 '15 at 16:26
  • Sorry, I'm new to WebService and Web in general –  Feb 13 '15 at 16:27
  • Could you please give an example? –  Feb 13 '15 at 16:28
  • Look here: http://stackoverflow.com/questions/124269/simplest-soap-example There's a lot of nonsense in that thread, but look at the answer from Yaakov Ellis. Basically SOAP endpoints are somewhat like remote invokable objects. They have strict expectations about what they're going to see on the wire (envelope, body, various things described in the WSDL, etc.) The jQuery plugin allows you to ignore all that stuff and let the plugin form that overhead for you, so you can think in terms of the object's methods and parameters. – Calphool Feb 13 '15 at 19:20