Re: Passing an variant from classic ASP page to a .NET webservice



Thanks for your help everyone.

In the end I just loaded the returned XML into an DOMObject

Set HTTP = CreateObject("MSXML2.XMLHTTP")
Set xmlDOC =CreateObject("MSXML.DOMDocument")
HTTP.Open ...
xmlDOC.load(HTTP.responseXML)

and parsed the DOM object and it works a treat
again, thanks
Markus


Regards
Markus
Laurent Bugnion, GalaSoft wrote:
Hi,

MarkusJNZ@xxxxxxxxx wrote:
Hi, I am trying to pass an number from a classic asp webpage to a .NET
webservice.

Because my C# webservice expects an integer and classic ASP uses
variants I keep getting problems with object casts;

In my asp page I have the following code which works fine

HTTP.Open "GET","http://myserver/myService.asmx/LogPerson?ID=100";,
False

That's not how web services work. Web services are not simple AJAX, they
are SOAP-encoded calls.

On the client, you need to create a POST request, and the request's body
must be compliant with SOAP. SOAP is a XML dialect, which encodes a
remote method call.

If you really want to do that, you need to study SOAP and create a
correctly encoded request. That's a lot of work (I did it for
JavaScript, and it needs a lot of study before getting it to work).
Nowadays, SOAP clients use proxy-generating code to make using web
services easier (.NET with Web references, JavaScript with ATLAS, etc...).

In your case, for something simple as that, I would recommend abandoning
web services and using a ASHX generic HTTP handler on .NET. Then it's
much, much easier to send GET requests to it. The ASHX handler can
return plain text, plain old XML, or whatever you can place into a Response.

See this article I wrote:
http://www.galasoft-lb.ch/mydotnet/articles/simple-ajax-pox-implementation-server.aspx

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch

.



Relevant Pages

  • Rails Web services (in general), HTTP GET and JSON and other topics
    ... I like SOA, I like Ajax, I like Ruby/Rails, but I am in doubt how to ... Does anybody know a good tutorial about Rails Web services? ... be configured not to adhere to SOAP protocol or to use XML. ...
    (comp.lang.ruby)
  • RE: Bypassing Serialization/Deserialization in WebService/AP.NET
    ... You can process soap header like normal. ... I have WSDL defined exposing few web services. ... > (XML) to a method in another class. ... > the ASP.NET infrastructure (creating soap response, faults etc), but without ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Trying to use Web service References in Access 2003 and need to create an authentication soap he
    ... library also means you have full xml parsing at your fingertips. ... In most cases I think the above is FAR LESS work then the soap web tool kit. ... class modules need be to added for each new method of the web service. ... changes in the web services can often break the access side of code. ...
    (comp.databases.ms-access)
  • Book Advice
    ... I currently know nothing about xml, web services and soap and I am ... I guess SOAP fits in here somewhere. ... PERL, Python and PHP. ...
    (comp.lang.php)
  • Re: Access 2010 with Sharepoint 2010
    ... I upload data with linefeeds in it to a client website all the time. ... but all of the web services and soap protocol's MOSTLY use xml. ... access application on their two computers, but I am hosting the data on SQL ...
    (comp.databases.ms-access)

Loading