How to get HTML output from *.asmx file
-
Hi I am preparing an .asmx file that calls a c++ class using its .dll and generates output in .xml format.But I want output in HTML format. To ganarate HTML output I have used wsdl "useService" and "callService" functions in html file. But when i run this from from localhost it gives error "Client Service unavailable" Can anyone tell me plz how to resolve this problem.::sigh: I m giving my html file //CPPWebService.html var n = 10; var iCallID; var callObj; function init1() { s.useService("http://localhost/MyWebServices/CPPWebService.asmx?WSDL","yyy"); var headObj = new Object(); callObj = s.createCallOptions(); callObj.async = false; callObj.funcName = "MyMethod"; callObj.SOAPHeader = new Array(); callObj.SOAPHeader[0] = headObj; oSPAN.innerText = "Number returned is"; iCallID = s.yyy.callService(MyResults, callObj); MyResults(iCallID); alert("Over"); alert(iCallID.value); } function MyResults(result) { alert(result.value); if(result.error){ var xfaultcode = result.errorDetail.code; var xfaultstring = result.errorDetail.string; var xfaultsoap = result.errorDetail.raw; oSPAN.innerText = xfaultcode + " " + xfaultstring + " " + xfaultsoap; alert(xfaultcode +xfaultstring +xfaultsoap); } else{ // Show the arithmetic oSPAN.innerText += result.value; alert(result.value); } } function aaa() { alert(event.result.value + ' ' + event.result.id); } Equation : //CPPWebService.asmx <%@ WebService Language="C#" Class=CPPWebService.MyService %> it use c++ class that is as follows #include "stdafx.h" #using #using "System.Web.dll" #using "System.Web.Services.dll" using namespace System; using namespace System::Web; using namespace System::Web::Services; #include "CPPWebService.h" namespace CPPWebService { int MyService::MyMethod() { return 42; } }; Thax in advance
Pankaj Jain