Tag: rest

如何使用换行符制作数据透视图

我有如下的数据: xyf 1 1 1.2 1 2 1.4 1 3 1.6 3 1 3.2 3 2 3.4 3 3 3.6 5 1 5.2 5 2 5.4 5 3 5.6 如果插入数据透视图,则可以使用折线图绘制f与x和y ,并且该图具有两个堆叠的x轴,其中较低的x轴值是1 x 5对应于x,而较高的x轴对于较低x轴的每个值具有值1 2 3 ,表示x = 1和y = 1 2 3,则x = 2和y = 1 2 3,并且x = 3和y = 1 2 3。应该从左到右显示一条连续的线。 我想要的是当x改变值时线断开,所以有三条短线显示y对x常数值的影响。 […]

将restinput参数来自excel工作表restAssured工作? 有没有人试过?

我的老板曾经要求我找一个工具或者devise一个用于testing在云环境中托pipe的rest服务。 他还问我是否可以从excel表格中读取input数据,以便其他初级会员可以在excel中编写testing。 我已经使用Apache poi创build了关键字驱动的框架,所以我知道如何从Java程序中的Excel中读取数据。 我也曾经在httpClient上工作,所以我可以把它们结合在一起。 但是,我听到很多关于放心,并想知道我可以使用放心,input可以从Excel中读取的地方。 值得花时间吗? 还有云基础架构哪种方法最好? 谢谢。

如何使用Web服务发送和接收Excel数据

如何使用Web服务发送和接收Excel数据 我创build了一个Web应用程序来发送Excel文件数据到Web服务。 protected void Page_Load(object sender, EventArgs e) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://localhost:58959/RESTServiceImpl.svc/PostFile"); request.ContentType = "application/vnd.ms-excel"; request.Headers.Add("filename", "fooBar.xls"); request.Method = WebRequestMethods.Http.Post; byte[] fileData = System.IO.File.ReadAllBytes("C:\\Users\\Public\\Documents\\Forecast Pro TRAC\\Input\\Book1.xls"); request.ContentLength = fileData.Length; using (System.IO.BinaryWriter postStream = new System.IO.BinaryWriter(request.GetRequestStream())) { postStream.Write(fileData); postStream.Flush(); postStream.Close(); } HttpWebResponse response = (HttpWebResponse)request.GetResponse(); System.Diagnostics.Debug.Assert(response.StatusCode == HttpStatusCode.OK); string responseMessage = string.Empty; using (System.IO.StreamReader sr […]

使用Apache Wink通过Java REST服务返回Excel文档

我需要从Java REST服务返回一个Microsoft Excel文件。 我正在使用WebSphere 8.5,它固有地使用Apache Wink,因为它是JAX-RS实现; 这是我不能改变的一个要求。 我也在使用Java 7 JDK。 这是我收到的错误: org.apache.wink.server.internal.handlers.FlushResultHandler handleResponse系统找不到com.somewhere.else.message.core.BaseResponseMessagetypes的javax.ws.rs.ext.MessageBodyWriter或DataSourceProvider类和application / vnd.ms-excel mediaType。 确保JAX-RS应用程序中存在指定的types和媒体types的javax.ws.rs.ext.MessageBodyWriter。 这是我的Java资源类的方法: @GET @Path("/report") @Produces("application/vnd.ms-excel") public Response getReport() { int fileSize = 0; byte[] reportByteArray = null; ResponseBuilder responseBuilder = null; InputStream report = null; BaseResponseMessage<InputStream> baseResponseMessage = new BaseResponseMessage<InputStream>(); Path reportPath = null; String localPath = "C:/Users/me/Report.xls"; responseBuilder […]

使用Microsoft Graph无法在Excel中添加表格

我正在试图在Excel 文档中使用Microsoft Graph添加一个表格。 我已经创build了一个Excel文件并获得了我的DriveItemId。 我在Graph Explorer上试了一下: POST https://graph.microsoft.com/beta/me/drive/items/01*****/workbook/tables/add 请求正文 { "address": "Table1", "hasHeaders": true } 但它为我回报了这个: Status Code: 400 { "error": { "code": "InvalidArgument", "message": "The argument is invalid or missing or has an incorrect format.", "innerError": { "request-id": "d3bc1426-db8d-43aa-873b-aaf1326c387a", "date": "2017-04-28T22:16:03" } } } 我怎样才能正确地做到这一点? 谢谢

昏暗字典。 编译错误:未定义用户定义的types

你能帮助解决这个问题吗? 每当我运行这个macros,它停在: Dim authResult As Dictionary 出现以下错误消息:编译错误:未定义用户定义的types。 我以前没有使用字典types,我试图从一个示例macros重新使用此代码。 这个脚本的目的是使用Excel来打电话到一个网站,以便我可以下载历史数据。 我目前卡在login部分。 Sub Login() Dim userName As String Dim password As String Dim apiKey As String userName = "username" password = "password" apiKey = "key123" 'activityTextbox.Text = "" 'clearData Dim authResult As Dictionary Set authResult = restClient.authenticateAccount(userName, password, apiKey) If Not authResult Is Nothing Then 'appendActivity "Connected" […]

从Google表格中的REST服务导入数据

我只想从Google表格中的其他url获取一行。 当我尝试 =IMPORTDATA("https://imageryuploader.geoplatform.gov/arcgis/rest/services/ImageEvents/MapServer/1/query?text=A0016-4646&outFields=EXIFPhotoDate") 我得到了页面的整个代码块 我得到NA =IMPORTHTML("https://imageryuploader.geoplatform.gov/arcgis/rest/services/ImageEvents/MapServer/1/query?text=A0016-4646&outFields=EXIFPhotoDate", "list",1) 如果我只是把https://imageryuploader.geoplatform.gov/arcgis/rest/services/ImageEvents/MapServer/1/query?text=A0016-4646&outFields=EXIFPhotoDate放到浏览器中, logging:2 EXIFPhotoDate:1506173228000 Point:X:-66.61147999999997 Y:18.279028333000042 EXIFPhotoDate:1506173228000 Point:X:-66.61147999999997 Y:18.279028333000042 我想创build一个谷歌表,我们有 列A – 图像名称,在列B中使用= IMPORTHTML(“ https://imageryuploader.geoplatform.gov/arcgis/rest/services/ImageEvents/MapServer/1/query?text=A0016-4646&outFields=EXIFPhotoDate ”, “list”,1)或类似的东西,得到UNIX D / T。 最后,在C列中应该inputdd / mm / yyyy和24 UTC时间。 感谢将Exifdate转换为不同的格式我有转换unix d / t的公式。 如果Google表格无法做到这一点,那么很高兴使用EXCEL或Python 2.7 示例GSheet位于https://docs.google.com/spreadsheets/d/1Ff-gohRIkumpxqSeEVKyGq6PPEP542PJSB1vBIzI1jA/edit#gid=0

为什么在浏览器中使用JAX-RS和标准servlet时没有显示popup窗口?

当我尝试使用standard servlet approach ,在我的浏览器中popup窗口显示询问是否打开.xls文件或保存它。 我通过JAX-RS尝试了完全相同的代码,并且浏览器popup窗口不会以某种方式显示出来。 有没有人遇到过这个? JAX-RS的方式,不会显示popup: @Path("excellaTest") public class ExcellaTestResource { @Context private UriInfo context; @Context private HttpServletResponse response; @Context private HttpServletRequest request; public ExcellaTestResource() { } @Path("horizontalProcess") @GET //@Produces("application/vnd.ms-excel") @Produces("application/vnd.ms-excel") public void getProcessHorizontally() { try { URL templateFileUrl = this.getClass().getResource("myExcelTemplate.xls"); String templateFilePath = URLDecoder.decode(templateFileUrl.getPath(), "UTF-8"); String outputFileDir = "MasatoExcelHorizontalOutput"; ReportProcessor reportProcessor = new […]

如何从angular2中通过rest获得excel文件

我正在使用angular色2与Java背景和他们之间的通信是通过REST。 我必须做的是创build一个button点击一个Excel文件,然后在用户API中返回该文件。 REST如下所示: @RequestMapping(value = "/some_path/{someId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) public FileSystemResource exportSomeData(@PathVariable long someId, HttpServletResponse response) { // … create excel file data… File file = new File(fileName); response.addHeader("FILE_NAME", fileName); FileNameResource fsr = new FileNameResource(file); return fsr; } @RequestMapping(value = "/some_path/{someId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_OCTET_STREAM_VALUE) public FileSystemResource exportSomeData(@PathVariable long someId, […]

从Web服务获取Excel工作表的字节数组并将其显示在HTML中

我需要在HTML页面中显示Excel工作表,但是Excel工作表不在本地存储中,而是来自Web服务。 我可以从下面的Web服务获取Excel工作表作为字节数组。 @Path("/getGuruHoldings") @POST @Produces(MediaType.APPLICATION_OCTET_STREAM) public byte[] getGuruHoldings(@FormParam("guruId") String guruId) { String response = "SUCCESS"; int guru = Integer.parseInt(guruId); List<GuruHoldingDTO> list = guruService.getGuruHoldings(guru); ExcelCreateHelper createHelper = new ExcelCreateHelper(); /** method to convert list values into excel sheet byte array */ byte[] fos = createHelper.guruHoldingExcel(list); return fos; } HTTP://本地主机:8081 / myguru / gurudata / getGuruHoldings 我可以从这个链接获取Excel表单字节数组。 […]