Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How use xmlhttp with ASP/Web Services in .NET?
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
How use xmlhttp with ASP/Web Services in .NET?
Divers
Thread ID:
00780332
Message ID:
00780332
Vues:
46
I try to use the xmlhttp object for improve a web form. Inside this page, is a jsscrip that collect the form's values in a xml string, send to the server and i need return back for refresh some info and other things. I can collect the xml, connect to the server, but not send the xml string. This is the code in the asp.net page:

function EnviarXML() {
// Prepare the XMLHTTP object for a HTTP POST to our validation ASP page
var sQuery="Ver=FACTURAS&Origen=factura&Id=&IdAlfa=&Titulo=Facturacion%20de%20ventas.&Seg=2&Con=1&Cod=&Filtro=&Sql=&InOut=&Ayu=";
var sURL = "http://localhost/ActiveNet/SrvActiveNET.asmx/ValidarForma?" + sQuery;
var lcXML=GenerarXML();

if (oXMLHTTP) {
}
else
{
oXMLHTTP= new ActiveXObject( "Microsoft.XMLHTTP" );
}

oXMLHTTP.open( "POST", sURL, false );//Se hace de forma asyncronica

// Define an event handler for processing
oXMLHTTP.onreadystatechange = managestatechange;
document.all.item("div1").innerhtml="Abriendo"
// Execute the request
try {
alert(lcXML);
oXMLHTTP.send(lcXML);
}
catch (e) {
alert("Ocurrio un error al intentar comunicarse al servidor.");
return false;
}
//document.all.item("div1").style.display = "none";
alert(oXMLHTTP.responseText);
return true;
}

function managestatechange() {
switch (oXMLHTTP.readyState) {
case 2, 3:
// Display a progress indicator of some kind, informing the
// user that you are checking to see if the UserID exists
//document.all.item("div1").style.display = "block";
break;
case 4:
if (oXMLHTTP.responseText == "ERROR")

alert("Fallo al conectarse al servidor. Intente mas tarde...");
//document.all.item("div1").style.display = "none";
break;
}
}

In the server, is a web service. This is the test code:
Public Function ValidarForma() As String
Dim oData As DataSet
Dim oSrv As srvConstructorFormsNET.TDataManager
Dim larrTemp(0, 0) As Object
Dim i As Integer

' Correr la consulta
Try
oSrv = New srvConstructorFormsNET.TDataManager()
oSrv.Params = srvConstructorFormsNET.srvConstructorFormsNET.TAdminForms.CargarParametros(Me.Context.Request, larrTemp, False)
srvConstructorFormsNET.TDataManager.GuardarArchivo("d:\basura\basura.txt", Me.Context.Current.Request.Form.ToString)
oData = srvConstructorFormsNET.TDataManager.StringXmlToDataSet(Me.Context.Current.Request.Form.ToString)
Catch E As Exception

Return "Error: " + E.Message
Finally
oSrv = Nothing
End Try
'Convertir a XML
Return srvConstructorFormsNET.TDataManager.DataSetToStringXML(oData, XmlWriteMode.IgnoreSchema)
End Function

An in none of the var of the request appear the XML string (i try with: Me.Context.Current.Request and Me.Context.Request, Params,Cookies,Form).

How read the xml in the server???

(P.D. I see in several ASP only example that simply do oXMlParser.Load(Request) and work, how in ASP.NET???)
The Life is Beautiful!

Programmer in
Delphi, VS.NET
MCP
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform