473,385 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to add webreference in aspx inline code

Hi,

I am working on enhancing an aspx page. The server-side is written
with inline code. The coding is not in VS.

The task is to make calls a webservice http://company/vnwebservice/vnwebservice.asmx.
The aspx page is not created in vs.net IDE but written through a text
editor.

The question is how do I add a web reference to the
http://company/vnwebservice/vnwebservice.asmx and start calling the
methods in the webservice.

I understand I have to a add a directive. Should I add a Assembly
directive or a Register directive ?

Can someone help with a example ?

<%@ Register TagPrefix="vw" TagName="vnwebservice.asmx" src="http://
company/vnwebservice/vnwebservice.asmx" %>

<%@ Assembly src="http://company/vnwebservice/vnwebservice.asmx" %>


Thanks,
Anand
Jul 1 '08 #1
1 3870
On Jul 1, 10:17 am, Sagar <anandsa...@gmail.comwrote:
Hi,

I am working on enhancing an aspx page. The server-side is written
with inline code. The coding is not in VS.

The task is to make calls a webservicehttp://company/vnwebservice/vnwebservice.asmx.
The aspx page is not created in vs.net IDE but written through a text
editor.

The question is how do I add a web reference to thehttp://company/vnwebservice/vnwebservice.asmxand start calling the
methods in the webservice.

I understand I have to a add a directive. Should I add a Assembly
directive or a Register directive ?

Can someone help with a example ?

<%@ Register TagPrefix="vw" TagName="vnwebservice.asmx" src="http://
company/vnwebservice/vnwebservice.asmx" %>

<%@ Assembly src="http://company/vnwebservice/vnwebservice.asmx" %>

Thanks,
Anand

Hey Anand

Use wsdl tool from from Visual Studio Command prompt:

wsdl /l:CS /n:MyProject /out:C:\source http://path/WebService.asmx

Here you can see by this command you can generate the source code in
C# that can invoke that WebService, MyProject is the namespace
obvisouly you are flexible to change according to your need. By /out
switch you can specify where the generated code would be stored in
your hard disk.

Now you can include this class file into your project and use as
usual. Hope it helps.

Tanzim Saqib
http://www.TanzimSaqib.com
Jul 2 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Søren Reinke | last post by:
Hi there I have 1 solution (visual studio 2005) within this solution i have many projects, they should all be able to have the same webreference to a webservice. But as far as i can figure...
6
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp;...
29
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form...
1
by: Kamal Ahmed | last post by:
Hi All, I have an aspx file written using vb.net that contains code both in code behind and inline. I want to access variable, object/classes declared in code behind into inline .aspx file....
4
by: Jason P | last post by:
Basically we have a web method with a dynamic URL. The client is developed in C++ and I've been using the webReference.SetUrl( "http://test.example.com..." ) method successfully with various web...
5
by: Kimba | last post by:
Hi. Using VStudio I have developed a WebService which I placed onto several servers. However my application can only access one on server. During runtime, I tried to change the URL of the...
0
by: taylorjonl | last post by:
I am having a problem generating some soap proxies dynamically using almost the exact same code as in the MSDN sample. ...
13
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
7
by: JeremyWoertink | last post by:
I have an app that I need to make changes to, and on my local copy I have a start.aspx.vb file that I edited and tested, now when I go to the app on the server, it doesn't show any of the .vb...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.