Overblog Follow this blog
Edit post Administration Create my blog
Balavardhan Reddy Narani

Artical on Webservice II

March 7 2009 , Written by Balavardhan Published on #ASP.Net

By the Previous Post I Explained about web service.

By this Post I Explaining, How to Publish Web service and How to Call Web Services From Remote Server

Step 1)
Create A Web Service and Build it.
Step 2)
Publish Web Service into a Remote Server.

Steps to Publish
1). Select "Build" Tab in Visual Studio Menu Control.
2). Click on Publish Web Service.
3). Provide Path where to Publish Web Service.
it uploads only necessary files like (.asmx, .dll files).

How to Use Web Service which resides in Remote Server in A Web Application.

step 1) Create A Web Application.
Step 2) Add Web reference to the Application, Provide the Remote Server web service path in Address bar.
like(http://<Remote Server>/<Web Service Folder Sharing Name>/Service1.asmx?WSDL)
Step 3) While accessing Remote Web Service Methods in Web Application by web service object it gives Error like

"A web request made using the iframe executor failed. Make sure that the app's web.config registers iframecall.axd in its ."

To Over come this Error,
I got only one way that is Creation of Dummy Web Service in Application, in that Dummy Web Service you just Call the Remote Web service Methods. and call dummy web service methods in Web Application instead of directly calling of Remote Web service methods.

Step 4) Some times I got Error Like
"Error 401 : Access Denied "
While calling Remote Server methods some times I got Error like Access Denied to call web service methods.

To Over come this Error you need to provide the Credentials while calling web service.

<<Webservice_Obj>>.Credentials = System.Net.CredentialCache.DefaultCredentials;

Step 5) Once I got Error Like
"An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below."

one of the Solution for this Error is

I have a suggestion: Check all webservice references in your webparts to see if any of them are potentially referencing an invalid URL. The issue I had was with an atlas:InitialData control which had a servicePath specified as "~/thewebservice.asmx". When this code was deployed to a non-development server, the error described in the first post was generated.

Hope this saves someone some time

Share this post

Repost 0

Comment on this post