How to open a wsdl file in the browser - web-services

When I double click on the wsdl file it shows a download window to download that wsdl file, I want to open that file in the browser (I select Internet Explorer to open this kind of file and after that this problem starts),
Can I do something so that when I double click on the wsdl it opens in the browser?

Browser is not the right tool for this. Open the file with Notepad++ or VS Code or simlar. To change file associations in windows, open the file by right clicking and using openwith.

i have wsdl file but on double click it is not opening in the browser
Okay here we go:
The problem is, when you open it in Internet Explorer (IE) the IE reads the header of the file which would be something like Content-type: file because windows handles it as file instead of Content-type: text/xml. If it would come from a (proper installed) webservice (even if it's localhost) you would get the right Content-type and it would open in browser as XML. Have a look at this SQ question (How to open wsdl in browser). That's a "problem" of the IE.
So I think you can't open it in IE on the way you want to easily. You can try to change your security settings (Tools -> Internet options -> Security) and disable "Downloading" - maybe then it will be opened in IE directly. Can't test that on my PC due restrictions but I'm not even sure this will work. And even if yes you'll block all other downloads too!
Alternatives to have a look at your WSDL:
Open the file with an texteditor, like notepad
Open the file with another browser, at least Firefox and Chrome show it as XML (didn't try any other browsers)

Related

How to programmatically change browser URL

In my C++ Windows application I use ShellExecute to open a remote PDF file in the internet browser at a certain PDF Destination (dynamic bookmarks provided by Adobe Acrobat Reader):
ShellExecute(NULL, "open", "https://www.myweb.cloud/guide.pdf#dest_1", NULL , NULL, SW_SHOWNORMAL);
Then if I want to move to another Destination, another call to ShellExecute (with #dest_2 in the URL) simply open another page in the browser and download the PDF again opening it at that Destination.
Is there a way to programmatically change the URL (from #dest_1 to #dest_2) without making the browser to open a new page e re-dowload the PDF?
I also use LibCurl in my application in order to retrieve data from remote servers. Can I reach my goal with LibCurl? If so, could you plese show me a code sample?
Thanks in advance.
External links opened with ShellExecute are always opened in a new tab by default. Chrome can't change this behavior. Early Firefox had an option for opening an external link in a currently active tab, but does not seem to have it now.
You can download files with libcurl, see url2file example. After a file has been downloaded, you can open it in a certain application with ShellExecute. You just need to find an application, that is suitable to your requirements. For example Adobe Reader does not seem to support opening in the same tab 1, 2. As #KJ commented while I was typing my answer, sumatrapdf -reuse-instance seem to be suitable for you.
You can use Edge WebView2 component in your app instead of a browser.

Finding the source file path of a cffile upload

As noted on other cffile upload questions,
GetPageContext().formScope().getUploadResource("myFormField").getName()
is great for getting the filename on the server before actually doing the cffile (for Railo and Lucee - there's a different method for ColdFusion) but I noticed an interesting wrinkle: if the browser is IE then this returns the full source path including the filename. Firefox and Chrome on the other hand, return only the filename.
For my application I need the full path, but haven't been able to find that when the browser is FireFox or Chrome. If anyone has any ideas I would be most grateful!
(Expanded from the comments)
I am not familiar with the getUploadResource() function. However, looking over this related thread, it sounds like it returns file information submitted by the client. While there are recommended guidelines, ultimately the value received on the server is whatever the browser chooses to send. It is not something that can be changed or controlled by server side code. So if Firefox and Chrome return something different than IE, you are out of luck.
(As an aside, personally I have always found Internet Explorer to be a bit odd in this area. Traditionally browsers are restricted from certain file access operations for security reasons, unless a signed control is used. So you might expect those restrictions would prohibit a browser from submitting information about the structure of the client file system as well. In fact, most browsers do not submit path information with uploads, only a file name. Obviously, Internet Explorer chose to do things .. differently .. for whatever reason)
For my application I need the full path
Having said all that, why would you need the path from the client machine?

Adding FavIcon to Sharepoint 2013 Site

When we upgraded from Sharepoint 2010 to Sharepoint 2013, our favicon was no longer being displayed. An internet search offered a couple of solutions. One method suggested placing the file in C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\IMAGES and performing an IIS reset.
Not having access to the server and not wanting to disrupt a production site with an IIS reset, I opted to handle this with an upload to a site library and master page change.
I found the following to be an easy change to make.
These are the steps I took:
Upload your .ico file to your site / siteassets library
Make note of the URL to the uploaded .ico file (right click and choose copy shortcut from the menu
In Sharepoint Designer, open your master page file - v4.master or your custom file
Search for this line: SharePoint:SPShortcutIcon.. (if you have a custom master page and this line is missing, copy it from v4.master and place it in the head section.)
Paste the URL of your .ico file from step two into the SPShortcutIcon element on the IconUrl property
Save, checkin, and approve your master page. That's it. Your .ico file will appear in browser tabs and in the URL address bar depending on your browser. If using IE, you may need to clear your cache to get it to display.

IIS6: setting up gzip compression for cfm/js/css files

I'm new to IIS. In short, I'm facing issues to set up the gzip http compression for "cfm js css" file types in IIS6.
The reference resource I followed is at:
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/502ef631-3695-4616-b268-cbe7cf1351ce.mspx?mfr=true
Here are the exact steps I did:
In IIS Manager, double-click the local computer, right-click the Web Sites folder, and then click Properties.
Click the Service tab, and in the HTTP compression section, select the Compress application files check box to enable compression for dynamic files.
Select the Compress static files check box to enable compression for static files.
Change the 'Temporary directory:' to 'C:\Inetpub\compressed_static_files'.
Under Maximum temporary directory size, click 'Unlimited' radio button.
Click 'Apply' button and then click 'OK'.
However, these settings are for .htm, .html, .txt and .asp, .exe and .dll file type only. So, in order to add .js, .css and .cfm, I ran the following commands according to the instruction at the url: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5bce429d-c4a7-4f9e-a619-5972497b932a.mspx?mfr=true
Exact steps are:
cd c:\Inetpub\AdminScripts
cscript adsutil.vbs SET W3SVC/Filters/Compression/Deflate/HcFileExtensions "htm html txt js css"
cscript adsutil.vbs SET W3SVC/Filters/Compression/gzip/HcFileExtensions "htm html txt js css"
cscript adsutil.vbs SET W3SVC/Filters/Compression/Deflate/HcScriptFileExtensions "asp dll exe cfm"
cscript adsutil.vbs SET W3SVC/Filters/Compression/gzip/HcScriptFileExtensions "asp dll exe cfm"
To activate this, I restarted IIS. Steps I followed are:
In IIS Manager, right-click my local computer and select 'All Tasks > Restart IIS...'.
Select 'Restart Internet Services on ' and click OK.
Click 'End now'.
At this point, the server is restarted and now I tested whether the http compression is working or not with the following steps:
Open my web site in FireFox and go to any page with .cfm extension.
Open up FireBug.
Check 'GET' Request Headers for .cfm file. I saw 'Accept-Encoding: gzip, deflate'. This is what the browser sends to the server.
Now, check 'GET' Response Headers for .cfm file. There is even no 'Content-Encoding:' header. I am supposed to see 'Content-Encoding: gzip' here to confirm the server sent .cfm file as gzip encoding.
The same case for 'js css' and even 'html' file too. I think it must be some very basic thing I'm missing here. It will be great if anyone could give me a hint on this.
Thanks in advance.
Gen
Not much help to the OP, over 2 years after the question was asked, but for the benefit of anyone else finding this in Google (as I did), the problem here is with the syntax.
cscript adsutil.vbs SET W3SVC/Filters/Compression/Deflate/HcFileExtensions "htm html txt js css"
should be
cscript adsutil.vbs SET W3SVC/Filters/Compression/Deflate/HcFileExtensions "htm" "html" "txt" "js" "css"
Note the quotes are around each item in the list, not the whole list
On IIS6 I always do it by editing the meta-base directly.
You'll have to check the setting on the web-server properties to be able to do this and be sure to make a backup of the meta-base first e.g. check it in to your source repository
Jeff Atwood covers it here: http://www.codinghorror.com/blog/2004/08/http-compression-and-iis-6-0.html

How does IE downloading is achieved?

I often click on a file link in the IE and a download box just pops out. But what happens behind this scene? I know that IE always talks to web server with HTTP protocol, and HTTP is text based.
So is IE download achieved with HTTP protocol? If so, how could arbitrary file format be downloaded over a text based protocol?
And I am currently trying to make a web app which will direct my customer to download some file. My current design is to implement a web service. Customer will call this web service and the web service will return the file download URL. But then I don't know what to do with the URL. Could I just use something like File.Copy to copy the file from the URL to local disk? Or how should I treat the URL? If there's a better design, please teach me.
Many thanks...
By specifying the right content type, you can tell the browser what kind of data it is you are sending.
In addition, there are special encodings (like Base 64) that allow binary content to be displayed as text, using only a limited set of characters and escaping everything else.
Then, there is nothing you need to do with the url. IE will know whether it can or cannot open the file and will show the download box accordingly.
maybe it's like
<?php
// We'll be outputting a PDF
header('Content-type: application/pdf');
// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="downloaded.pdf"');
// The PDF source is in original.pdf
readfile('original.pdf');
?>