So, I have to first store/save it and can try the code you sent me ?
But how to save it ?
No , there is no need to save it . What is web method return type ?
Samu Zhang
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
[WebMethod]
public string HelloWorld()
{
return "Aaa";
}
String is the type of retrun value. What is yours?
Samu Zhang
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
[WebMethod]
public string test2()
{
string xml = "<root>aaaa</root>";
Context.Response.ContentType = "text/xml";
return xml;
}
So you can use code below to load xml data.
protected void Button1_Click(object sender, EventArgs e)
{
localhost.Service1 ser = new localhost.Service1();
string xml = ser.test2();
XmlDocument doc = new XmlDocument();
doc.LoadXml(xml);
}
localhost.Service is the stub of webservice in client side.
Samu Zhang
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
<div mce_keep="true">send one soap message to webservice.</div>
<div mce_keep="true">recieve one soap message from webservice</div>
<div mce_keep="true">parse the message and get value</div>
Samu Zhang
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
kolucoms6
0 Points
14 Posts
Re: XML and HTML
Apr 01, 2008 09:24 AM|LINK
Currently it is
Form --- > InsertLead --- > XML Output
I am looking forward to
Form --- > InsertLead --- > XML---> HTML Output
Samu Zhang -...
All-Star
62163 Points
6101 Posts
Re: XML and HTML
Apr 01, 2008 09:32 AM|LINK
Hi kolucoms6 ,
No , there is no need to save it . What is web method return type ?
Samu Zhang
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
kolucoms6
0 Points
14 Posts
Re: XML and HTML
Apr 01, 2008 09:49 AM|LINK
Sorry, what do you mean by
" web method return type " ?
Samu Zhang -...
All-Star
62163 Points
6101 Posts
Re: XML and HTML
Apr 01, 2008 10:28 AM|LINK
Hi kolucoms6 ,
[WebMethod] public string HelloWorld() { return "Aaa"; }Samu Zhang
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
kolucoms6
0 Points
14 Posts
Re: XML and HTML
Apr 01, 2008 10:37 AM|LINK
I am sending few values from my form to the backend and it returns me the XML file which get displayed in my Internet Explorer.
Samu Zhang -...
All-Star
62163 Points
6101 Posts
Re: XML and HTML
Apr 01, 2008 11:04 AM|LINK
Hi kolucoms6,
Ok, the web method may like this one.
[WebMethod] public string test2() { string xml = "<root>aaaa</root>"; Context.Response.ContentType = "text/xml"; return xml; }So you can use code below to load xml data.
localhost.Service is the stub of webservice in client side.
Samu Zhang
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
kolucoms6
0 Points
14 Posts
Re: XML and HTML
Apr 01, 2008 12:33 PM|LINK
i
kolucoms6
0 Points
14 Posts
Re: XML and HTML
Apr 01, 2008 12:33 PM|LINK
I am using Classic ASP.
Samu Zhang -...
All-Star
62163 Points
6101 Posts
Re: XML and HTML
Apr 02, 2008 02:10 AM|LINK
Hi kolucoms6 ,
This is asp.net forum . I am not familar with Classic asp.
I found this article , hope it is helpful to you.
http://www.dotnetjunkies.com/Article/99CA4563-FBD4-411F-A9C6-FF9E8A0E664F.dcik
I think the principle is the same.
Samu Zhang
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
kolucoms6
0 Points
14 Posts
Re: XML and HTML
Apr 02, 2008 06:15 AM|LINK
Awesome example... Exactly what I was looking for.
Now, I have an Instruction to use it as in my form
<form action="http://apps.secretsite.com/Supplier...asmx/InsertLead" method="post" enctype="application/x-www-form-urlencoded" name="AA" id="AA">
For my ASP page, it will change to
webServiceUrl = "http://apps.secretsite.com/Suppliers/WebServices/InsertLeads.asmx/InsertLead?FirstName=" & Name
Set node = myXmlDoc.documentElement.selectSingleNode("//LeadID")
But I get an Error as :
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'myXmlDoc.documentElement'
/XML/MyXML.asp, line 19