404 error Sharepoint 2010 accessing Lists.asmx - web-services

When attempting to checkout a document I receive the following message
"This document could not be checked out. You may not have permission..." etc etc
So I used Fiddler and discovered that the REAL error was a 404 when Sharepoint attempts to access the Lists.asmx url. I am assuming it uses the webservice to perform checkout.
The Sharepoint is set up under IIS for https or SSL. Another test farm I put together without SSL does not have issues getting to it's web service.
Another curiousity is that there was no issue checking a document out when the SHAREPOINT OPENDOCUMENTS CLASS add on in the browser is turned off.
Any Ideas?

I was stumped on a 404 error as well while communicating with Sharepoint, but it was when I was calling GetListCollection(). It turned out to be because the default behavior for GetListCollection() is to return all of the lists from the rootweb. To filter it more specifically change the .Url property to point to a list.asmx lower down the site (regardless of where you set your initial reference).
For example:
ListsWS.Lists lws = new ListsWS.Lists();
lws.Url = "http://server/sites/someSubSite/_vti_bin/lists.asmx";

Related

Problem handling cookies for Blazor Server using OpenID server (Keycloak)

I have a baffling issue with cookie handling in a Blazor server app (.NET Core 6) using openid (Keycloak). Actually, more than a couple which are may or may not linked. It’s a typical (?) reverse proxy architecture:
A central nginx receives queries for services like Jenkins, JypyterHub, SonarQube, Discourse etc. These are mapped through aliases in internal IPs where the nginx can access them. This nginx intercepts URL like: https://hub.domain.eu
A reverse proxy which resolves to https://dsc.domain.eu. This forwards request to a Blazor app running in Kestrel in port 5001. Both Kestrel and nginx under SSL – required to get the websockets working.
Some required background: the Blazor app is essentially a ‘hub’ where its various razor pages ‘host’ in iframe-like the above mentioned services. How it works: When the user asks for the root path (https://hub.domain.eu) it opens the root page of the Blazor app (/).
The nav menu contains the links to razor pages which contain the iframes for the abovementioned services. For example:
The relative path is intercepted by the ‘central’ nginx which loads Jenkins. Everything is under the same Keycloak OpenID server. Note that everything works fine without the Blazor app.
Scenarios that cause the same problem
Assume the user logins in my app using the login page of Keycloak (NOT the REST API) through redirection. Then proceeds to link and he is indeed logged in as well. The controls in the App change accordingly to indicate that the user is indeed authenticated. If you close the tab and open a new one, the Blazor app will act as if it’s not logged in while the other services (e.g Jenkins) will show the logged in user from before. When you press the Login link, you’ll be greeted with a 502 nginx error. If you clean the cookies from browser (or in private / stealth mode) everything works again. Or of you just log off e.g. from Jenkins.
Assume that the user is now in a service such as Jenkins, SonarQube, etc. if you press F5 now you have two problems: you get a 404 Error but only on SOME services such as Sonarcube but not in others. This is a side problem for another post. The thing is that Blazor app appears not logged in again by pressing Back / Refresh
The critical part of Program.cs looks like the following:
This class handles the login / logoff:
Side notes:
SaveTokens = false still causes large header errors and results in empty token (shown in the above code with the Warning: Token received was null). I’m still able to obtain user details though from httpContext.
No errors show up in the reverse proxy error.log and in Kestrel (all deployed in Linux)
MOST important: if I copy-paste the failed login link (the one that produced the 502 error) to a "clean" browser, it works fine.
There are lots of properties affecting the OpenID connect, it could also be an nginx issue but I’ve run out of ideas the last five days. The nginx config has been accommodated for large headers and websockets.
Any clues as to where I should at least focus my research to track the error??
The 502 error shows an error at NGINX's side. The reverse proxy had proper configuration but as it turned out, not the front one. Once we set the header size to suggested size, everything played out.

Login error to Sharepoint 2013 repository using openCMIS Workbench

using the OpenCMIS Workbench 0.8.0, I can load the sharepoint 2013 (GA) repositories fine but get the following error when I try to login to one of the repositories such as Documents:
"Invalid Argument: One or more of the input parameters to the service method is missing or invalid"
Found a blog with some instructions but those didn't work for me:
http://dhartford.blogspot.com/2013/01/sharepoint-2013-w-apache-chemistry-cmis.html?showComment=1359398536275#c6910049622927723676
Note: Here is the service url format that I am using:
http://myserver.xxx.com/MYSITE/cmis/_vti_bin/cmis/rest?getRepositories
Does anybody know what the problem is?
Here is the stack trace from Workbench:
> 11:05:17 DEBUG ncmis.client.bindings.spi.http.HttpUtils: GET http://MYServer/_vti_bin/cmis/rest/f8134afe-176a-4c48-9fd2-a9f97e5dc91d?getTypeDefinition&typeId=cmis%3Adocument
> 11:05:17 TRACE ncmis.client.bindings.spi.http.HttpUtils: GET http://MYServer/_vti_bin/cmis/rest/f8134afe-176a-4c48-9fd2-a9f97e5dc91d?getTypeDefinition&typeId=cmis%3Adocument > Headers: {null=[HTTP/1.1 400 One or more of the input parameters to the service method is missing or invalid.], Server=[Microsoft-IIS/7.5], SPRequestDuration=[124], SPIisLatency=[27], X-FRAME-OPTIONS=[SAMEORIGIN], Content-Type=[plain/text; charset=utf-8], Date=[Wed, 30 Jan 2013 19:05:02 GMT], X-SharePointHealthScore=[1], Cache-Control=[private], X-Content-Type-Options=[nosniff], X-Powered-By=[ASP.NET], X-MS-InvokeApp=[1; RequireReadOnly], request-id=[5ef0f99b-24ec-909f-6192-6eaf6feccabc], Content-Length=[167], MicrosoftSharePointTeamServices=[15.0.0.4420], SPRequestGuid=[5ef0f99b-24ec-909f-6192-6eaf6feccabc], X-AspNet-Version=[4.0.30319]}
> 11:05:17 ERROR hemistry.opencmis.workbench.ClientHelper: CmisInvalidArgumentException: One or more of the input parameters to the service method is missing or invalid.
org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: One or more of the input parameters to the service method is missing or invalid.
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:423)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:554)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getTypeDefinitionInternal(AbstractAtomPubService.java:821)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.RepositoryServiceImpl.getTypeDefinition(RepositoryServiceImpl.java:88)
at org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getTypeDefinition(RepositoryServiceImpl.java:137)
at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getTypeDefinition(SessionImpl.java:518)
at org.apache.chemistry.opencmis.workbench.model.ClientSession.createOperationContexts(ClientSession.java:244)
at org.apache.chemistry.opencmis.workbench.model.ClientSession.createSession(ClientSession.java:195)
at org.apache.chemistry.opencmis.workbench.LoginDialog$2.actionPerformed(LoginDialog.java:204)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2006)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2329)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:398)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:253)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:247)
> 11:05:17 ERROR hemistry.opencmis.workbench.ClientHelper: Error code: 0
Another thing that I noticed is that none of the URLs from the service document work when I use them from a browser. So i think the service doc doesn't have valid urls.
Give the latest CMIS Workbench a try:
https://repository.apache.org/content/repositories/orgapachechemistry-166/org/apache/chemistry/opencmis/chemistry-opencmis-workbench/0.9.0-beta-1/chemistry-opencmis-workbench-0.9.0-beta-1-full.zip
Didn't have the time to post the solution but here is basically what I had to do after getting help from Microsoft. I was missing Step B below:
A. Activate the CMIS feature for your sub site
Go to the Sharepoint 2013 Central Administration
Click on the Sites link and then click on your sub site. Or navigate directly to it. eg http://myserver/mysitename
Click on the Settings icon (gear top right) and then select Site Settings
Under Site Actions, click Manage Site Features
Click Activate for the CMIS producer.
B. Check Alternate Access Mappings
Go to the Central Administration page
Under System Settings, click Configure Alternate Access Mappings
There should be at least two urls. One with server short name and one with server full name.
If the url is missing, click Add Internal Urls
For the Alternate Access Mapping Collection, click the No Selection link, change and select:
SharePoint - 80
Set the url such as http://myserver.usa.com (full domain name)
Set Zone: any such as Intranet
Click Save
My suggestion would be to:
start the Workbench, do not login yet
close the connection popup
open the Log window with the button on the top right corner
increase the log level to DEBUG or more verbose
try to connect
check the logs again, possibly posting them here
The actual root of the problem turned out to be a missing Alternate Access Mapping. Not sure why it was missing in the first place.
So I added an internal url that has the full server name address instead of just the short name. A microsoft dev helped me figure this out.
Remove any proxy settings from internet explorer before you launch OpenCMIS, also reset any system wide proxy settings: netsh winhttp reset proxy
Make sure your share point web app is set to accept only basic authentication as described in the blog post you mentioned
Removing the proxy from IE and system wide fixed my problem .. I can now login to sharepoint 2013 using OpenCMIS
ah before i forget the URL syntax should be http://server:port/_vti_bin/cmis/rest/?getRepositories
Good luck

recieving error The file you are attempting to save or retrieve has been blocked from this Web site by the server administrators.<nativehr>0x800401e6

After building and deploying, checked the solution management from Central administration and it's up, a simple web service method that only created a Document Library list with a few columns when trying to retrieve the wsdl or even just by calling the WS fromt the adress since its a void method I recieve some error:
The file you are attempting to save or retrieve has been blocked from this Web site by the server administrators.<nativehr>0x800401e6</nativehr><nativestack></nativestack>
The very same method runs fine when called from another web service project that is already deployed so there's nothing wrong with the code. I'm most probably doing something wrong but can't figure.
The system is running on a win server 2008 with sharepoint 2010, framework 3.5 and "ANY" cpu mode.
thank you!
[edit]
Managed to get rid of the previous error by removing asmx extention from the blocked file list in central administration now instead I'm recieving a 404 error:
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /_layouts1/my2claims/tt_claims.asmx
it must run under the same application pool as SharePoint

Web App not Found-edit in DatasheetView

i came accross the following error, when my client tries to edit list data through datasheet view from terminal machine.
The Web application at xxx could not be found. Verify that you have typed the URL
correctly. If the URL should be serving existing content, the system administrator may
need to add a new request URL mapping to the intended application.
Note: this error is coming with only 1 list. All other lists are working fine. i m using sharepoint 2007 on 32bit
This may be related to alternate access mappings.
I had this issue, and the clue was that the datasheet was referencing a URL of the form:
_http://hostname/site/...
instead of
_http://hostname.domain/site/...
ie. the datasheet was not referencing the fully qualified domain name (FQDN).
If the error message states The Web application at _http://hostname/site/..., ie. the error doesn't use the FQDN, alternate access mapping may resolve it. The end of the error message seems to suggest alternate access mappings, although it is not entirely explicit.
I resolved this by adding an alternate access mapping as follows:
internal url: http://hostname
public url: http://hostname.domain (FQDN)
Default Zone in my case, should work for other zones.
hope this helps :)

Facebook Connect not setting cookies

I'm trying to implement Facebook Connect on a website with .NET MVC using C#.
I've followed the instructions here: http://wiki.developers.facebook.com/index.php/Trying_Out_Facebook_Connect step by step. I can make the login work as in that when I log in through the site I'm also logged into Facebook.
In order to work with this in the server I think I need to access the cookies Facebook is supposed to leave like:
APIKEY_user
APIKEY_session_key
...
as mentioned here http://wiki.developers.facebook.com/index.php/Verifying_The_Signature.
The thing is I'm not getting any of these cookies. I've googled and it seems like I'm the only person with this problem. Any ideas as to what I could be doing wrong ? Has this happened to anyone else ?
The issue was that I was developing locally using localhost.
I resolved the problem by changing the settings for the application to point to a certain web address instead of localhost and changing my hosts file lo point that same web address to 127.0.0.1
from the UI/client-side perspective, always insure you have the correct path indicated for the xd_receiver file in your FB.init() method.
Firecookie is very useful for seeing what Cookies are/aren't being set.