using Webdav .Net Engine from ITHits for direct edit MS Office File - webdav

I'm trial http://www.webdavsystem.com/ .Net WebDav Server and having problem direct editing on Word file which always open in read-only mode. (tested with Visio, Excel same problem)
I've tried several things noted in the page http://www.webdavsystem.com/server/prev/v2/documentation/ms_office_read_only
Here are the results
Yes: My WebDAV configured on server site root.
Yes: My WebDAV support Class 2. (using built-in wizard to generate project)
No: I didn't open web-hyperlinked file, I opened from M:\Folder\File.doc as Mapped Drive
Yes: I've Cleared Microsoft Office WebDAV cache in registry.
Yes: I've Excluded client side MS Office issues. By testing with
www.ajaxfilebrowser.com, works perfectly.
Two things I can't really do by suggestions on the webpage are
I've enable Log flag in Web.config file and attached here
http://www.sendspace.com/file/fp3yrz as I can't really understand
Log syntax much.
Also I don't know much enough to try with Fiddle (Examine WebDAV
requests with a Fiddler tool ) And my server configured to use
Digest Authentication over Standard HTTP, it seemed to work - drive
mapping has no a problem.
My Environment : VS2012 Ultimate ran on Win7 ultimate 6GB Ram (also act as a client pc), Server : Winserver 2012 Std, 2GBRam

I examined your log, it looks ok, I did not found any issues.
Microsoft Mini-redirector many cache authentication info. Here is what else you can try:
Unmount your WebDAV folders using net use * /DELETE command (or its variants).
Clear saved logins using following command:
rundll32.exe keymgr.dll, KRShowKeyMgr

LOCK request should reach success for an Office document to be opened for editing (not read-only). This will ensure that the document will not be edited by two or more persons at a time.
But in your log file I can see 5 LOCK request and 4 of them failed (with reductions):
[7] [LOCK] /685/test_D47H.doc
User-Agent: Microsoft-WebDAV-MiniRedir/6.1.7601
Timeout: Second-3600
[7] <?xml version="1.0" encoding="utf-8" ?><D:lockinfo xmlns:D="DAV:"><D:lockscope><D:exclusive/></D:lockscope><D:locktype><D:write/></D:locktype><D:owner><D:href>admin</D:href></D:owner></D:lockinfo>
[7] HTTP/1.1 403 Forbidden
X-Env-Version : 4.0.30319.17929 32bit
X-OS-Version : Microsoft Windows NT 6.2.9200.0
X-IIS-Version : Microsoft-IIS/8.0
X-Worker-Request : System.Web.Hosting.IIS7WorkerRequest
X-Engine : IT Hit WebDAV Server .Net v3.1.869.0 (Evaluation License)
[7] <?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:">
<d:need-privileges>
<d:responsedescription>Not enough privileges</d:responsedescription>
<d:resource>
<d:href>http://webdrive.test.com/685/test_D47H.doc</d:href>
<d:privilege>
<d:write />
</d:privilege>
</d:resource>
</d:need-privileges>
</d:error>
"Not enough privileges" - this means an UnauthorizedAccessException is thrown when trying to create an alternate stream for the file /685/test_D47H.doc. And LOCK request is the only attempt to change this file (all other requests just read its properties).
But later you are creating file /685/test_D47H%20-%20Copy.doc and all the changing requests succeed (like PUT, PROPPATCH, UNLOCK).
This means the file /685/test_D47H.doc is write protected and any new created file - is not.

Related

Web Server Accessing DFS Share

I'm using the following code in a VB6 DLL (Middleware on an ASP Classic Site) to create a drive mapping to a network share in order to copy files to and fro:
Set ws = CreateObject("WScript.Network")
ws.MapNetworkDrive strDrive, strPath, False, strUser, strPass
At the moment, this works if the share is a normal file server, e.g. \server\share\foo but if I move to a DFS namespace it no longer works, e.g. \mydomain.local\share\foo.
It works in the VB IDE (running as me but using same credentials as the service would) but once compiled and running under the web server the error returned is Error -2147023584 - A specified logon session does not exist. It may already have been terminated.
Most sites I have searched suggest the the local system policy "Network access: Do not allow storage of passwords and credentials for network authentication" be disabled, this is already the case on my machine, I even enabled it then disabled it again to make sure.
Another site suggested connecting to the root node of the DFS first, that didn't work either.
(Windows 7, IIS 7.5)

Mobicents - SimpleServlet Application Router not routing invite to

I am trying to follow the tutorial at,
http://ben-touron.blogspot.com/2009/11/developping-simple-sip-application-with.html
to create a Simple Servlet using Mobicents. I have configured my dar file and also set up the dar file in the server.xml in Apache Tomcat v6.0
Looked at http://www.java.net/node/699015?force=762 for answers & found none. I shut down the firewall as well :(
Server.xml
<Service className="org.mobicents.servlet.sip.startup.SipStandardService" congestionControlCheckingInterval="-1" darConfigurationFileLocation="file:///E:/Research/SIP/SipServlets/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/conf/dars/mobicents-dar.properties" name="Sip-Servlets" sipApplicationDispatcherClassName="org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl" sipStackPropertiesFile="conf/mss-sip-stack.properties">
Dar file
INVITE=("org.example.servlet.sip.SimpleSipServlet", "DAR\:From", "TERMINATING", "", "NO_ROUTE", "0")
My application is not getting routed when I call via X-Lite even though my SIP Servlet is initialized. :(
Thanks.
You were looking at outdated instructions. Take a look at more recent tutorials on Mobicents SIP Servlets:
http://docs.telestax.com/sip-servlets-homepage/

Classic asp "An error occurred when verifying security for the message." iis7 transport level security

On II7 we host a WCF/asp.net based API. In order to allow users of a classic asp application to connect to the API we had to publish a version we refer to as "transport". This Transport version is written in asp.net too, it points to the same assembly , its just the security layer is different to allow classic asp to authenticate. Transport level security is used as opposed to message based security.
When using a browser to load the service reference i can loading the svcutil.exe ... WDSL page.
When using my test asp page to call a web method from this reference i get the following returned:
Finished calling Web Service.
Status = Internal Server Error
ResponseText = a:InvalidSecurityAn error occurred when verifying security for the message.
This suggests that the authentication is failing. When testing using asp.net or the application WCF storm to contact the normal API everything works well.
The API was recently migrated , it would appear something has not been setup correctly but i am at a loss to explain what.
I can browse to the svcutil.exe ... WDSL service reference, when selecting it via the browser i get the expect XML response.
The USER NAME and password utilised work when using the non-classic asp publicaiton of the API using the message based secuirty.
Would it be possible to post some troubleshooting tip that may help diagnoise the issue please specifically regarding transport level security fault finding and setup ?
Thank you
Scott
EDITED TO ADD THE FOLLOWING UPDATE:
Attempted to use the Default App Pool and a new App Pool but same problem persists.
My test page error: ResponseText = a:InvalidSecurityAn error occurred when verifying security for the message.
IIS LOG shows:
v3/transport/testclassicasptransportwcfservice.asp ( 200 0 0 ) (i.e iis 200)
/V3/Transport/DeviceService.svc/DeviceService (500 0 0) (i.e iis error 500)
note: virtual dir defined on TRANSPORT and V3. V3 works ok using .net as opposed to classic asp to authenticate.
EVENT LOG:
The Template Persistent Cache initialization failed for Application Pool 'transport' because of the following error: Could not create a Disk Cache Sub-directory for the Application Pool. The data may have additional error codes.
This reference appears to suggest a fix but many of the DIR paths and references in "appcmd" dont exist.
_http://theether.net/kb/100127
REF http://theether.net/kb/100127
load cmd prompt
CD to C:\Windows\System32\inetsrv
enter: appcmd list config -section:system.webServer/asp
the following path is displayed: c:\inetpub\conf\temp\ASP compiled templates
check path exists (it does)
Check if the NETWORK SERVICE has permissions to access "ASP compiled templates" If not from appcmd execute;
icacls "c:\inetpub\conf\temp\ASP Compiled Templates" /grant "NETWORK SERVICE:(OI)(CI)(M)"
should read "sucessfully processed 1 files"
restarted app pool.
THE "InvalidSecurityAn error occurred when verifying security for the message" problem still persists but the "COULD NOT CREATE A DISK CACHE SUB-DIRECORY .... " error from the eventlog is no longer occurring.
Sorry another update. The network service permission change DID NOT resolve the issue , changeing to the DEFAULT APP POOL solved the problem.
Got a lead at last. Examined:
ServiceSecurityAudit set in service behaviour. Ref http://intrepiddeveloper.wordpress.com/2008/08/07/security-event-logging-auditing/#
IIS logs (simply shows the non-specific error 500.)
Fault tracing enabled( also shows error 500).
Custom errors were off
Friendly IE messages were off
Asp client side and server side debugging on
ProcessMon running , no errors.
Web.config httpErrors errorMode="Detailed" /> +
ServiceSecurityAudit found me an "Object reference not set to an instance of an object" so sounds like our app has a bug.
Follow up (17/08/11):
Service Security Audit documented here:
http://intrepiddeveloper.wordpress.com/2008/08/07/security-event-logging-auditing/
Was the key for us to resolve this issue. Uncovered the Object Reference Error which indicated out Business Objects and Data Access dlls were out of alignment. Using CLASSIC ASP to contact the WCF.NET API using TRANSPORT AUTHENTICATION there was abolutely no indication of this error until Service Security Audit was enavled on the behaviour.config file in the WCF deployment.

Calling https process from ASP Net

I have an ASP NET web server application that calls another process running on the same box that creates a pdf file and returns it. The second process requires a secure connection via SSL.
The second process has issued my ASP NET application with a digital certificate but I still cannot authenticate, getting a 403 error.
The code is a little hard to show but here's a simplified method ...
X509Certificate cert = X509Certificate.CreateFromCertFile("path\to\cert.cer");
string URL = "https://urltoservice?params=value";
HttpWebRequest req = HttpWebRequest.Create(URL) as HttpWebRequest;
req.ClientCertificates.Add(cert);
req.Credentials = CredentialCache.DefaultCredentials;
req.PreAuthenticate = true;
/// error happens here
WebResponse resp = req.GetResponse();
Stream input = resp.GetResponseStream();
The error text is "The remote server returned an error: (403) Forbidden."
Any pointers are welcome.
Finally fixed (wasted 6 hours on this *&%$##&)
I needed to grant access to the private keys on the digi cert to the account that the calling ASP.NET application runs under. This account is NETWORK SERVICE by default although you may want to run under a more restricted account.
Access is granted with the winhttpcertcfg tool, here's what got it working for me:
winhttpcertcfg -g -s "cert name" -c "LOCAL_MACHINE\MY" -a "NETWORK SERVICE"
where "cert name" is the CN of the digi cert.
More info at http://support.microsoft.com/kb/901183
Thanks to all who helped out with pointers on how to get this working :)
A 403 sounds like an authorization problem, not an authentication problem. It might be caused by the NTFS security settings on the files and folders accessed by your PDF service. Maybe it doesn't have permission to create the PDF file in the output folder?
Can you install the client certificate into your browser, and then access your PDF service through the browser? When you do that, do you still get a 403 or does it work?
Can you temporarily configure the PDF service to allow unencrypted HTTP connections? Does that make the problem go away?
From Windows Explorer, can you grant the "Network Service" account full control over the physical folder corresponding to the root of the PDF service site? Also grant it full control over any other directories it accesses. You should lock things down later after you've figured things out.
Or you can change the application pool to run under a different account - e.g. your own account.
Finally: if you're running IIS 7, you can turn on failed request tracing, which should give you a lot more info about why it failed.

ASP.NET website problem while requesting XML data from remote server

I am writing code in asp.net to get XML data from external webserver.
*.cs Code
connection string: URL of external(third party) server for XML data
WebRequest req = WebRequest.Create(connectionString);
req.Proxy = WebProxy.GetDefaultProxy();
req.Proxy.Credentials = CredentialCache.DefaultCredentials;
req.Timeout = 1000;
using (WebResponse resp = req.GetResponse())
{
// reading data from XML file
}
Key Point
1. GetDefaultProxy() return information about proxy
2. Default Credentials() return username password which i have written in web.config as shown below
Web.config
<identity impersonate="true"
username="Username of PC where website is running"
password="password"/>
Problem Statement:
After installing website setup : Above code working fine at WindowsXP but the same code doesn't work at Windows server 2003. I am not able to find out what extra we need to configure in Windows Server 2003.
Please help me to find out the solution?
[EDIT]
Very random beheviour is observed at server. Sometimes the data comes and appear at client(browser) when we logged into windows server 2003.
But when we loggedout from server and try to request for data from client(browser) at another PC. It appear for very short duration. After say wait of 1 hour the data doesn't comes for new request.
An error message might be useful??
But at a guess I'd say it's that the proxy isn't configured on the 2003 server.
Check the firewall on Windows Server 2003 and make sure port 80 outbound is allowed (assuming that is the port used by the web service).
This might help. It's about proxy and .NET app.

Resources