WCF / ASMX :: How To Call Asmx Web Service In A .net App From Classic Asp App Js File
Mar 17, 2011
I have a .net app developed in .net 4.0 version. And I implemented an asmx web service in this. Now I want to call one of the webservice method in another classis ASP application java script function.
if i have the web application with many pages like add order page, edit order page, and delete order page actually they also interact with the Sql Server 2008 and i also create web service page call Sales_Service.asmx. i know just i need to put something like query into Web Method in Sales_Service.asmx but i have a lot of queries, i don't know which query i should put into it and how the web page call the Sales_Services.asmx
We have a big portal with a lot of code written in classic asp + asp.net 2.0 + JavaScript. We are planning to slowly migrate to .net 3.5 framework with WCF Services. Currently the ASP.Net code is using some business layer to access the database. But most of the Classic ASP is using the old ADO code and directly accessing the data in the page itself. Now, we decided to add a WCF layer between the UI and Business which will be easier to implement with ASP.Net + 3.5, compared to Classic ASP. And we can't invest a lot of Man Hours in converting the Classic ASP pages to asp.net just yet. So we decided to Add a COM layer between Classic ASP and WCF services. So it will be like
Classic ASP -> COM -> CCW (COM Callable Wrapper - Interop) -> WCF -> Business for now.
Later on when we slowly convert the Classic asp pages to asp.net, the COM layer will be removed by default. But for now we are atleast pulling the Business code from Classic Asp pages. We are following this approach because we are not sure how to go about accessing the WCF Service directly from the Classic ASP code.
I am using JQuery & JSON (POST) to call webmethod. However I can call only webmethod located at aspx file but not in asmx file Below are sample codes
CustomValidate.asmx Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.ComponentModel Public Class CustomValidate Inherits System.Web.Services.WebService 'ACCESS VIA JSON <System.Web.Services.WebMethod()> _ Public Shared Function AJAX_Test(ByVal date1) As Boolean... Return True End Function End Class Javascript: JQuery JSON function isDates(source, arguments) { var isValidDate; $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "CustomValidate.asmx/AJAX_Test", data: '{date1: "' + arguments.Value + '"}', dataType: "json", async: false, success: function(result) { isValidDate = result; }, error: function(httpRequest, textStatus, errorThrown) { alert("status=" + textStatus + ",error=" + errorThrown); } }); arguments.IsValid = isValidDate; }
It always return javascript undefined error. But if I put the AJAX_Test webmethod in aspx page and replace the url: "CustomValidate.asmx/AJAX_Test" to "mypage.aspx/AJAX_Test". It works fine.
I'm about a custom WSDL File Generation for a Classic ASP.NET XML Web Service.
The issue is I didn't find out how to specify mandatory parameters in my WSDL, since ASP.NET Web Services are generated on ?WSDL location, I thought I would do that from Web Method Annotations, but I found no issue.
Also I have been on a pose where the developer could hide WSDL Generation by specifying a custom WSDL Binding. But in my case I need to let other system access ?WSDL location with a Customized WSDL.
How to call Synchronous service call for combo boxes? As I know Synchronous calls do not create a good user experience because the application is hung waiting for the Web service call to return. Then it is my requirement.
i have created a normal web service and i want to host it outside IIS. one idea i got is to use window service as hosting environment. i have created a web service and hosted it window service and its window service is running now.would anybody please let me know that how can i call web service hosted in window service binded over soap.tcp. here is my sample code.
I need to download a file from a website to my specified folder and use in my asp.net application.The file is update everyday and i need to pull the latest file.
n my A.aspx, I will call web method GetName in B.asmx
Is it possible, before my A.aspx call GetName in B.asmx, I inject or put some codes so when A.aspx try to call the method, it needs to go through my injected code without even changing the code in A.aspx and B.asmx?
Is custom HttpModule able to handle this scenario? If yes, how? Which HttpModule's event that occurred before the page actually called the web service?
Need to see how long a web service method takes to comlete. Ideas? The call is being made from a windows client. Also need to see how much memory that particular web method consumes, cpu useage etc.
Should I look at perfmon? Then filter for a particular web service name?
I know almost nothing about coding in .NET and XML and web services.I need to call a web service and pass it a structured XML statement and catch the return from the web service.I have no idea where to start except I think I am suppose to create a new 2008 VB.NET ASP Web Service App. After that I have no clue. Here is a copy of the bindingattribute I think I need but do not know how to use it: (I think it is correct)
I also have the xml statement I want to test with. I need to send it and recieve the response. I am pretty sure the web service is using SOAP and I know the XML will have to be wrapped in a SOAp wrapper but I have been told .NET will do that for me.
We have two application created one for webservice and other application will call the methoddefined in webservice .The problem is we want to add webservice in our application dynamically
I need to call remote web services for example [URL]. So how to do it? I watched all asp.net video about web servies but in all videos they speaking just about local web services,
I am creating new WCF service and i would like to do two way XML for communicating with third party vendors. My wcf service get the request from the outside program by means of URL and it should response accordingly.
Example - I have url which third party will call and put xml as a request, i have to get that xml, work accordingly and response back with either success or failure and appropriate xml. I need to make it completely automatic so anybody can call that url, it will validate that user and do the next step of request and response.
I have an process that take about 15minutes to execute. And i have toput this process in a service, and managed his statWell, i placed this process in a service and in some specific pointi have one variable telling me how much % the process have done.So my service reference im my consumer project its typed to let asynchronous calls.When i start my process with a
I am trying to call a web service which is hosted in .net framework.
Here is my piece of code:
<% function ValidateUser() set objSoapClient = server.CreateObject("MSSOAP.SoapClient30") objSoapClient.ClientProperty("ServerHTTPRequest") = True Call objSoapClient.mssoapinit("http://10.13.222.240:81/megaservice/UserWS.asmx?WSDL","UserWS") ValidateUser=objSoapClient.IsUser(2) End function %>
And i call the function as
<% =CalculateDiscount %>
It is giving error as
Server object error 'ASP 0177 : 800401f3' Server.CreateObject Failed /asp/index.asp, line 12 800401f3
i am working on .net and new on asp.I haven't worked on asp and it was pretty easy to call through visual studio in .net but can't do the same for asp
using the VS(2008) Data configuration wizard, and it found the web service and displayed various items from the service. I want to make a simple call to this web service (mainly to learn how to do it). Here is some sample code I found, but I just don't know how to implement it.
I named my web service reference LiveSearchService. What code do I need to implement, what libraries, to retrieve any information from this web service?
Cannot find a simple example that will call POST a service with username pass argument.
So, how to get the length of the service.
Code: Dim encoder As ASCIIEncoding = New ASCIIEncoding Dim data() As Byte = encoder.GetBytes(rawresp) Dim request1 As HttpWebRequest = CType(WebRequest.Create("http://www.sas.gr/MobileService/MobileService.asmx?wsdl&op=getCinemaMoviesProgram"), HttpWebRequest) request1.Method = "POST"
[Code] ...
Complains about wrong bytes. I can make it work with GET but i only get the schema.
Code: Dim request = DirectCast(WebRequest.Create("http://www.sas.gr/MobileService/MobileService.asmx?wsdl&op=getCinemaMoviesProgram"), HttpWebRequest) request.Method = "Get" ' request.ContentLength = 0 request.Credentials = New System.Net.NetworkCredential("WSl", "WSs") Dim response1 = DirectCast(request.GetResponse, HttpWebResponse) Dim reader = New StreamReader(response1.GetResponseStream()) Dim rawresp As String rawresp = reader.ReadToEnd()
This will only give the schema back, no data. Also if i reference the service there is no getCinemaMoviesProgram function to call, so I suppose it only works with post.