.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Santhakumar Munuswamy
Fauzul Azmi
Asad Ali
Post New Web Links

calling a web service on a remote server from an ASPX page

Posted By:      Posted Date: August 29, 2010    Points: 0   Category :.NET Framework
 
hi, I want to call a web service on a remote server. I've done "add web reference" in my project, and VS2005 has created the .discomap and .WSDL in the App_Web_Reference folder. When I try add the namespace representing the web server (the name I created when I added the web reference) by "using XXXXX;" the code does not compile because XXXXX is not defined. Have I missed any steps? thanks, -me


View Complete Post


More Related Resource Links

calling a web service on a remote server from a ASPX page (web site project VS2005)

  
HI,I am maintaining a web site project in VS2005 and have to call a new web service on a remote server. I've done add web reference, and created the .wsdl and .discomap files in the app_webReference folder.  When I try to create a object representing the web service in the code ( wsnamespace.serviceName ws = new wsnamespce.serviceName(); ) the code wouldn't compile.The web site project is already calling other web services. When I right click on the type representing the web service and "go to definition" it takes me to a proxy class (derived from of course SoapHttpClientProtocol) in the metadata. I think this is what's missing for  the new web service i'm trying to call. Have I missed any steps?Thanks in advance.-me

Calling JSON service on remote server (server side)?

  

Hey guys, i am building this application on the 3.5 and i am in the need of calling the JSON web service that resides on the remote URL. This service only supports POST so it seems I cant use the "add web reference" from the 2008 studio so i guess is i need to go about connecting and retrieving data manually. I am assuming i need to build some kind of a proxy to connect with it. One last thing, it needs to be on a server side.

Can you please point me into the right direction?

Regards,
Chris


Error calling Web Service. The remote server returned an error: (500) Internal Server Error

  

I am trying to extend my Sharepoing 2007 workflow using Ilove Sharepoint custom workflow actions. I have successfully installed ilove sharepoint exposing the ILOVE SHAREPOINT WORKFLOWS. the workflow however returns an error message 500 internal server error. When i try to access
the same using asp.net application it seems to work.

Web service code

using System;

using System.Collections.Generic;

using System.Linq;

using

Calling a public method on aspx page from a usercontrol

  
Hello, I have a problem with calling a method on a aspx page from a usercontrol. The case is:I have 1 main page with 5 usercontrols, when something goes wrong in the code I want to display the error message in a Modalpopup Extender.I can create for each usercontrol a different modalpopup extender but isn't much easier when I make 1 popup in the aspx page.But the problem is: How should I call a method in the aspx page that open the popup? I have search several hours on the internet but can't find anything useful. Thanks,  

change the PHP page with WCF service on Servers only, without chnging code on the calling client sid

  

Hi

I need to change the PHP page with WCF service, but the problem is that many of our clients are sending(usig POST) large stream data like binary files to our PHP website, now we are upgrading our system and moving towards wcf services,

The problem is that we want our clients to only change URL, and do not need to change any code in their calling mechanism or no need to create proxy on their cliend side. We simply change php to wcf services on our Servers only. Our clients are using .net 2.0 client application. Is there any way to do this. or Is this possible ?

One thing which I get from internet is use Rest based wcf services.

Have anybody some example or idea to accomplish my task.

Regards
Zee


Calling WCF Service from SQL Server 2008

  

Hi,

        I'm facing a problem in accessing a WCF Service from a stored procedure in SQL Server 2008. The error obtained is as follows. An pointers to solve this issue wud be very helpful.

Issue:
Msg 6522, Level 16, State 1, Procedure USP_CLR_ADD, Line 0
A .NET Framework error occurred during execution of user-defined routine or aggregate "USP_CLR_ADD":
System.TypeInitializationException: The type initializer for 'System.ServiceModel.ClientBase`1' threw an exception. ---> System.Security.HostProtectionException: Attempted to perform an operation that was forbidden by the CLR host.

The protected resources (only available with full trust) were: All
The demanded resources were: Synchronization, ExternalThreading

System.Security.HostProtectionException:
   at System.ServiceModel.DiagnosticUtility.GetUtility()
   at System.ServiceModel.DiagnosticUtility.get_Utility()
   at System.ServiceModel.ClientBase`1..cctor()
System.TypeInitializationException:
   at System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()
   at System.ServiceModel.ClientBase`1..ctor()
   at TestServiceClient..ctor()
   at Channel.ServiceChannel.GetSum()
.


Steps:
<

Error : Unable to connect to the remote server, When using web service in window service

  
Hi All,

          I want to consume a web service in windows service but in windows service I am not able to access  web service. I have tried it in windows application and web application it is working fine but in windows service  it is not accessible.

 

i am getting error:-   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)--->   at System.Net.HttpWebRequest.GetRequestStream()
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Testmachone.MachWebRef.SimCardWS.ProvisionImsiCard(String MsMin, String MsEsn, String CardId, String UserId, String Password, String MscId, String BId, String NewValue, ActionTypes Command, String MDN, String COS, String MIP_KEY, String MEID, String RADIUSPassword, String IMSI, Boolean PrePaid)

 any body can help me what could be issue

 
<

Adding a server control on aspx page does not add events in aspx.designer.vb file

  

Hi,

I work in VS 2008. Whenver I add a server control(Label) and set it properties in aspx.vb and build the solution, I get the error "Label1 not declared". While analyzing this issue I noticed that the event handler statements for the Label1 where not added in the designer.asp.vb file. These statement would actually be added automatically when I drag and drop a control to my webpage.

I would also like to inform the scenario after which this problem came to me. I was working in VS 2008 , VS 2005 and VS 2003 in the same machine.Could this have caused the issue ? Please advise.

Now each and everytime when I add a control, I am adding the "With Events" code in the designer page to make my build succesfull which makes me to spend more efforts.

Please advise if any settings have to be changed.

Thanks,

Arunesan


Calling WCF service from asp.net page

  

I have a simple asp.net page with a few buttons. The code behind for each button calls a WCF service function via a proxy. The page works fine when debugged from VS.NET 2008 - each button correctly makes a call to a remote WCF function,  However, when I deploy to IIS, the buttons do not respond. No erros is generated on the page.

 

Any ideas? Thanks


Best way to "ensure" that an ASMX web service is only called from AJAX on a specific ASPX page

  

I have an ASPX page which hosts a Custom Control.  That custom control needs to call an ASMX web service.  I would use a PageMethod, if the fact that I'm calling from within a Custom Control didn't preclude that. 

I'm looking for some guidance on the most effective way to try and lock down the ASMX call such that it will only succeed for my users calling it from my ASPX page - and not for anyone trying to call it from elsewhere.  I've seen various ideas around session variables and so on.

What's the expert view, please?


"The request failed with HTTP status 403: Forbidden" when asp page calls remote web service

  

Hi,

I use iis7 on win7 pro. I develope an aspx web page which calls the web service in remote site.When it runs, I get an error in the below:

"System.Net.WebException: The request failed with HTTP status 403: Forbidden..."

What's the problem?

Thanks for helps.

Mehmet

 


Display image from remote server on asp.net page.

  

I have a webform that I will use SQL Stored procedure to return a path to an image on a remote server.  I need to display that image on my webpage.  I have been reading for 2 days now and have found nothing on loading images from a server.  Something like this \\ServerName\K:\LFCMBS2008\K2008\K20081\00\00\00\00000001.tif.  Is this not possible, or have I just been googleing the wrong things "ASP.net Display image from server"?  My server contains literally millions of images that I need to use on my site.  Please advise.


How to access SQL-Server with in aspx page

  

Hi,

this is probably a dummy question, but I didn't find a tutorial working for me after searching for some time now.

 

I'm playing with a small web project and can successfully use a connectionstring from a website.config in eg. a GridView.

Now I have the need to access this connection string from some custom VB code.

What I found so far is, that I need somthing like this (at least I guess so):

<%

Dim connstring as string
  connstring = ConfigurationSettings.AppSettings("myconnectionstring1")
 

 

%>

 

Now how do I execute any kind of SQL-code against this connection?

In this current case I need to run something like "delete from schedules where startdate<getDate() -10"

But basically could also be a query like "select * from schedules" and then checking the values or whatsoever...

 

Please someone help me or even a link to a easy understandable guide would help.

 


mocking we service - Unable to connect to the remote server

  

I wanto to use a mocking web service, mocked with Soapui.But when I close the

main web service(stop the locally created web service in IIS) and try to call the mocked web service from an asp.net

project I got the error "Unable the connect the remote server".

How can I connect a mocked web service when having no connection to the actual web service.

Are anyone have any suggestion.


Server Side Javascript in ASPX page

  

Hi,

We have a Classic ASP application. We need to migrate this Classic ASP application to ASP.net.

We have extensevly used Server side Javascript in our Classic ASP Pages.

Basically we have mix of both VBScript and Javascript in same ASP pages.

Need help in migrating such ASP pages (using serverside VBScript and Javascript).

Migrated Code samples will be most welcome.

For migration,  we are planning to use : ASP to ASP.NET Migration Assistant

Example below -

  • Sample.htm : These kind of HTML pages are hitting ASP pages to get response from server.
  •  

    <html> 
    <head> 
    <script> 
    var strURL = "http://localhost/Samples/"; 
     
    function test0(methodType){ 
     
            var oRequest = new ActiveXObject("Msxml2.XMLHTTP"); 
            var url = strURL + "Sample.asp";  
             
            oRequest.open(methodType,url,false);  
            oRequest.send(null);  
     
            var resp = oRequest.responseText; 
             
            alert(resp); 
    } 
     
    </script> 
     
    </head> 
    <body> 
    <input type=button onClick="test0('GET')" value="Click me - Get Method"/> 
    <br><br> 
    </body> 
    </html>
    • Sample.asp : This is sample ASP page where we are using both servreside VBScript

    Server Side Javascript in ASPX page

      

    Hi,

    We have a Classic ASP application. We need to migrate this Classic ASP application to ASP.net.

    We have extensevly used Server side Javascript in our Classic ASP Pages.

    Basically we have mix of both VBScript and Javascript in same ASP pages.

    Need help in migrating such ASP pages (using serverside VBScript and Javascript).

    Migrated Code samples will be most welcome.

    For migration,  we are planning to use : ASP to ASP.NET Migration Assistant

    Example below -

    • Sample.htm : These kind of HTML pages are hitting ASP pages to get response from server.

     

    <html>
    <head>
    <script>
    var strURL = "http://localhost/Samples/";
    
    function test0(methodType){
    
    	var oRequest = new ActiveXObject("Msxml2.XMLHTTP");
    	var url = strURL + "Sample.asp"; 
    	
    	oRequest.open(methodType,url,false); 
    	oRequest.send(null); 
    
    	var resp = oRequest.responseText;
    	
    	alert(resp);
    }
    
    </script>
    
    </head>
    <body>
    <input type=button onClick="test0('GET')" value="Click me - Get Method"/>
    <br><br>
    </body>
    </html>
    • Sample.asp : This is sample ASP page where we are using both servreside VBScript and Javascript.

     

    &

    Launch CMD File From ASPX Page

      

    My organization uses a CMD file to install updated files for a major enterprise application. Currently, we send out an email to users with a link to the file and instructions to run it, BUT inevitably users don't update their machines until their in field and try to start the app.

     

    We're now liking the idea of using an ASPX page to prompt the users to run the updates and to capture the fact that the updates have been run. I realize that we can't capture the success or failure of the update. But we'd like to capture the user accessed the page.

     

    Is it possible to embed into the markup for the page a link to the file on the local intranet that the users can click on to run the file?

    The user accessing the page would capture that they did just that. We'd deal with wether or not the update was actually installed or if it failed later with them directly.


    Categories: 
    ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
    Sql Server  SharePoint  Silverlight  Others  All   

    Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend