How to call a .net web service from another .net web service?

Hi all,

I have developed two asp .net web services using visual studio .net 2003.
I wish to call one web service from another web service.
I tried adding a web reference of the web service in another web service and was able to do so.
but i m not able to access the web methods provided by the web service
could you please suggest a way to go about it

Expecting quick reply

8/4/2005 4:31:49 AM 7071 articles. 0 followers. Follow

7 Replies

Similar Articles

[PageSpeed] 59

try to make sure that you reference it in the web reference and call it properly 

this is sample 

public double CalcDistance(int x1, int y1, int x2, int y2)
Calculator.Service1 calc = new Calculator.Service1();
// Calculate the difference of the y and x coordinates
int yDiff = calc.Subtract(y2,y1);
int xDiff = calc.Subtract(x2,x1);
return Math.Sqrt(Math.Pow(xDiff, 2.0) + Math.Pow(yDiff, 2.0));

Fadil Alnassar | FREE Nodil Tab Control
8/4/2005 9:14:23 AM

I had tried calling the web service, the same way as u have mentioned

but then too could'nt access the web methods

But I was able to add the web reference

Can u plz suggest the possible reasons for the same


Thanx a lot


8/22/2005 4:29:22 AM
ok..... i think we need to test one thing ..... you are trying to consume the WS from a WS and that give problems 
what i want you to do is test the WS itself to consume from a Web app or win app and try to see if the WS can be consumed successfully.... then we can tell where the problem occur

Fadil Alnassar | FREE Nodil Tab Control
8/22/2005 8:45:33 AM

Yes I m able to consume the web service from a win application

but unable to call a web service from another web service

Plz suggest the possible reasons for the same

Thanx a lot for your help


8/23/2005 3:13:18 AM
    Can u please post the exact error ur getting while calling the methods of the web service. else pls post the error information. Otherwise its hard to help you.
8/23/2005 11:17:40 AM
Hi, the easiest way to do that is to make a web reference to the
service that you want to call. Then you have to make an new instance of
that web service and then call it's web methods. Nothing more.
8/25/2005 12:38:07 PM
i think he is doing the steps all right but we need to get a better describtion of what is the error he is getting so we might be able to tell what is the problem!!
Fadil Alnassar | FREE Nodil Tab Control
8/25/2005 1:27:49 PM

Similar Artilces:

Web service in .NET from Java Web Service
Hi there,I'm pretty new to .net (although i have years of experience with the old vb 6, access 2k, as well as java)... and need some with perhaps either some syntax or something.Here is the wsdl.<wsdl:definitions targetNamespace="">−<wsdl:types>−<schema targetNamespace="GetBookInfoByISBN">−<complexType name="BookInfoType">−<sequence><element maxOccurs="1" minOccurs="0" name="Title" nillable="true" type="xsd:string"/><element maxOccurs=&quo...

.NET web services Vs Java Web Services
Hello, does anyone know of a book or good source of information that compares .NET and Java Web Services? (I would like soemthing neutral if possible). I am thinking of approaching this subject for my dissertation? Many Thanks Rob Hi Rob, Last year I had to give a powepoint presentation on Web Services. I noticed some good books at barnes and noble that discussed the subject. These books were specific to Java and discussed Web Services in a very clear fashion. They gave some elementary examples that were easy to understand. I have not yet had the pleasure of creatin .NET Web Servi...

Can you return .net web controls in a .net page from a web service?
I've got a problem with a project. I've got to compile an entire .net page and return it as part of a Web Service for display. The problem I have is that I need to add WebControls and functionality to the page so that not only the html content and images are displayed (which I've managed) but that textboxes, labels, buttons and datasets can be displayed also. Essentially I need to make a call from one site for a page, populate the page and return it in a state as though it resided on the same server/webspace as the calling page. Code is currently built as follows into a string: strOpenHT...

Best Practice for .Net Web Service access to a Web Service on a Test and Production Servers
Hello All, What is the best way to control a .Net web service to be able to access a remote server for testing and then point to another remote server to access the web service in production? Do I need to generate and maintain 2 different proxy objects? TIA, Bob Bob // first create the proxy if not isvalid( i_service) then i_service = create fundtraderproxy_TradeServicesClient_BasicHttpBinding_ITradeServices end if ///You'll see code something like this in the constructor of your proxy //dynamically set the endpoint url with the user supplied value - //r...

Calling a Web Service from a Web Service
Hello,I was looking for some feedback on calling a web service from within a web service. I've heard that it's not good practice (or not possible). I have a scenario where I think it might make some sense.Within our infrastructure, we've created a web service that handles incoming updates on the statuses of all processes. This has proven to be a good thing since it allows applications to communicate across server to make status updates. It's also used by third party developers and applications to communicate with our infrastructure.Along these lines ... we are planning to create a new compon...

How to call .net web service from Java web application?
Hi all,  I have a vb .net web service.How do i call .net web service from Java web application?What all resources I need?Can you please provide a sample application where a java application is invoking methods of .net web service? Thank you Hi, First I am not familiar with java language, but web services are universal operating system and language independent. It doesn't matter where the services is or in what language is written you just invoke it  and it gives you "replay".  Probably you must reffer to java consuming web services.   Regard...

asynchronous call of web service method from another web service
I am calling a web service method from within another web service.  Both are called asyncrhonously. Webservice 1 is invokde from a consumer app and its completed event is assigned an event handler, this works ok  The webservice being called is itself invoking another webservice and asynchronously calling another web method, again Ive assigned an event handler to its completed event, which works.  My problem is how do i expose the ouput (a dataset) of the second web method to the first web method ? Hi, Please have a look at this article:

Troubleshoot Web Service; Ajax AutoComplete events do not appear to not fire; Ajax web service appears to not work. .NET
Folks, I had the situation that Ajax AutoComplete events in the web service did not fire after I copied a project out of a folder, renamed it and moved it to a server. The fix was hard to find but easy to solve. I had some web service modules in an ASMX file that provided AutoComplete entries -- i.e., after the user keys in 2 or 3 characters, the list of possible entries with those leading characters is displayed for the user to select. To solve the problem, look at the web service's directive, not the code-behind or the ASMX designer.  Do a right-mouse-click...

web services calling services simultaneosly problem in .net 2.0
hi i m facing a problemwe are using desktop client and webservices in that client request the a webservice asyncthat remains on server until a specific condition is satisfiedand rest of the web services are called syncronsly these services run on localhost without any problembut if client and server machines are diffrent it hangs the applicationdont knw wht is the reasn and after some time operation has timed out exceptions comelet me tell u one more thingboth the services are using different sessionsthanx in advance for ur help   i have made sample application to test the scnerio...

Can you call a web service from a web service?
I am trying to create a web service that itself consumes a 3rd party web service outside of our corporate firewall - so basically a web service consuming another web service.  I can consume this outside web service directly in an ASP.NET application without a problem.  But because the code is long and cumbersome, I wanted to provide our GUI developers an easy way to get all of the data they need from one source.  So I thought I could create an internal web service that would do a lot of things (query internal systems, for example) as well as consuming this external service.&nb...

Web Service invoking another Web Service
hello, I have a web service and I have to consume another web method of some other web service. I have to do everything through code. [I cannot use "Add Web Reference" utility in the VS.NET]. I am using C# for coding the web service. Thanks in advance. Phanikum Yep, You could do that! Basically you have to use WSDL.exe Once you have proxyclass in a file from WSDL.EXE, make an assembly and use that in your app! Sreedharhtt...

xml web service --uploading the file to the xml web service
how can we upload the file in the xml web service 1.i mean what will be the return value in the proxy class 2.and how am i going to send the file to the xml web service----regards Bipul Kumar Here are some links to articles that helped us get this done: Hope this helps....

.NET Web Service and Non .NET programe
When we develop a web service by VB.NET. Then i use visual basic, Microsoft access, asp. Can these stuff access to my web service ? Means you want to access Webserver developed in VB.NET in ASP application?Sreedharhttp://www.w3coder.orgweblog

Cannot call a web service from java script using ajax in .net 3.5 web applications
As like 2005 .net websites i tried to consume a web service from client side java script  using Ajax script manager in  .net 3.5 (2008) version web application it was not working, Event it works with 3.5 web sites, What i have to do to solve the issue. Thanks in advance Hi, can you create the least amount of code to reproduce it and post it? This gives us the ability to check out your code and better guide you. Also please check out this article: Create a Simple WCF Web Service and Use In JavaScript With Visual Studio 2008 and .Net 3.5.  Grz, Kris.Read my blog. Handy Fire...

Web resources about - How to call a .net web service from another .net web service? -

United States Department of Health and Human Services - Wikipedia, the free encyclopedia
The United States Department of Health and Human Services ( HHS ) is a Cabinet department of the United States government with the goal of protecting ...

This Chinese Public Service Ad Brought to You By a Talking Fetus
The environment, especially air pollution, can be a sensitive topic in China. So it's interesting to see a public service message from the state-owned ...

Disney launches DisneyLife, a UK-exclusive online streaming service
Disney has entered the online streaming market with DisneyLife, a brand new service that launched in the United Kingdom on Tuesday (with a global ...

Researchers poke hole in custom crypto protecting Amazon Web Services
... cryptographic software, academic researchers recently uncovered a potentially game-over weakness in a code library protecting Amazon Web Services. ...

Amazon Reports of Air Freight Service Just the Start, Says Baird
... at $674.43, following an article this morning on Motherboard by Kari Paul stating the company has developed its own trial air cargo service, ...

Ultimate pirate TV streaming service returns with hundreds of channels and new features
This past May, we were among the first to tell the world about a pirate TV service called cCloud TV . The service made a name for itself by collecting ...

5 Services That'll Keep the Men in Your Life Looking Effortlessly Dapper
Use these services and you'll have the sharpest-looking man in the neighborhood. Whether it's for a business trip or the upcoming holidays, ...

Alphabet is reportedly going to make its subsidiaries pay for Google's services
... to do their own recruiting or build their own technical infrastructure if they feel up to it. But if they want to use the established services ...

Report: Juniper Is Eating Cisco's Lunch In U.S. Service Provider Routing Market
Report: Juniper Is Eating Cisco's Lunch In U.S. Service Provider Routing Market CRN Juniper Networks appears to be on a comeback in the U.S. ...

The Postal Service Doesn’t Even Deliver Mail Well, And Some People Want To Make Them Bankers
The Postal Service Doesn’t Even Deliver Mail Well, And Some People Want To Make Them Bankers

Resources last updated: 11/26/2015 12:33:25 AM