Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / November 2004

Tip: Looking for answers? Try searching our database.

Submitting an xml document to a web service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Keith Chadwick - 27 Nov 2004 20:19 GMT
Wonder if someone can get me on the right track.  I have a web service that
returns the xml representation of some data.  This returned data is loaded
in the client (i.e. 6) into a msxml4 object.  The data is then rendered to
html with a xsl transformation client side.  This works great and how things
will stay.  Now I need to get the data the other way to a web service.

When the user clicks on Save the client side xml is updated with the values
they have changed.  I then need to post this back to another web service
that will expect this data.  Now obviously I can not simply pas the xml as
string on the querystring because you run into encoding problems if the user
has entered in & > or < values for example, and yes I have to allow for
these.

So my question is how to send the xml back to a web service via Jscript and
get a xml response back from the service?  Do I need to wrap it in a soap
package or something similar?

Any help would be appreciated.

Cheers
Keith
Martin Honnen - 28 Nov 2004 13:24 GMT
> So my question is how to send the xml back to a web service via Jscript and
> get a xml response back from the service?  Do I need to wrap it in a soap
> package or something similar?

You can do a HTTP POST request where the XML is sent in the body of the
HTTP request:
  var httpRequest = new ActiveXObject('Msxml2.XMLHTTP.4.0');
  httpRequest.open('POST', 'whatever.asp', true);
  httpRequest.onreadystatechange = function () {
    if (httpRequest.readyState == 4) {
      // process httpRequest.responseXML here
    }
  };
  httpRequest.send(putMsxml2.DOMDocument.4.0Here);

If you really want to send the data to a web service then of course you
might need to use SOAP, then the web service behaviour should help you
on the client, seach http://msdn.microsoft.com/ for that.

Signature

    Martin Honnen
    http://JavaScript.FAQTs.com/

Keith Chadwick - 28 Nov 2004 14:28 GMT
Thanks Martin,

I got as far as you mentioned last night but my problem is getting my web
service to accept the incomming data. Nothing like a weekend learner curve!

Cheer

>> So my question is how to send the xml back to a web service via Jscript
>> and get a xml response back from the service?  Do I need to wrap it in a
[quoted text clipped - 14 lines]
> might need to use SOAP, then the web service behaviour should help you on
> the client, seach http://msdn.microsoft.com/ for that.
Dan Rogers - 29 Nov 2004 20:34 GMT
Hi Keith,

I posted some answers to your original questions on your original post.

Regards
Dan Rogers
Microsoft Corporation
--------------------
>From: "Keith Chadwick" <webmaster-nospam@allianceevents.com>
>References: <er3Kv8L1EHA.3820@TK2MSFTNGP11.phx.gbl>
<O3AUj2U1EHA.1152@TK2MSFTNGP14.phx.gbl>
>Subject: Re: Submitting an xml document to a web service
>Date: Sun, 28 Nov 2004 09:28:59 -0500
[quoted text clipped - 8 lines]
>NNTP-Posting-Host: ottawa-hs-64-26-156-220.s-ip.magma.ca 64.26.156.220
>Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA06.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08
phx.gbl!TK2MSFTNGP09.phx.gbl
>Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:26840
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
>
[quoted text clipped - 23 lines]
>> might need to use SOAP, then the web service behaviour should help you on
>> the client, seach http://msdn.microsoft.com/ for that.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.