469,898 Members | 2,328 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

consuming a webservice form another webservice

Hi all,
The problem is as follows:
I need to authorize a user: through a WS; if a setting is on, the webservice
will look in the local "database", if the setting is off it will connect to
the server ip that is set in the configuration and call the same WS to check
the user in the remote "database".

So far I don't know if I can call a webservice method from a webservice
method...

Is there a such way?

Thank you,
Daniel
Nov 21 '05 #1
4 2502
Yes, use the Begin and End versions of your method to process the call
asynchronously. Do a little research on "Asynchronous WebService" or
"Calling a webservice asynchronously" - something to that nature.

"Bamse" <bd**************@yahoo.com> wrote in message
news:O9**************@TK2MSFTNGP14.phx.gbl...
Hi all,
The problem is as follows:
I need to authorize a user: through a WS; if a setting is on, the
webservice
will look in the local "database", if the setting is off it will connect
to
the server ip that is set in the configuration and call the same WS to
check
the user in the remote "database".

So far I don't know if I can call a webservice method from a webservice
method...

Is there a such way?

Thank you,
Daniel

Nov 21 '05 #2
You sure can. All you got to do is create a web reference and use the proxy
to call the other web service

"Bamse" wrote:
Hi all,
The problem is as follows:
I need to authorize a user: through a WS; if a setting is on, the webservice
will look in the local "database", if the setting is off it will connect to
the server ip that is set in the configuration and call the same WS to check
the user in the remote "database".

So far I don't know if I can call a webservice method from a webservice
method...

Is there a such way?

Thank you,
Daniel

Nov 21 '05 #3
I must've been not quite clear...
there's the scenario:

myWinFormApp
{
myWebservice WS1;

bool myWinFormApp.Auth(userID)
{
return ws1.auth(userid);
}
}

myWebService
{
myWebService ws2;
[Webmethod...]
public bool Auth(userid)
{
if (localServer is defined)
return local Auth(userid)
else
return ws2.Auth(userid) //in the web.config there is a custom
key: "remote server" (made at install)
// and the webservice on that "remote server" is called to authorize the
user if the local one is not defined
}
}

that's the issue: how can I call the webservice on a particular server
(refered to by IP/DNS name)

"Dilip Krishnan" <Di***********@discussions.microsoft.com> wrote in message
news:CF**********************************@microsof t.com...
You sure can. All you got to do is create a web reference and use the proxy to call the other web service

"Bamse" wrote:
Hi all,
The problem is as follows:
I need to authorize a user: through a WS; if a setting is on, the webservice will look in the local "database", if the setting is off it will connect to the server ip that is set in the configuration and call the same WS to check the user in the remote "database".

So far I don't know if I can call a webservice method from a webservice
method...

Is there a such way?

Thank you,
Daniel

Nov 21 '05 #4
yeah, after some tinkering, I got it; but instead of addind a reference to
the ws itself I made a proxy using wsdl and add it to the project ( kind of
reference though...:)) )

thanks for opening my eyes
"Dilip Krishnan" <Di***********@discussions.microsoft.com> wrote in message
news:CF**********************************@microsof t.com...
You sure can. All you got to do is create a web reference and use the proxy to call the other web service

"Bamse" wrote:
Hi all,
The problem is as follows:
I need to authorize a user: through a WS; if a setting is on, the webservice will look in the local "database", if the setting is off it will connect to the server ip that is set in the configuration and call the same WS to check the user in the remote "database".

So far I don't know if I can call a webservice method from a webservice
method...

Is there a such way?

Thank you,
Daniel

Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Dominick Baier | last post: by
reply views Thread by Jessard | last post: by
reply views Thread by plmanikandan | last post: by
5 posts views Thread by Preben Zacho | last post: by
4 posts views Thread by Boni | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.