connecting external web service get error: 401:unauthorized
-
יום שלישי 13 מרץ 2012 16:03
I am using an external sharepoint default web service _vti_bin/lists.asmx;
I have signed the credential(using both defaultCredential and netowrkCredential) and certificatvalidation to the web service before calling the web service.
However, I still get an unauthorized error. Can we call external web service? if not, what can i use instead? I need to fetch items from an external spsite.
כל התגובות
-
יום שלישי 13 מרץ 2012 20:01
-
יום חמישי 15 מרץ 2012 09:28
indeed. I build a simple console app to test it. it works. somehow, my custom webservice in SharePoint server doesnt work. no idea why.
btw I use Admin account to test it.
-
יום חמישי 15 מרץ 2012 19:30Is there an issue with a custom web service or the default lists.asmx web service? You may want to have a look at this article on how to setup a WCF service on a SharePoint 2010 server: http://msdn.microsoft.com/en-us/library/ff521581.aspx
-
יום שני 19 מרץ 2012 23:05
thank you Jeffrey. indeed the lists.asmx works. some methods of my web service work as well. however, the method which return a Datatable does not works. I need to find out why.
ps: i have passed credential as well.
Any idea how shall I debug it?
-
יום רביעי 21 מרץ 2012 19:37
There are a couple methods that you can use to debug the request to the webservice. The Service Trace Viewer will help you get the most detailed information to debug the request. Take a look here: http://msdn.microsoft.com/en-us/library/aa751795(v=vs.90).aspx- סומן כתשובה על-ידי Shimin Huang יום שישי 23 מרץ 2012 06:32
- סימון כתשובה בוטל על-ידי sparking יום שלישי 27 מרץ 2012 08:22
- סומן כתשובה על-ידי sparking יום שישי 30 מרץ 2012 09:06
-
יום שלישי 27 מרץ 2012 08:22
Thank you Jeffrey. My custom web service seems no problem. However, it still ask login.
my custom service is about retrieve lists data from another spsite(Site A), show and update the data in (Site B);
I still not understand why my service.credential is not working. It keeps pop-up login dialog for (Site A)
-
יום שלישי 27 מרץ 2012 18:05
You might be looking at a generic access denied error that makes it difficult to understand what the real problem is. You'll need to futher analyse the request to be able to find a solution. You'll want to create a simple method to determine if communication works. Then you can further inspect if you have transport issues when working with large amount of data. You could also override the service configuration in the web.config to test authentication types and buffer sizes.
Have you tried setting up a simple WCF method? Like in the sample page I provided earlier?
-
יום שישי 30 מרץ 2012 09:06
Thank you Jeffrey. trace web service is a very good idea and it works now.
I found this very good example(must said it's a lot better than the msdn one) about how to create asp webservice on sharepoint server.
i would like to add serveral steps here for who is not clear how to add services to _vti_bin folder.
attach webservice with a link likes this format //server/_layouts/myproject/myservice.asmx; Visual studio can automatically discover your latest service methods.
Deploy your project.
Visual Studio will automatically generate/update .disco and .wsdl files. no need to use gacutil.exe or whatever.
map your ISAPI folder to your project. copy .asmx file(myproject/web freferences) to this ISAPI folder;
deploy project again.
now your web serivce is under folder _vti_bin (//server/_vti_bin/myporject/myservice.asmx)
- סומן כתשובה על-ידי sparking יום שישי 30 מרץ 2012 09:06