Click here to Skip to main content
11,712,466 members (74,393 online)
Rate this: bad
Please Sign up or sign in to vote.
Hi, I am trying to connect to my server via web services in the browser and I can't find a way. Here is a simple example:
1. Create a calcserver from examples from gSoap(here). The only change I made is in calc.h:
//gsoap ns service location:	http://localhost:11011
2. Create html in the same directory and use example(here). Make little modifications(like where is wsdl).
3. Copy WebService HTC File to the same directory.

The server is running, because i tested it in soapUI(generated new project from wsdl, that was generated from soapccp2 and everything worked - add, sub, div), but the javascript client can't connect and I have no idea why Frown | :(
Maybe it is becouse the service is located on http://localhost:11011 and the wsdl is in the directory where is the html. But it is only maybe.
Any suggestions please?
Here is the code of html:
<script language="JavaScript">
var iCallID;
function init()
	iCallID = service.MyMath.callService("add",5,6);
function onWSresult()
		var xfaultcode = event.result.errorDetail.code;
		var xfaultstring = event.result.errorDetail.string;    
		var xfaultsoap = event.result.errorDetail.raw;
		// Add code to output error information here
		alert("Error: " + xfaultcode + " " + xfaultstring + " " + xfaultsoap);
		alert("The method returned the result : " + event.result.value);
<body onload="init()">
<div id="service" style="behavior:url("  onresult="onWSresult()">
Posted 10-May-13 1:24am
Edited 10-May-13 2:04am
Sunasara Imdadhusen at 21-May-13 3:58am
What is error?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 CHill60 335
1 Sergey Alexandrovich Kryukov 279
2 OriginalGriff 230
3 Andy Lanng 160
4 Maciej Los 130
0 CHill60 335
1 Sergey Alexandrovich Kryukov 280
2 OriginalGriff 230
3 Andy Lanng 160
4 Maciej Los 130

Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 10 May 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100