The following is a sample HTTP POST request and response
POST /Suppliers/WebServices/InsertLeads.asmx/InsertLead HTTP/1.1
Host: apps.abcsite.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
SupplierID=string&SupplierPassword=string&FirstName=string&LastName=string&EmailAddress=string&CoAppFirstName=string&CoAppLastName=string&Address=string&City=string&State=string&PostalCode=string&HomePhone=string&WorkPhone=string&WorkPhoneExt=string&CurrentEmployer=string&YearsThere=string&Income=string&BestCallTime=string&OriginalLeadDate=string&ExternalLeadID=string&IPAddress=string&ExtraFields=string
I want the below code to return me in HTML format instead of XML.
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
Here is one Instruction but I am asked to use this for C# , which I do not know :
This example assumes you have basic knowledge of how to use Visual Studio and the .NET Framework. In this example, the web reference to the ABCSite web service has already been added under a single folder called ABCSite. You would typically use this implementation when posting real time leads to our system via a form on one of your websites. This example is written in C#.
ABCSite.InsertLeads dpRealTimeWS = new ABCSite.InsertLeads();
ABCSite.returnMessage dpReturnWS = new ABCSite.returnMessage();
dpReturnWS = dpRealTimeWS.InsertLead(
Request.Form["txtSupplierID"],Request.Form["txtSupplierPassword"], Request.Form["txtFirstName"], Request.Form["txtLastName"],
Request.Form["txtCoAppFirstName"], Request.Form["txtCoAppLastName"],
Request.Form["txtCity"], Request.Form["txtState"], Request.Form["txtPostalCode"], Request.Form["txtHomePhone"], Request.Form["txtWorkPhone"], Request.Form["txtWorkPhoneExt"], Request.Form["txtBestCallTime"], Request.Form["txtEmailAddress"], Request.Form["txtOriginalLeadDate"],Request.Form["txtExternalLeadID"], Request.Form["txtIPAddress"], Request.Form["txtExtraFields"]);
lblWSResponse.Text = dpReturnWS.ErrorName + " " + dpReturnWS.ErrorDescription;
DAVIDPosted May 20, 2008, 3:56 AM
Here is what I want to do :
I sent one URL/ form data from myserver to another server and it returns me the XML file... now i dont want to show the XML and I want to show a proper HTML to my user... ..
One way to is to write one ASP.net file which will send data and will return me propr text instead of XML file.Sample Code enclosed in my previous mail.
Another way which I tried is :
<%
Call consumeWebService
Sub consumeWebService
Dim webServiceUrl, httpReq, node, myXmlDoc
webServiceUrl = "http://www.lead.com/LeadManager/generateLeadID.php?SupplierID=540&SupplierPassword=wein47&FirstName=Nita&LastName=Gower&City=hamton&State=CA&Phone=9515374649&LeadCreationDate=2008-05-17&DebtAmount=25000&internalLeadID=30893&LeadCreationDate=2008-05-17"
Set httpReq = Server.CreateObject("MSXML2.ServerXMLHTTP")
httpReq.Open "POST", webServiceUrl, False
httpReq.Send
Set myXmlDoc =Server.CreateObject("MSXML.DOMDocument")
myXmlDoc.load(httpReq.responseBody)
Set httpReq = Nothing
Set node = myXmlDoc.documentElement
'Set node=myXmlDoc.getElementsByTagName("ClientAvailable")
If Not node Is Nothing Then
Response.write "Node Text:" & node.text & ""
Exit Sub
Else
Response.write "Error."
Exit Sub
End If
End Sub
%>
But problem with it is it returns me BLANK node value.
Any help will be highly appreciated :-(
DavePosted May 20, 2008, 1:46 AM
Note: slapping an URGENT on a subject and copying and pasting a whole bunch of stuff into a post without clearly delineating the issues is probably not the best way to get help on this forum.