|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
how to add "Authorization: Basic" for a web service callI'm having some problems with the authentication during a web service call I know I have to add the "Authorization: Basic xxxxxxxx" in the http header (not soap header) but I can't find a way to add it. I've tryed to use ethereal to watch what I'm sending and I can see all the header (Accept-Language,Accept-Encoding,User-Agent,Host,Connection,..) and the SOAP xml message but there is no "Authorization: Basic ......" at all. Could someone help me? This is the [partial] code I'm using: namespace WCM { public partial class Form1 : Form { public Form1(){InitializeComponent();} private void button1_Click(object sender, EventArgs e) { //WSDL web reference: WebRef //WebService: Service WebRef.ServiceTTService = new WCM.WebRef.Service(); NetworkCredential remoteCredentials = new NetworkCredential("a", "b"); TTService.Credentials = remoteCredentials; WebRef.TTRequestType TTRequest = new WCM.WebRef.TTRequestType(); TTRequest.param="param"; WebRef.TTRespType TTResponse = new WCM.WebRef.TTRespType(); TTResponse = TTService.TTRequestMethod(TTRequest); //ERROR ON THE PREVIOUS LINE: //"The request failed with HTTP status 403: Service Error." MessageBox.Show("DONE!"); } } } Thank you in advance! Ottavio You shouldn't have to do this manually. Just create an appropriate
NetworkCredential object with the plaintext credentials in it and add it to the Credentials property of your web service proxy. It should then negotiate basic authentication all by itself if the server requests it. Joe K. -- Show quoteHide quoteJoe Kaplan-MS MVP Directory Services Programming Co-author of "The .NET Developer's Guide to Directory Services Programming" http://www.directoryprogramming.net -- "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message news:1163157440.365846.108220@h54g2000cwb.googlegroups.com... > Hello, > I'm having some problems with the authentication during a web service > call > I know I have to add the "Authorization: Basic xxxxxxxx" in the http > header (not soap header) but I can't find a way to add it. > I've tryed to use ethereal to watch what I'm sending and I can see all > the header > (Accept-Language,Accept-Encoding,User-Agent,Host,Connection,..) and the > > SOAP xml message but there is no "Authorization: Basic ......" at all. > Could someone help me? > This is the [partial] code I'm using: > > namespace WCM > { > public partial class Form1 : Form > { > public Form1(){InitializeComponent();} > private void button1_Click(object sender, EventArgs e) > { > //WSDL web reference: WebRef > //WebService: Service > WebRef.ServiceTTService = new WCM.WebRef.Service(); > NetworkCredential remoteCredentials = new NetworkCredential("a", > "b"); > TTService.Credentials = remoteCredentials; > WebRef.TTRequestType TTRequest = new WCM.WebRef.TTRequestType(); > TTRequest.param="param"; > WebRef.TTRespType TTResponse = new WCM.WebRef.TTRespType(); > TTResponse = TTService.TTRequestMethod(TTRequest); > //ERROR ON THE PREVIOUS LINE: > //"The request failed with HTTP status 403: Service Error." > MessageBox.Show("DONE!"); > } > } > } > Thank you in advance! > Ottavio > I'm using the
webservice.proxy=proxycredential for our local proxy, in order to send the request. How can I add a second proxy for the remoteAuthentication? Thank you Ottavio Joe Kaplan ha scritto: Show quoteHide quote > You shouldn't have to do this manually. Just create an appropriate > NetworkCredential object with the plaintext credentials in it and add it to > the Credentials property of your web service proxy. It should then > negotiate basic authentication all by itself if the server requests it. > > Joe K. > > -- > Joe Kaplan-MS MVP Directory Services Programming > Co-author of "The .NET Developer's Guide to Directory Services Programming" > http://www.directoryprogramming.net > -- > "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message > news:1163157440.365846.108220@h54g2000cwb.googlegroups.com... > > Hello, > > I'm having some problems with the authentication during a web service > > call > > I know I have to add the "Authorization: Basic xxxxxxxx" in the http > > header (not soap header) but I can't find a way to add it. > > I've tryed to use ethereal to watch what I'm sending and I can see all > > the header > > (Accept-Language,Accept-Encoding,User-Agent,Host,Connection,..) and the > > > > SOAP xml message but there is no "Authorization: Basic ......" at all. > > Could someone help me? > > This is the [partial] code I'm using: > > > > namespace WCM > > { > > public partial class Form1 : Form > > { > > public Form1(){InitializeComponent();} > > private void button1_Click(object sender, EventArgs e) > > { > > //WSDL web reference: WebRef > > //WebService: Service > > WebRef.ServiceTTService = new WCM.WebRef.Service(); > > NetworkCredential remoteCredentials = new NetworkCredential("a", > > "b"); > > TTService.Credentials = remoteCredentials; > > WebRef.TTRequestType TTRequest = new WCM.WebRef.TTRequestType(); > > TTRequest.param="param"; > > WebRef.TTRespType TTResponse = new WCM.WebRef.TTRespType(); > > TTResponse = TTService.TTRequestMethod(TTRequest); > > //ERROR ON THE PREVIOUS LINE: > > //"The request failed with HTTP status 403: Service Error." > > MessageBox.Show("DONE!"); > > } > > } > > } > > Thank you in advance! > > Ottavio > > There are two sets of credentials you can supply. The Credentials property
allow you to supply credentials for the actual server endpoint whereas the Proxy property allows you to specify information about the proxy server to use to connect to the remote service, including credentials if the proxy server itself requires authentication. Joe K. -- Show quoteHide quoteJoe Kaplan-MS MVP Directory Services Programming Co-author of "The .NET Developer's Guide to Directory Services Programming" http://www.directoryprogramming.net -- "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message news:1163177335.923374.186830@m73g2000cwd.googlegroups.com... > I'm using the > webservice.proxy=proxycredential for our local proxy, in order to send > the request. > How can I add a second proxy for the remoteAuthentication? > Thank you > Ottavio > > > Joe Kaplan ha scritto: > >> You shouldn't have to do this manually. Just create an appropriate >> NetworkCredential object with the plaintext credentials in it and add it >> to >> the Credentials property of your web service proxy. It should then >> negotiate basic authentication all by itself if the server requests it. >> >> Joe K. >> >> -- >> Joe Kaplan-MS MVP Directory Services Programming >> Co-author of "The .NET Developer's Guide to Directory Services >> Programming" >> http://www.directoryprogramming.net >> -- >> "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message >> news:1163157440.365846.108220@h54g2000cwb.googlegroups.com... >> > Hello, >> > I'm having some problems with the authentication during a web service >> > call >> > I know I have to add the "Authorization: Basic xxxxxxxx" in the http >> > header (not soap header) but I can't find a way to add it. >> > I've tryed to use ethereal to watch what I'm sending and I can see all >> > the header >> > (Accept-Language,Accept-Encoding,User-Agent,Host,Connection,..) and the >> > >> > SOAP xml message but there is no "Authorization: Basic ......" at all. >> > Could someone help me? >> > This is the [partial] code I'm using: >> > >> > namespace WCM >> > { >> > public partial class Form1 : Form >> > { >> > public Form1(){InitializeComponent();} >> > private void button1_Click(object sender, EventArgs e) >> > { >> > //WSDL web reference: WebRef >> > //WebService: Service >> > WebRef.ServiceTTService = new WCM.WebRef.Service(); >> > NetworkCredential remoteCredentials = new NetworkCredential("a", >> > "b"); >> > TTService.Credentials = remoteCredentials; >> > WebRef.TTRequestType TTRequest = new WCM.WebRef.TTRequestType(); >> > TTRequest.param="param"; >> > WebRef.TTRespType TTResponse = new WCM.WebRef.TTRespType(); >> > TTResponse = TTService.TTRequestMethod(TTRequest); >> > //ERROR ON THE PREVIOUS LINE: >> > //"The request failed with HTTP status 403: Service Error." >> > MessageBox.Show("DONE!"); >> > } >> > } >> > } >> > Thank you in advance! >> > Ottavio >> > > Isn't this what I'm doing?
//WebService: Service WebRef.ServiceTTService = new WCM.WebRef.Service(); NetworkCredential remoteCredentials = new NetworkCredential("a","b"); TTService.Credentials = remoteCredentials; I omitted the part concerning the local proxy because I can access other web-service, so the problem doesn't seem to be on our local proxy: //PROXY System.Net.NetworkCredential myproxycredential = new System.Net.NetworkCredential("fake_user", "fake_pwd", "fake_domain"); System.Net.WebProxy myproxy = new System.Net.WebProxy("myproxy",8080); myproxy.Credentials = myproxycredential; TTService.Proxy = anovoproxy; Thank you Ottavio Joe Kaplan ha scritto: Show quoteHide quote > There are two sets of credentials you can supply. The Credentials property > allow you to supply credentials for the actual server endpoint whereas the > Proxy property allows you to specify information about the proxy server to > use to connect to the remote service, including credentials if the proxy > server itself requires authentication. > > Joe K. > > -- > Joe Kaplan-MS MVP Directory Services Programming > Co-author of "The .NET Developer's Guide to Directory Services Programming" > http://www.directoryprogramming.net > -- > "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message > news:1163177335.923374.186830@m73g2000cwd.googlegroups.com... > > I'm using the > > webservice.proxy=proxycredential for our local proxy, in order to send > > the request. > > How can I add a second proxy for the remoteAuthentication? > > Thank you > > Ottavio > > > > > > Joe Kaplan ha scritto: > > > >> You shouldn't have to do this manually. Just create an appropriate > >> NetworkCredential object with the plaintext credentials in it and add it > >> to > >> the Credentials property of your web service proxy. It should then > >> negotiate basic authentication all by itself if the server requests it. > >> > >> Joe K. > >> > >> -- > >> Joe Kaplan-MS MVP Directory Services Programming > >> Co-author of "The .NET Developer's Guide to Directory Services > >> Programming" > >> http://www.directoryprogramming.net > >> -- > >> "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message > >> news:1163157440.365846.108220@h54g2000cwb.googlegroups.com... > >> > Hello, > >> > I'm having some problems with the authentication during a web service > >> > call > >> > I know I have to add the "Authorization: Basic xxxxxxxx" in the http > >> > header (not soap header) but I can't find a way to add it. > >> > I've tryed to use ethereal to watch what I'm sending and I can see all > >> > the header > >> > (Accept-Language,Accept-Encoding,User-Agent,Host,Connection,..) and the > >> > > >> > SOAP xml message but there is no "Authorization: Basic ......" at all. > >> > Could someone help me? > >> > This is the [partial] code I'm using: > >> > > >> > namespace WCM > >> > { > >> > public partial class Form1 : Form > >> > { > >> > public Form1(){InitializeComponent();} > >> > private void button1_Click(object sender, EventArgs e) > >> > { > >> > //WSDL web reference: WebRef > >> > //WebService: Service > >> > WebRef.ServiceTTService = new WCM.WebRef.Service(); > >> > NetworkCredential remoteCredentials = new NetworkCredential("a", > >> > "b"); > >> > TTService.Credentials = remoteCredentials; > >> > WebRef.TTRequestType TTRequest = new WCM.WebRef.TTRequestType(); > >> > TTRequest.param="param"; > >> > WebRef.TTRespType TTResponse = new WCM.WebRef.TTRespType(); > >> > TTResponse = TTService.TTRequestMethod(TTRequest); > >> > //ERROR ON THE PREVIOUS LINE: > >> > //"The request failed with HTTP status 403: Service Error." > >> > MessageBox.Show("DONE!"); > >> > } > >> > } > >> > } > >> > Thank you in advance! > >> > Ottavio > >> > > > That should definitely work for basic auth for the remote server. I have no
idea about the proxy server auth as I've never worked with a proxy server that requires it, but I think that should work too. Are you getting a 401 error or something else? Joe K. -- Show quoteHide quoteJoe Kaplan-MS MVP Directory Services Programming Co-author of "The .NET Developer's Guide to Directory Services Programming" http://www.directoryprogramming.net -- "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message news:1163332998.968969.21370@i42g2000cwa.googlegroups.com... > Isn't this what I'm doing? > //WebService: Service > WebRef.ServiceTTService = new WCM.WebRef.Service(); > NetworkCredential remoteCredentials = new NetworkCredential("a","b"); > TTService.Credentials = remoteCredentials; > > I omitted the part concerning the local proxy because I can access > other web-service, so the problem doesn't seem to be on our local > proxy: > //PROXY > System.Net.NetworkCredential myproxycredential = new > System.Net.NetworkCredential("fake_user", "fake_pwd", "fake_domain"); > System.Net.WebProxy myproxy = new System.Net.WebProxy("myproxy",8080); > myproxy.Credentials = myproxycredential; > TTService.Proxy = anovoproxy; > > Thank you > Ottavio > > > Joe Kaplan ha scritto: > >> There are two sets of credentials you can supply. The Credentials >> property >> allow you to supply credentials for the actual server endpoint whereas >> the >> Proxy property allows you to specify information about the proxy server >> to >> use to connect to the remote service, including credentials if the proxy >> server itself requires authentication. >> >> Joe K. >> >> -- >> Joe Kaplan-MS MVP Directory Services Programming >> Co-author of "The .NET Developer's Guide to Directory Services >> Programming" >> http://www.directoryprogramming.net >> -- >> "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message >> news:1163177335.923374.186830@m73g2000cwd.googlegroups.com... >> > I'm using the >> > webservice.proxy=proxycredential for our local proxy, in order to send >> > the request. >> > How can I add a second proxy for the remoteAuthentication? >> > Thank you >> > Ottavio >> > >> > >> > Joe Kaplan ha scritto: >> > >> >> You shouldn't have to do this manually. Just create an appropriate >> >> NetworkCredential object with the plaintext credentials in it and add >> >> it >> >> to >> >> the Credentials property of your web service proxy. It should then >> >> negotiate basic authentication all by itself if the server requests >> >> it. >> >> >> >> Joe K. >> >> >> >> -- >> >> Joe Kaplan-MS MVP Directory Services Programming >> >> Co-author of "The .NET Developer's Guide to Directory Services >> >> Programming" >> >> http://www.directoryprogramming.net >> >> -- >> >> "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message >> >> news:1163157440.365846.108220@h54g2000cwb.googlegroups.com... >> >> > Hello, >> >> > I'm having some problems with the authentication during a web >> >> > service >> >> > call >> >> > I know I have to add the "Authorization: Basic xxxxxxxx" in the http >> >> > header (not soap header) but I can't find a way to add it. >> >> > I've tryed to use ethereal to watch what I'm sending and I can see >> >> > all >> >> > the header >> >> > (Accept-Language,Accept-Encoding,User-Agent,Host,Connection,..) and >> >> > the >> >> > >> >> > SOAP xml message but there is no "Authorization: Basic ......" at >> >> > all. >> >> > Could someone help me? >> >> > This is the [partial] code I'm using: >> >> > >> >> > namespace WCM >> >> > { >> >> > public partial class Form1 : Form >> >> > { >> >> > public Form1(){InitializeComponent();} >> >> > private void button1_Click(object sender, EventArgs e) >> >> > { >> >> > //WSDL web reference: WebRef >> >> > //WebService: Service >> >> > WebRef.ServiceTTService = new WCM.WebRef.Service(); >> >> > NetworkCredential remoteCredentials = new NetworkCredential("a", >> >> > "b"); >> >> > TTService.Credentials = remoteCredentials; >> >> > WebRef.TTRequestType TTRequest = new WCM.WebRef.TTRequestType(); >> >> > TTRequest.param="param"; >> >> > WebRef.TTRespType TTResponse = new WCM.WebRef.TTRespType(); >> >> > TTResponse = TTService.TTRequestMethod(TTRequest); >> >> > //ERROR ON THE PREVIOUS LINE: >> >> > //"The request failed with HTTP status 403: Service Error." >> >> > MessageBox.Show("DONE!"); >> >> > } >> >> > } >> >> > } >> >> > Thank you in advance! >> >> > Ottavio >> >> > >> > > I'm getting a 403: //"The request failed with HTTP status 403: Service
Error." Ottavio Joe Kaplan ha scritto: Show quoteHide quote > That should definitely work for basic auth for the remote server. I have no > idea about the proxy server auth as I've never worked with a proxy server > that requires it, but I think that should work too. > > Are you getting a 401 error or something else? > > Joe K. > > -- > Joe Kaplan-MS MVP Directory Services Programming > Co-author of "The .NET Developer's Guide to Directory Services Programming" > http://www.directoryprogramming.net > -- > "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message > news:1163332998.968969.21370@i42g2000cwa.googlegroups.com... > > Isn't this what I'm doing? > > //WebService: Service > > WebRef.ServiceTTService = new WCM.WebRef.Service(); > > NetworkCredential remoteCredentials = new NetworkCredential("a","b"); > > TTService.Credentials = remoteCredentials; > > > > I omitted the part concerning the local proxy because I can access > > other web-service, so the problem doesn't seem to be on our local > > proxy: > > //PROXY > > System.Net.NetworkCredential myproxycredential = new > > System.Net.NetworkCredential("fake_user", "fake_pwd", "fake_domain"); > > System.Net.WebProxy myproxy = new System.Net.WebProxy("myproxy",8080); > > myproxy.Credentials = myproxycredential; > > TTService.Proxy = anovoproxy; > > > > Thank you > > Ottavio > > > > > > Joe Kaplan ha scritto: > > > >> There are two sets of credentials you can supply. The Credentials > >> property > >> allow you to supply credentials for the actual server endpoint whereas > >> the > >> Proxy property allows you to specify information about the proxy server > >> to > >> use to connect to the remote service, including credentials if the proxy > >> server itself requires authentication. > >> > >> Joe K. > >> > >> -- > >> Joe Kaplan-MS MVP Directory Services Programming > >> Co-author of "The .NET Developer's Guide to Directory Services > >> Programming" > >> http://www.directoryprogramming.net > >> -- > >> "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message > >> news:1163177335.923374.186830@m73g2000cwd.googlegroups.com... > >> > I'm using the > >> > webservice.proxy=proxycredential for our local proxy, in order to send > >> > the request. > >> > How can I add a second proxy for the remoteAuthentication? > >> > Thank you > >> > Ottavio > >> > > >> > > >> > Joe Kaplan ha scritto: > >> > > >> >> You shouldn't have to do this manually. Just create an appropriate > >> >> NetworkCredential object with the plaintext credentials in it and add > >> >> it > >> >> to > >> >> the Credentials property of your web service proxy. It should then > >> >> negotiate basic authentication all by itself if the server requests > >> >> it. > >> >> > >> >> Joe K. > >> >> > >> >> -- > >> >> Joe Kaplan-MS MVP Directory Services Programming > >> >> Co-author of "The .NET Developer's Guide to Directory Services > >> >> Programming" > >> >> http://www.directoryprogramming.net > >> >> -- > >> >> "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message > >> >> news:1163157440.365846.108220@h54g2000cwb.googlegroups.com... > >> >> > Hello, > >> >> > I'm having some problems with the authentication during a web > >> >> > service > >> >> > call > >> >> > I know I have to add the "Authorization: Basic xxxxxxxx" in the http > >> >> > header (not soap header) but I can't find a way to add it. > >> >> > I've tryed to use ethereal to watch what I'm sending and I can see > >> >> > all > >> >> > the header > >> >> > (Accept-Language,Accept-Encoding,User-Agent,Host,Connection,..) and > >> >> > the > >> >> > > >> >> > SOAP xml message but there is no "Authorization: Basic ......" at > >> >> > all. > >> >> > Could someone help me? > >> >> > This is the [partial] code I'm using: > >> >> > > >> >> > namespace WCM > >> >> > { > >> >> > public partial class Form1 : Form > >> >> > { > >> >> > public Form1(){InitializeComponent();} > >> >> > private void button1_Click(object sender, EventArgs e) > >> >> > { > >> >> > //WSDL web reference: WebRef > >> >> > //WebService: Service > >> >> > WebRef.ServiceTTService = new WCM.WebRef.Service(); > >> >> > NetworkCredential remoteCredentials = new NetworkCredential("a", > >> >> > "b"); > >> >> > TTService.Credentials = remoteCredentials; > >> >> > WebRef.TTRequestType TTRequest = new WCM.WebRef.TTRequestType(); > >> >> > TTRequest.param="param"; > >> >> > WebRef.TTRespType TTResponse = new WCM.WebRef.TTRespType(); > >> >> > TTResponse = TTService.TTRequestMethod(TTRequest); > >> >> > //ERROR ON THE PREVIOUS LINE: > >> >> > //"The request failed with HTTP status 403: Service Error." > >> >> > MessageBox.Show("DONE!"); > >> >> > } > >> >> > } > >> >> > } > >> >> > Thank you in advance! > >> >> > Ottavio > >> >> > > >> > > > can you browse to the service with the browser - supplying the same credentials
in the basic auth dialog box?? --- Dominick Baier, DevelopMentor http://www.leastprivilege.com Show quoteHide quote > I'm getting a 403: //"The request failed with HTTP status 403: Service > Error." > Ottavio > Joe Kaplan ha scritto: > >> That should definitely work for basic auth for the remote server. I >> have no idea about the proxy server auth as I've never worked with a >> proxy server that requires it, but I think that should work too. >> >> Are you getting a 401 error or something else? >> >> Joe K. >> >> -- >> Joe Kaplan-MS MVP Directory Services Programming >> Co-author of "The .NET Developer's Guide to Directory Services >> Programming" >> http://www.directoryprogramming.net >> -- >> "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message >> news:1163332998.968969.21370@i42g2000cwa.googlegroups.com... >>> Isn't this what I'm doing? >>> //WebService: Service >>> WebRef.ServiceTTService = new WCM.WebRef.Service(); >>> NetworkCredential remoteCredentials = new >>> NetworkCredential("a","b"); >>> TTService.Credentials = remoteCredentials; >>> I omitted the part concerning the local proxy because I can access >>> other web-service, so the problem doesn't seem to be on our local >>> proxy: >>> //PROXY >>> System.Net.NetworkCredential myproxycredential = new >>> System.Net.NetworkCredential("fake_user", "fake_pwd", >>> "fake_domain"); >>> System.Net.WebProxy myproxy = new >>> System.Net.WebProxy("myproxy",8080); >>> myproxy.Credentials = myproxycredential; >>> TTService.Proxy = anovoproxy; >>> Thank you >>> Ottavio >>> Joe Kaplan ha scritto: >>> >>>> There are two sets of credentials you can supply. The Credentials >>>> property >>>> allow you to supply credentials for the actual server endpoint >>>> whereas >>>> the >>>> Proxy property allows you to specify information about the proxy >>>> server >>>> to >>>> use to connect to the remote service, including credentials if the >>>> proxy >>>> server itself requires authentication. >>>> Joe K. >>>> >>>> -- >>>> Joe Kaplan-MS MVP Directory Services Programming >>>> Co-author of "The .NET Developer's Guide to Directory Services >>>> Programming" >>>> http://www.directoryprogramming.net >>>> -- >>>> "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message >>>> news:1163177335.923374.186830@m73g2000cwd.googlegroups.com... >>>>> I'm using the >>>>> webservice.proxy=proxycredential for our local proxy, in order to >>>>> send >>>>> the request. >>>>> How can I add a second proxy for the remoteAuthentication? >>>>> Thank you >>>>> Ottavio >>>>> Joe Kaplan ha scritto: >>>>> >>>>>> You shouldn't have to do this manually. Just create an >>>>>> appropriate >>>>>> NetworkCredential object with the plaintext credentials in it and >>>>>> add >>>>>> it >>>>>> to >>>>>> the Credentials property of your web service proxy. It should >>>>>> then >>>>>> negotiate basic authentication all by itself if the server >>>>>> requests >>>>>> it. >>>>>> Joe K. >>>>>> >>>>>> -- >>>>>> Joe Kaplan-MS MVP Directory Services Programming >>>>>> Co-author of "The .NET Developer's Guide to Directory Services >>>>>> Programming" >>>>>> http://www.directoryprogramming.net >>>>>> -- >>>>>> "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message >>>>>> news:1163157440.365846.108220@h54g2000cwb.googlegroups.com... >>>>>>> Hello, >>>>>>> I'm having some problems with the authentication during a web >>>>>>> service >>>>>>> call >>>>>>> I know I have to add the "Authorization: Basic xxxxxxxx" in the >>>>>>> http >>>>>>> header (not soap header) but I can't find a way to add it. >>>>>>> I've tryed to use ethereal to watch what I'm sending and I can >>>>>>> see >>>>>>> all >>>>>>> the header >>>>>>> (Accept-Language,Accept-Encoding,User-Agent,Host,Connection,..) >>>>>>> and >>>>>>> the >>>>>>> SOAP xml message but there is no "Authorization: Basic ......" >>>>>>> at >>>>>>> all. >>>>>>> Could someone help me? >>>>>>> This is the [partial] code I'm using: >>>>>>> namespace WCM >>>>>>> { >>>>>>> public partial class Form1 : Form >>>>>>> { >>>>>>> public Form1(){InitializeComponent();} >>>>>>> private void button1_Click(object sender, EventArgs e) >>>>>>> { >>>>>>> //WSDL web reference: WebRef >>>>>>> //WebService: Service >>>>>>> WebRef.ServiceTTService = new WCM.WebRef.Service(); >>>>>>> NetworkCredential remoteCredentials = new NetworkCredential("a", >>>>>>> "b"); >>>>>>> TTService.Credentials = remoteCredentials; >>>>>>> WebRef.TTRequestType TTRequest = new WCM.WebRef.TTRequestType(); >>>>>>> TTRequest.param="param"; >>>>>>> WebRef.TTRespType TTResponse = new WCM.WebRef.TTRespType(); >>>>>>> TTResponse = TTService.TTRequestMethod(TTRequest); >>>>>>> //ERROR ON THE PREVIOUS LINE: >>>>>>> //"The request failed with HTTP status 403: Service Error." >>>>>>> MessageBox.Show("DONE!"); >>>>>>> } >>>>>>> } >>>>>>> } >>>>>>> Thank you in advance! >>>>>>> Ottavio I'm tryng to call the address provided
(http://testb2bportal.fujitsu-siemens.com/invoke/FSC/receive). I'm asked to insert the username/password. If I try with random username I get to "ACCESS DENIED" If I insert the provided username/password I receive just this: ---------------------------- <IDOC></IDOC> ---------------------------- Is this a standard reply? Thank you. Ottavio Dominick Baier ha scritto: Show quoteHide quote > can you browse to the service with the browser - supplying the same credentials > in the basic auth dialog box?? > > --- > Dominick Baier, DevelopMentor > http://www.leastprivilege.com > > > I'm getting a 403: //"The request failed with HTTP status 403: Service > > Error." > > Ottavio > > Joe Kaplan ha scritto: > > > >> That should definitely work for basic auth for the remote server. I > >> have no idea about the proxy server auth as I've never worked with a > >> proxy server that requires it, but I think that should work too. > >> > >> Are you getting a 401 error or something else? > >> > >> Joe K. > >> > >> -- > >> Joe Kaplan-MS MVP Directory Services Programming > >> Co-author of "The .NET Developer's Guide to Directory Services > >> Programming" > >> http://www.directoryprogramming.net > >> -- > >> "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message > >> news:1163332998.968969.21370@i42g2000cwa.googlegroups.com... > >>> Isn't this what I'm doing? > >>> //WebService: Service > >>> WebRef.ServiceTTService = new WCM.WebRef.Service(); > >>> NetworkCredential remoteCredentials = new > >>> NetworkCredential("a","b"); > >>> TTService.Credentials = remoteCredentials; > >>> I omitted the part concerning the local proxy because I can access > >>> other web-service, so the problem doesn't seem to be on our local > >>> proxy: > >>> //PROXY > >>> System.Net.NetworkCredential myproxycredential = new > >>> System.Net.NetworkCredential("fake_user", "fake_pwd", > >>> "fake_domain"); > >>> System.Net.WebProxy myproxy = new > >>> System.Net.WebProxy("myproxy",8080); > >>> myproxy.Credentials = myproxycredential; > >>> TTService.Proxy = anovoproxy; > >>> Thank you > >>> Ottavio > >>> Joe Kaplan ha scritto: > >>> > >>>> There are two sets of credentials you can supply. The Credentials > >>>> property > >>>> allow you to supply credentials for the actual server endpoint > >>>> whereas > >>>> the > >>>> Proxy property allows you to specify information about the proxy > >>>> server > >>>> to > >>>> use to connect to the remote service, including credentials if the > >>>> proxy > >>>> server itself requires authentication. > >>>> Joe K. > >>>> > >>>> -- > >>>> Joe Kaplan-MS MVP Directory Services Programming > >>>> Co-author of "The .NET Developer's Guide to Directory Services > >>>> Programming" > >>>> http://www.directoryprogramming.net > >>>> -- > >>>> "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message > >>>> news:1163177335.923374.186830@m73g2000cwd.googlegroups.com... > >>>>> I'm using the > >>>>> webservice.proxy=proxycredential for our local proxy, in order to > >>>>> send > >>>>> the request. > >>>>> How can I add a second proxy for the remoteAuthentication? > >>>>> Thank you > >>>>> Ottavio > >>>>> Joe Kaplan ha scritto: > >>>>> > >>>>>> You shouldn't have to do this manually. Just create an > >>>>>> appropriate > >>>>>> NetworkCredential object with the plaintext credentials in it and > >>>>>> add > >>>>>> it > >>>>>> to > >>>>>> the Credentials property of your web service proxy. It should > >>>>>> then > >>>>>> negotiate basic authentication all by itself if the server > >>>>>> requests > >>>>>> it. > >>>>>> Joe K. > >>>>>> > >>>>>> -- > >>>>>> Joe Kaplan-MS MVP Directory Services Programming > >>>>>> Co-author of "The .NET Developer's Guide to Directory Services > >>>>>> Programming" > >>>>>> http://www.directoryprogramming.net > >>>>>> -- > >>>>>> "Ottavio" <OttavioAtUsenetGro***@gmail.com> wrote in message > >>>>>> news:1163157440.365846.108220@h54g2000cwb.googlegroups.com... > >>>>>>> Hello, > >>>>>>> I'm having some problems with the authentication during a web > >>>>>>> service > >>>>>>> call > >>>>>>> I know I have to add the "Authorization: Basic xxxxxxxx" in the > >>>>>>> http > >>>>>>> header (not soap header) but I can't find a way to add it. > >>>>>>> I've tryed to use ethereal to watch what I'm sending and I can > >>>>>>> see > >>>>>>> all > >>>>>>> the header > >>>>>>> (Accept-Language,Accept-Encoding,User-Agent,Host,Connection,..) > >>>>>>> and > >>>>>>> the > >>>>>>> SOAP xml message but there is no "Authorization: Basic ......" > >>>>>>> at > >>>>>>> all. > >>>>>>> Could someone help me? > >>>>>>> This is the [partial] code I'm using: > >>>>>>> namespace WCM > >>>>>>> { > >>>>>>> public partial class Form1 : Form > >>>>>>> { > >>>>>>> public Form1(){InitializeComponent();} > >>>>>>> private void button1_Click(object sender, EventArgs e) > >>>>>>> { > >>>>>>> //WSDL web reference: WebRef > >>>>>>> //WebService: Service > >>>>>>> WebRef.ServiceTTService = new WCM.WebRef.Service(); > >>>>>>> NetworkCredential remoteCredentials = new NetworkCredential("a", > >>>>>>> "b"); > >>>>>>> TTService.Credentials = remoteCredentials; > >>>>>>> WebRef.TTRequestType TTRequest = new WCM.WebRef.TTRequestType(); > >>>>>>> TTRequest.param="param"; > >>>>>>> WebRef.TTRespType TTResponse = new WCM.WebRef.TTRespType(); > >>>>>>> TTResponse = TTService.TTRequestMethod(TTRequest); > >>>>>>> //ERROR ON THE PREVIOUS LINE: > >>>>>>> //"The request failed with HTTP status 403: Service Error." > >>>>>>> MessageBox.Show("DONE!"); > >>>>>>> } > >>>>>>> } > >>>>>>> } > >>>>>>> Thank you in advance! > >>>>>>> Ottavio
Winform: Call a vbscript with elevated privileges
FullTrust on network drive Why am I getting errors when I want to rebuild the TreeView contro Login error when opening a deployed project User creation.... Forms Authentication with Active Directory, login control crashes Security Exception Is there a function that I can call to validate a domain? IE C# ActiveX without permissons LocalSystem network access problem |
|||||||||||||||||||||||