WCF / ASMX :: Capture The ToArray() Value From Webservice To Aspx.cs
Jul 21, 2010
I have one function in webservice:-
/// <summary>
/// Get the required user agreements for the application specified.
/// </summary>
/// <param name="applicationName">The name of the application.</param>
/// <returns>A UserAgreement array containing the name and text of the user agreement.</returns>
[Code]....
i have already registered the webservice, now i need to capture the return value in my aspx.cs page.
I have datatable consist of 20 records and i want to bulk insert into sqlserver through the asmx webservice. Can anybody guide to me or provide Sample BusinessLogic and webservice code.
I use HttpRequest, when there is a SOAP fault, I get 500 error. I read that you can get the SOAP fault info in the response stream, but when there is a 500 error, how do you get the response stream?
How do I capture the outgoing and incoming soap requests using VS 2008? I read about the SOAP toolkit but it seems the framework now does it? Is it in the Windows SDK?I am debugging a web service on FedEx and they want to see the the SOAP file.
I am developing a website that has more and more LINQ queries. I have been keeping down the download size, optimizing the images, js, css and using HTTP Compression. I notice however, that now that I am using more LINQ queries and more complex queries, join and group joining queries, the 'waiting' time that the browser is doing is going up. The KB size of the page isn't any greater, but the page ultimately takes longer to load.
I have been reading up on LINQ and the behind the scenes of how it works. I have found that I need to use DataLoadOptions for the queries that join/group join to reduce the round trips to the database. I haven't had a chance to work on this yet, so if anyone has any great resources on this or tips, I'd appreciate it.
My main question about LINQ to SQL in this post is, if I have a bunch of queries throughout my site, in the masterpage, and the page itself, if I do not put .ToArray() at the end of the query, does that speed it up? If I leave ToArray() off of all the queries, do they then execute all at once when the page is loading instead of each time the page gets to that specific line to read and execute it?
I may be asking a dumb question, since I don't know a whole lot about the behind the scenes of LINQ yet, or the compiling of the page. I am using VWD 2010, so it does not have the SQL Profiler for me to test what I am asking.
I try to send an email with the html generated from an aspx file. But having this problem that only capture the aspx text not the html rendered by aspx. how can i do it , must use htmltextwriter? This is the code sample
<%@ Import Namespace="System.IO" %> <!--#include virtual="/asp/enviamail.aspx"--> <% Dim FILENAME as String = Server.MapPath("/boffice/adcasas.aspx") Dim sw As StreamWriter 'Get a StreamReader class that can be used to read the file Dim objStreamReader as StreamReader objStreamReader = File.OpenText(FILENAME) Dim contents as String = objStreamReader.ReadToEnd() dim strBody strBody = "<html>" strBody = strBody & "<head></head>" strBody = strBody & "<body>" strBody = strBody & Chr(13) & "A sua prereserva foi suplantada" strBody = strBody & Chr(13) & "Obrigado.Esperamos que o nosso serviço vá de encontro ás suas expectativas." strBody = strBody & "</body>" strBody = strBody & "</html>" dim sformat="MailFormat.Html"..........
public dynamic GetReferenceTableData(string tableName) { try { dynamic tableData = ReferenceTableDAL.GetReferenceTableData(tableName); return tableData; } catch (Exception ex) { throw; } } method at DAL(ReferenceTableDAL): public static dynamic GetReferenceTableData(string tableName) { Database db = DatabaseFactory.CreateDatabase(Flags.ConnectionStringKey); DbCommand dbCommand = db.GetStoredProcCommand("USP_GETTABLEDATA"); dynamic objDynamic = null; if (tableName.ToLower() == "a") { objDynamic = new List<A>(); } else if (tableName.ToLower() == "b") { objDynamic = new List<B>(); } else if (tableName.ToLower() == "c") { objDynamic = new List<C>(); } try { db.DiscoverParameters(dbCommand); dbCommand.Parameters["IN_TABLENAME"].Value = tableName; DataSet dsTableData = db.ExecuteDataSet(dbCommand); if (tableName.ToLower() == "a") { foreach (DataRow dataRow in dsTableData.Tables[0].Rows) { objDynamic.Add((A)dataRow); } } else if (tableName.ToLower() == "b") { foreach (DataRow dataRow in dsTableData.Tables[0].Rows) { objDynamic.Add((B)dataRow); } } else if (tableName.ToLower() == "c") { foreach (DataRow dataRow in dsTableData.Tables[0].Rows) { objDynamic.Add((C)dataRow); } } } catch (Exception ex) { throw; } return objDynamic; } @ Aspx try { using (DataServiceRef.DataServiceClient petService = new DataServiceRef.DataServiceClient()) { dynamic tableData = petService.GetReferenceTableData(tableName); //tableData is null ,exception } } catch (Exception ex) { throw; }
There is no exception at dal or service end when i debug list gets filled ok but when returns to aspx error at aspx(no exception gets caught at @ service) but exception at aspx i.e:
Message:The underlying connection was closed: The connection was closed unexpectedly. Stack Trace: at System.Net.HttpWebRequest.GetResponse() at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
I am using PHP web service in dot net [URL]I set the name of web service as Test but when I am trying to access object test I was not able to use that, is there is any other method to use PHP webservice.
I was looking for an asp.net webservice that uses .net 4.0 but everytime I choose 4.0 the webservice choice goes away.Someone suggested to me that maybe they(MS) want you to use WCF instead. I don't know much about it but he said they are like webservices but better. So anyone got a comparisons guide?
I have certificate(abcd.rar) , which I need to include when I call that web service from asp.net application, Some one tell me how do I implement certificate into my application, certificate is with file extention .rar
I'm calling an asp.net webservice from a VB.Net application.Is there any way to determine in the webservice that it was called from a specific application. I had a look at Me.Context.Request but I can't see anything that refers to my VB app.
try to guide how to call web service in my asp.net Application. I had Web reference of that web service.I added the Service to my application.i created name space and I try to use methods inside the web service it showing unable to connect server machine. I want to Use jangomail services from asp.net application. my application need to send mass mailing using jangomail service.when i try to access that web service( http://api.jangomail.com/api.asmx) it giving Some Error like Connection failed to
Facing an issue with the web service calls written in Java.When am trying to call webservices written indexer Java from my machine its takign ages to respond back.same URL when typed indexer explorer fetches abstract response immediately.if tried on other system and code seems to work find so no issue with the code.unable to figure out what could be the issue while accessing the same from my box?