Visual Studio download a document from a document libary and upload it to a jaxrs webservice in java
I have created a custom ribbon action and a application page in visual studio. The user
presses my ribbon in sharepoint and it calls the application page that in turn downloads that file. here is the code:
namespace Save_to_PLM.Layouts.Save_to_PLM
public partial class ApplicationPage : LayoutsPageBase
protected void Page_Load(object sender, EventArgs e)
if (Request.QueryString["file"] != null)
DownloadDocument(Request.QueryString["file"].ToString());
private void DownloadDocument(string fileName)
SPSecurity.RunWithElevatedPrivileges(delegate()
using (SPSite oSiteCollection = new SPSite(SPContext.Current.Site.Url))
using (SPWeb mi_web = oSiteCollection.OpenWeb())
string path = System.Web.HttpContext.Current.Server.MapPath(fileName);
string name = System.IO.Path.GetFileName(path);
Console.WriteLine(name);
Microsoft.SharePoint.SPFile spFile = mi_web.GetFile(fileName);
Response.ClearHeaders();
Response.ClearContent();
Response.ContentType = "application/force-download";
Response.AppendHeader("content-disposition", "attachment; filename=" + name);
Response.BinaryWrite(spFile.OpenBinary());
Response.End();
But i want to http post that file to my jaxrs webservice in java. How do i do that
programmatically? I am very new .net i usually code in java.
Hi,
Here is a blog about how to call a Java EE Web Service from a .Net Client for your reference:
http://blogs.msdn.com/b/bursteg/archive/2008/07/19/how-to-call-a-java-ee-web-service-from-a-net-client.aspx
If you want to download a document from a Sharepoint library, we can use the REST API provided by SharePoint and use Apache HttpComponents in Java.
http://www.rgagnon.com/javadetails/java-get-document-sharepoint-library.html
About how to upload file using jaxrs webservice in C# code, I suggest you post it to C# or ASP.Net Forum, you will get more help and confirmed answers from there.
https://social.msdn.microsoft.com/Forums/en-US/home?forum=csharpgeneral
Best Regards
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]
Similar Messages
-
Hi Everyone,
Please help me on this issue. I'm a new SSIS User.
I've installed Sql Server 2005 Developer Edition
When I create a new SSIS Project in Business Intelligence Development Studio,
I get the following message:
"Microsoft Visual Studio is unable to load this document: Object reference is not set to an instance of an object".
Error loading 'package.dtsx'bject reference is not set to an instance of an object
When I try to debug the package, I get the below message:
parameter Component(System.Design) is null.
I've uninstalled and installed SS 2005 several times, yet the problem persists.
Please help.
This is the package.dtsx
<?xml version="1.0"?><DTS:Executable xmlnsTS="www.microsoft.com/SqlServer/Dts" DTS:ExecutableType="MSDTS.Package.1"><DTSroperty DTS:Name="PackageFormatVersion">2</DTSroperty><DTSroperty DTS:Name="VersionComments"></DTSroperty><DTSroperty DTS:Name="CreatorName">US\kothand1</DTSroperty><DTSroperty DTS:Name="CreatorComputerName">US6051KOTHAND1</DTSroperty><DTSroperty DTS:Name="CreationDate" DTSataType="7">4/8/2008 10:53:39 AM</DTSroperty><DTSroperty DTS:Name="PackageType">5</DTSroperty><DTSroperty DTS:Name="ProtectionLevel">1</DTSroperty><DTSroperty DTS:Name="MaxConcurrentExecutables">-1</DTSroperty><DTSroperty DTS:Name="PackagePriorityClass">0</DTSroperty><DTSroperty DTS:Name="VersionMajor">1</DTSroperty><DTSroperty DTS:Name="VersionMinor">0</DTSroperty><DTSroperty DTS:Name="VersionBuild">0</DTSroperty><DTSroperty DTS:Name="VersionGUID">{FBD98635-EDDE-4F58-9D53-356E8CB653FB}</DTSroperty><DTSroperty DTS:Name="EnableConfig">0</DTSroperty><DTSroperty DTS:Name="CheckpointFileName"></DTSroperty><DTSroperty DTS:Name="SaveCheckpoints">0</DTSroperty><DTSroperty DTS:Name="CheckpointUsage">0</DTSroperty><DTSroperty DTS:Name="SuppressConfigurationWarnings">0</DTSroperty><DTSroperty DTS:Name="ForceExecValue">0</DTSroperty><DTSroperty DTS:Name="ExecValue" DTSataType="3">0</DTSroperty><DTSroperty DTS:Name="ForceExecutionResult">-1</DTSroperty><DTSroperty DTS:Name="Disabled">0</DTSroperty><DTSroperty DTS:Name="FailPackageOnFailure">0</DTSroperty><DTSroperty DTS:Name="FailParentOnFailure">0</DTSroperty><DTSroperty DTS:Name="MaxErrorCount">1</DTSroperty><DTSroperty DTS:Name="ISOLevel">1048576</DTSroperty><DTSroperty DTS:Name="LocaleID">1033</DTSroperty><DTSroperty DTS:Name="TransactionOption">1</DTSroperty><DTSroperty DTS:Name="DelayValidation">0</DTSroperty>
<DTS:LoggingOptions><DTSroperty DTS:Name="LoggingMode">0</DTSroperty><DTSroperty DTS:Name="FilterKind">1</DTSroperty><DTSroperty DTS:Name="EventFilter" DTSataType="8"></DTSroperty></DTS:LoggingOptions><DTSroperty DTS:Name="ObjectName">Package</DTSroperty><DTSroperty DTS:Name="DTSID">{191D188C-EA6E-46D6-A46A-8C9F3C21C321}</DTSroperty><DTSroperty DTS:Name="Description"></DTSroperty><DTSroperty DTS:Name="CreationName">MSDTS.Package.1</DTSroperty><DTSroperty DTS:Name="DisableEventHandlers">0</DTSroperty></DTS:Executable>
Thanks
Best RegardsNo I have not yet. I've applied just the windows updates. I rebooted after the updates, but the problem persists.
I evern tried importing the .vssettings file from my co-worker's. Also, I tried resetting the user settings
using "%programfiles%\Microsoft Visual Studio 8\Common7\IDE\devenv.exe" /resetuserdata.
I'm on Windows xp 2002 service pack 2. Sql server 2005 Developer edition.
Visual Studio info:
Microsoft Visual Studio 2005
Version 8.0.50727.762 (SP.050727-7600)
Microsoft .NET Framework
Version 2.0.50727 SP1
Installed Edition: IDE Standard
Microsoft Visual Studio 2005 Premier Partner Edition - ENU Service Pack 1 (KB926601)
This service pack is for Microsoft Visual Studio 2005 Premier Partner Edition - ENU.
If you later install a more recent service pack, this service pack will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/926601
SQL Server Analysis Services
Microsoft SQL Server Analysis Services Designer
Version 9.00.1399.00
SQL Server Integration Services
Microsoft SQL Server Integration Services Designer
Version 9.00.1399.00
SQL Server Reporting Services
Microsoft SQL Server Reporting Services Designers
Version 9.00.1399.00
Thanks
Best regards -
Upload/Download file to/from a document library in a SharePoint online site
Hi,
I am referring to the below blog for Upload/Download file to/from a document library in a SharePoint online site.
http://blogs.msdn.com/b/rohitpuri/archive/2007/04/10/upload-download-file-to-from-wss-document-library-using-dav.aspx?CommentPosted=true#commentmessage
I would like to know if this is feasible with a SharePoint online site.
If feasible, how can I resolve the below exception I am getting while using the code.
“The remote server returned an error: (403) Forbidden”.
Thanks,
ThananHi,
Actually what I am trying to achieve is the two things.
1) By using only the user's name, need to upload/download from/to the document library of SharePoint online site using the CSOM. (i.e., achieving Single Sign On / Windows Authentication)
2) I need to achieve the above only by passing the document URL; not by hardcording/ configuring the document library name in the windows application.
Can anyone pls help on this now?
[Below code is working fine. But need to arrive the solution whereas the above 2 conditions are not violated.
using (var clientContext
= new ClientContext("https://yoursiteurl.com"))
string passWd
= "password";
SecureString securePassWd
= new SecureString();
foreach
(var c in passWd.ToCharArray())
securePassWd.AppendChar(c);
clientContext.Credentials
= new SharePointOnlineCredentials("username", securePassWd);
using
(var fs =
new FileStream("fileName",
FileMode.Open))
var fi =
new FileInfo("fileName");
var list = clientContext.Web.Lists.GetByTitle("Doc Library");
clientContext.Load(list.RootFolder);
clientContext.ExecuteQuery();
var fileUrl = String.Format("{0}/{1}", list.RootFolder.ServerRelativeUrl,
fi.Name);
Microsoft.SharePoint.Client.File.SaveBinaryDirect(clientContext, fileUrl,
fs, true);
Thanks,
Thanann -
Restrict download of documents from a Document library
Hi,
I am working on a trial version of SharePoint online E3. I enabled IRM on it with a hope that it will restrict "DOWNLOAD" of documents from a document library itself. However to my bad, it seems it allows downloading... with imposed restrictions.
Can anybody help me in this? I need only some of the users to be able to download/print/copy documents from library and NOT all of them. Rest can only view the document. Is it possible in SP Online?
Is it possible in SharePoint 2010 or is it the same in here as well?Hi
yes,sharepoint online we can Use IRM. please refer yes,
http://office.microsoft.com/en-in/office365-sharepoint-online-enterprise-help/set-up-information-rights-management-irm-in-sharepoint-admin-center-HA102895193.aspx
Please remember to click 'Mark as Answer' on the answer if it helps you -
Cannot email documents from my document folder
cannot send documents from my document folder, picture folder or anywhere. It kicks me over to outlook express, then it reads connection to server has failed pop3 comcast.net. I'm not with comcast .net, I'm with verizon.net
Hello leo3,
Sorry for the trouble you are having. Looks like you do have comcast.net set up just as "somegirl" mentioned. Here is some information on how to set up your outlook.
http://www22.verizon.com/ResidentialHelp/FiOSInternet/Email/Setup+And+Use/QuestionsOne/124289.htm
PM me if you still need assistance.
Shamika_Vz
Verizon Support
Notice: Content posted by Verizon employees is meant to be informational and does not supersede or change the Verizon Forums User Guidelines or Terms or Service, or your Customer Agreement Terms and Conditions or Plan. -
How to get Invoice Document from Accounting Document
Hi Experts,
How to get Invoice Document from Accounting Document. Can you suggest some tables.
Regards,
Mohanhi,
in vf02 or vf03.
go to document flow
select an accounting document - double click it.
GOTO header you will find reference field there & it is nothing but billing document.
in FB03 also you can findout the same if you know an accounting document.
tables which they store are BKPF & BSEG
balajia -
Where does "C:\Program Files\Microsoft Visual Studio 8" folder come from?
This seems like the right forum to ask, Where does "C:\Program Files\Microsoft Visual Studio 8" folder come from, need to find out by what app it was installed.
Hi Anna,
Could you please tell us what about this problem now?
If you have been solved the issue, would you mind sharing us the solution here? So it would be helpful for other members
who get the same issue.
If not, please let us know the latest information about it.
Best Regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
I downloaded a film from ITunes in HD and had problems, I upgraded to the latest version of ITunes and have then downloaded the film again in SD on my Windows 7 computer, but I still can't get the film to play, any idea's what to do next?
I've been working at the same problem for hours now and it's really driving me crazy so any help would be greatly appreciated.It is working now. I no longer get the message about the item not being available in the US and I can access the store.
-
I have a problem. When I start to sync music to my iPod touch, you have to enter the password of your account. I downloaded the game from the general account, and do not always know the password. He writes that if I do not login, then the game will be erased. Previously, this was not. When starting to sync music, it did not touch my programs, and now because of this music can not be transferred to iPods. PANIC AT ME! HELP
If they are Tunes purchased music you have to sing into the account that purchased them.
Is this the iTunes library/computer you sync with? You can rally only "sync" with one iTunes library/computer.However, yo can manually manage music and videos among different libraries/computer. See the manual method of:
iTunes 11 for Windows: Set up syncing for iPod, iPhone, or iPad -
My daughter has downloaded free games from the App Store and I have been charged in excess of £200 and I don't know why has anyone had the same issue and if so how did you get your money back
Contact iTunes Customer Service and request assistance
Use this Link > Apple Support iTunes Store Contact
To help avoid future transgressions set the Restrictions for In-App Purchases...
Settings > General > Restrictions
Understanding Restrictions > http://support.apple.com/kb/HT4213 -
We are using VS2013 Premium. i have installed vs2013 Test controller in my dev environment. While i am configuring (https://msdn.microsoft.com/en-us/library/hh546459.aspx) getting error message in
the Configuration summary dialog box displaying following error's : 1. Failed to Configure TFS Team Project Collection, 2. Could not complete operation as the time out expired. ''
I have checked the "visual Studio Test controller " in the
Services --> Administrative. Its automatically stopped the service. When i started the manually its showing message like as 'The visual Studio Test controller
service on local computer started and then stopped. Some services stop automatically if they are not in use by other services or programs'
Please guide me how to resolve this problem.
Thanks in Advance...Hi Divakar,
What’s the version of your TFS?
How do you configure the test control?
Please make sure you are specify the team collection instead of team project.
On the other hand, you may enable test controller logs. (You could share the log file on the OneDrive)
# How to enable test controller logs
http://blogs.msdn.com/b/aseemb/archive/2009/11/28/how-to-enable-test-controller-logs.aspx
Regards
Starain
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Has anybody downloaded logic pro from the app store and how did it work thanks
has anybody downloaded logic pro from the app store and how did it work?
thanksI've recently upgraded my stuff with a Mac Mini Server and downloaded Logic from the app store with absolutely no problems at all. I'm on 10.7.3 with an i7 processor and 4Gb memory (yeah, may as well put another 4 in as well, I know).
Logic 9.1.6 is running very smoothly for me, but I think I'll go to 9.1.7 because there is a malfunction with time stretching regions in the Arrange window that the update's meant to fix.
A lot of your experience with downloading the additional content, apart from Logic itself, will depend on the speed of your internet connection, but the software handling of that aspect seems quite good - best to just load one lot of stuff at a time and see how it works out. -
Has anybody downloaded logic pro from the app store and how did it work
has anybody downloaded logic pro from the app store and how did it work?
ThanksHi ...
Best way to get feedback form Logic Pro users is to post your question in that forum here. -
I'm trying to download an app from the App Store and I get a message the my Apple ID can't be used in iTunes and to try another. Never happened before. Any ideas?
Someone else said Apple's servers are having problems tonight. Just try again later.
-
I was downloading a app from the app store and it downloaded about 85% then gave an error message download failed but when I reopen the app store to the purchases the resume button show but when i click it the same error comes up failed to download
If you have more than one user account, these instructions must be carried out as an administrator.
Launch the Console application in any of the following ways:
☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
Select
/var/log ▹ install.log
from the hierarchical list on the left. If you don't see that list, select
View ▹ Show Log List
from the menu bar. Then select the messages from the last installation or update attempt, starting from the time when you initiated it. If you're not sure when that was, start over and note the time. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V).
If there are runs of repeated messages, post only one example of each. Don’t post many repetitions of the same message.
When posting a log extract, be selective. Don't post more than is requested.
Please do not indiscriminately dump thousands of lines from the log into this discussion.
Important: Some private information, such as your name, may appear in the log. Edit it out by search-and-replace in a text editor before posting.
Maybe you are looking for
-
Any hope of a new CourseBuilder?
Any hope of a new version of CourseBuilder for CS3? With added features? Compatible with Firefox (drag and drop, timer, slider...)? We have hundreds of exercises based on CB? We have tailored the interactions to our needs. We suppose we are not alone
-
Disabling Popularity Trends and Reindex library in Sharepoint 2013
Hi, I need to disable "Popularity Trends" option for all items, lists and libraries in SharePoint 2013. Also i need to disable "Reindex library" options in SharePoint 2013 document library Advanced settings. If this is possible, can anyone ellaborate
-
I'm trying to implement a new control that needs a scrollbar, worked fine until I tried to collapse few properties.. The scroll bar must appear only if the BlockOffset (which is an integer that draws properties, and if the last property was drawn bel
-
White screen on default settings and no internet please help:(
Hey guys, I was wondering if anyone can help me with my daughters phone I cant seem to get it to access the internet it says unable to connect to the internet please try again later! however its connected to my home hub at the moment i have checked i
-
Any of the download would show the u201C PO numberu201D on the sales order.
Hi All, Please let me know if any of the download would show the u201C PO numberu201D on the sales order. Aditya