如何在 Android 中通过 POST 请求查询 Web 服务?

2024-04-05

我完全陌生网络要素服务(WFS) http://en.wikipedia.org/wiki/Web_Feature_Service但我想构建一个 Android 应用程序ksoap2-android http://code.google.com/p/ksoap2-android/位于通过 WFS 发布数据的 API 之上。我想从 API 请求数据并将其传递给边界框参数来限制将返回的数据。

问题:

  • 我怎样才能把GetFeature对象放入 SOAP 信封中?
  • 我该如何使用JAXBElement在安卓客户端上?请参阅 2012 年 3 月 15 日的编辑

以下是一些 API 链接,可能有助于理解其格式。

示例:WFS-1.1 GetFeature POST 请求,http://data.wien.gv.at/daten/geoserver/wfs http://data.wien.gv.at/daten/geoserver/wfs

<?xml version="1.0" encoding="UTF-8"?>
<wfs:GetFeature service="WFS" version="1.1.0"
  outputFormat="JSON"
  xmlns:ogdwien="http://www.wien.gv.at/ogdwien"
  xmlns:wfs="http://www.opengis.net/wfs"
  xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:gml="http://www.opengis.net/gml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.opengis.net/wfs
  http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" >
 <wfs:Query typeName="ogdwien:BAUMOGD">
   <ogc:Filter>
   <ogc:BBOX>
   <ogc:PropertyName>SHAPE</ogc:PropertyName>
   <gml:Envelope srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
     <gml:lowerCorner>16.3739 48.2195</gml:lowerCorner>
     <gml:upperCorner>16.3759 48.2203</gml:upperCorner>
   </gml:Envelope>
   </ogc:BBOX>
   </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

这是我现在想出的Android代码。这主要是受到启发来自 ksoap2-android wiki 的示例 http://code.google.com/p/ksoap2-android/wiki/Links。我完全是unsure是否名称空间, 方法名 and url是正确的!

// KSOAP2Client.java

private class MyAsyncTask extends AsyncTask<Void, Void, Object> {
    String namespace = "http://www.wien.gv.at/ogdwien";
    String methodName = "GetFeature";
    String url = "http://data.wien.gv.at/daten/geoserver/wfs";

    protected Object doInBackground(Void... voids) {
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        envelope.dotNet = false;
        SoapObject soapObject = new SoapObject(namespace, methodName);
        envelope.setOutputSoapObject(soapObject);

        // TODO Put request parameters in the envelope. But how?

        try {
            HttpTransportSE httpTransportSE = new HttpTransportSE(url);
            httpTransportSE.debug = true;
            httpTransportSE.call(namespace + methodName, envelope);
            return (Object)soapSerializationEnvelope.getResponse();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
        return null;
    }
}

编辑:2012 年 3 月 15 日


我设法走得更远,几乎找到了解决方案。我找到了模式定义 http://repo1.maven.org/maven2/org/jvnet/ogc/用于 XML 请求中使用的命名空间并将它们链接到我的项目。这使我能够根据请求组装对象。

// TODO The core libraries won't work with Android.
import javax.xml.bind.JAXBElement;
import javax.xml.namespace.QName;

// TODO Not sure if the versions fit with the service.
import net.opengis.filter.v_1_1_0.BBOXType;
import net.opengis.filter.v_1_1_0.FilterType;
import net.opengis.filter.v_1_1_0.PropertyNameType;
import net.opengis.gml.v_3_1_1.DirectPositionType;
import net.opengis.gml.v_3_1_1.EnvelopeType;
import net.opengis.wfs.v_1_1_0.GetFeatureType;
import net.opengis.wfs.v_1_1_0.QueryType;

[...]

List<Double> lowerCornerList = new Vector<Double>();
lowerCornerList.add(16.3739);
lowerCornerList.add(48.2195);

List<Double> upperCornerList = new Vector<Double>();
upperCornerList.add(16.3759);
upperCornerList.add(48.2203);

DirectPositionType lowerCornerDirectPositionType = new DirectPositionType();
lowerCornerDirectPositionType.setValue(lowerCornerList);
DirectPositionType upperCornerDirectPositionType = new DirectPositionType();
upperCornerDirectPositionType.setValue(upperCornerList);

EnvelopeType envelopeType = new EnvelopeType();
envelopeType.setSrsName("http://www.opengis.net/gml/srs/epsg.xml#4326");
envelopeType.setLowerCorner(lowerCornerDirectPositionType);
envelopeType.setUpperCorner(upperCornerDirectPositionType);

List<Object> propertyNames = new Vector<Object>();
propertyNames.add(new String("SHAPE"));

PropertyNameType propertyNameType = new PropertyNameType();
propertyNameType.setContent(propertyNames);

// TODO Check parameters of JAXBElement.
JAXBElement<EnvelopeType> e = new JAXBElement<EnvelopeType>(null, null, envelopeType);
BBOXType bboxType = new BBOXType();
bboxType.setPropertyName(propertyNameType);
bboxType.setEnvelope(e);

// TODO Check parameters of JAXBElement.
JAXBElement<BBOXType> spatialOps = new JAXBElement<BBOXType>(null, null, bboxType);
FilterType filterType = new FilterType();
filterType.setSpatialOps(spatialOps);

QueryType queryType = new QueryType();
List<QName> typeNames = new Vector<QName>();
// TODO Check parameters of QName.
typeNames.add(new QName("ogdwien", "BAUMOGD"));
queryType.setTypeName(typeNames);

GetFeatureType featureType = new GetFeatureType();
featureType.setService("WFS");
featureType.setVersion("1.1.0");
featureType.setOutputFormat("JSON");
featureType.setMaxFeatures(new BigInteger("5"));

String namespace = "http://www.wien.gv.at/ogdwien";
String methodName = "GetFeature";
// TODO Is this the correct action?
String action = "http://data.wien.gv.at/daten/wfs?service=WFS&request=GetFeature&version=1.1.0&typeName=ogdwien:BAUMOGD&srsName=EPSG:4326";
String url = "http://data.wien.gv.at/daten/geoserver/wfs";

// TODO Is this the correct way to add GetFeature?
SoapObject soapObject = new SoapObject(namespace, methodName);
PropertyInfo propertyInfo = new PropertyInfo();
propertyInfo.setName("GetFeature");
propertyInfo.setValue(featureType);
soapObject.addProperty(propertyInfo);

仍然存在一个大问题和一些小问题。主要问题是JAXBElement包含在一个核心库 (javax.xml.bind.JAXBElement) Android 拒绝使用。小问题在评论和 TODO 中指出。

编辑:2012 年 4 月 27 日


当我读到时这个帖子 https://stackoverflow.com/a/7624106/356895我想类似的事情可能适用于我的问题。我还没试过。

编辑:2012 年 5 月 9 日


这里是来自 Eclipse 的错误消息 http://pastebin.com/X6CfmvrX当您尝试编译适用于 Android 的 JAXBElement 时。


@JJD 我看到你给我留言了here https://stackoverflow.com/questions/8968620/android-soapfault-error/9042499#comment11653966_9042499
我一会儿要开会,但我看了你的问题,很乐意为你提供尽可能多的帮助。我发现您在阅读架构定义时遇到问题。您拥有的这个 ws 定义是一个又一个的链接,这就是为什么它让您在阅读时感到困惑:

如果你继续:http://schemas.opengis.net/wfs/1.1.0/wfs.xsd http://schemas.opengis.net/wfs/1.1.0/wfs.xsd

采用“GetCapability”方法,让我们在 Web 服务定义中读取它:

PS:我没有测试这些,但是:

  • 我认为命名空间应该是:http://www.opengis.net/wfs http://www.opengis.net/wfs(来自目标命名空间)
  • 方法名称:获取能力
  • url: http://schemas.opengis.net/wfs/1.1.0/wfs.xsd http://schemas.opengis.net/wfs/1.1.0/wfs.xsd


现在您有 GetCapability 的请求:

<!-- REQUEST -->
<xsd:element name="GetCapabilities" type="wfs:GetCapabilitiesType"/>
<xsd:complexType name="GetCapabilitiesType">
    <xsd:annotation>
    </xsd:annotation>
    <xsd:complexContent>
    <xsd:extension base="ows:GetCapabilitiesType">
    <xsd:attribute name="service" type="ows:ServiceType" use="optional" default="WFS"/>
    </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

GetCapability 有一个复杂的类型:GetCapabilityType,您可以在本页的 xsd 链接之一中找到它,准确地说“owsGetCapability.xsd”

--> 打开后,即:http://schemas.opengis.net/ows/1.0.0/owsGetCapability.xsd http://schemas.opengis.net/ows/1.0.0/owsGetCapabilities.xsd

您会发现这个复杂的类型定义:

<complexType name="GetCapabilitiesType">
<annotation>
     <documentation>
         XML encoded GetCapabilities operation request. This operation 
         allows clients to retrieve service metadata about a specific service instance.
         In this XML encoding, no "request" parameter is included, since the element name 
         specifies the specific operation. This base type shall be extended by each specific 
         OWS to include the additional required "service" attribute, with the correct value for that OWS. 
     </documentation>
</annotation>
<sequence>
     <element name="AcceptVersions" type="ows:AcceptVersionsType" minOccurs="0">
         <annotation>
             <documentation>When omitted, server shall return latest supported version. 
             </documentation>
         </annotation>
     </element>
     <element name="Sections" type="ows:SectionsType" minOccurs="0">
         <annotation>
             <documentation>
                 When omitted or not supported by server, 
                 server shall return complete service metadata (Capabilities) document. 
             </documentation>
         </annotation>
     </element>
     <element name="AcceptFormats" type="ows:AcceptFormatsType" minOccurs="0">
         <annotation>
             <documentation>
                 When omitted or not supported by server, server shall return service metadata 
                 document using the MIME type "text/xml". 
             </documentation>
         </annotation>
     </element>
 </sequence>
<attribute name="updateSequence" type="ows:UpdateSequenceType" use="optional">
     <annotation>
         <documentation>
             When omitted or not supported by server, 
             server shall return latest complete service 
             metadata document. 
         </documentation>
     </annotation>
</attribute>
</complexType>

现在这个 GetCapabilityType 有元素/属性:
name="AcceptVersions" of type="ows:AcceptVersionsType" 和 minOccurs="0" 即可以为 null name="Sections" of type="ows:SectionsType" 和 minOccurs="0" 即可以为 null name="AcceptFormats" of type="ows:AcceptFormatsType" 和 minOccurs="0" 即可以为 null name="updateSequence" of type="ows:UpdateSequenceType" 且其是可选的 -->use="optional"

在哪里可以找到这些属性定义?
-->在同一页面上您有:AcceptVersionsType 是:

<complexType name="AcceptVersionsType">
 <annotation>
 <documentation>
  Prioritized sequence of one or more specification versions accepted by client, with preferred versions listed first. See Version negotiation subclause for more information.     
 </documentation>
 </annotation>
 <sequence>
  <element name="Version" type="ows:VersionType" maxOccurs="unbounded"/>
 </sequence>
</complexType>


因此 AcceptVersionsType 有一个类型为 VersionType 的元素,可以在 xsd 中找到owsOperationsMetadata.xsd(位于此页面的同一链接上),在其上有 xsd:owsCommon.xsd,这是找到 VersionType 的地方 IE: http://schemas.opengis.net/ows/1.0.0/owsCommon.xsd http://schemas.opengis.net/ows/1.0.0/owsCommon.xsd

<simpleType name="VersionType">
  <annotation>
    <documentation>Specification version for OWS operation. The string value shall contain one x.y.z "version" value (e.g., "2.1.3"). A version number shall contain three non-negative integers separated by decimal points, in the form "x.y.z". The integers y and z shall not exceed 99. Each version shall be for the Implementation Specification (document) and the associated XML Schemas to which requested operations will conform. An Implementation Specification version normally specifies XML Schemas against which an XML encoded operation response must conform and should be validated. See Version negotiation subclause for more information. </documentation>
  </annotation>
  <restriction base="string"/>
</simpleType>

和sectionsType是:

<complexType name="SectionsType">
 <annotation>
   <documentation>
    Unordered list of zero or more names of requested sections in complete service metadata document. Each Section value shall contain an allowed section name as specified by each OWS specification. See Sections parameter subclause for more information.            
   </documentation>
 </annotation>
 <sequence>
    <element name="Section" type="string" minOccurs="0" maxOccurs="unbounded"/>
 </sequence>
</complexType>

(SectionsType 有一个简单类型 String 的元素)

AcceptFormatsType 是:

<complexType name="AcceptFormatsType">
 <annotation>
   <documentation>
    Prioritized sequence of zero or more GetCapabilities operation response formats desired by client, with preferred formats listed first. Each response format shall be identified by its MIME type. See AcceptFormats parameter use subclause for more information. 
   </documentation>
 </annotation>
 <sequence>
  <element name="OutputFormat" type="ows:MimeType" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>

(AcceptFormatsType 有一个 MimeType 类型的元素,它与 VersionType 位于同一位置,即:http://schemas.opengis.net/ows/1.0.0/owsCommon.xsd http://schemas.opengis.net/ows/1.0.0/owsCommon.xsd

<simpleType name="MimeType">
  <annotation>
    <documentation>XML encoded identifier of a standard MIME type, possibly a parameterized MIME type. </documentation>
  </annotation>
  <restriction base="string">
    <pattern value="(application|audio|image|text|video|message|multipart|model)/.+(;s*.+=.+)*"/>
  </restriction>
</simpleType>

而 UpdateSequenceType 是(它是简单类型而不是复杂类型):

 <simpleType name="UpdateSequenceType">
 <annotation>
  <documentation>
   Service metadata document version, having values that are "increased" whenever any change is made in service metadata document. Values are selected by each server, and are always opaque to clients. See updateSequence parameter use subclause for more information.     
   </documentation>
  </annotation>
 <restriction base="string"/>
 </simpleType>

(UpdateSequenceType是一个简单类型)

现在我希望它能更清楚地了解如何阅读架构。 现在复杂型表示与简单类型(例如:int)不同的对象。当您具有复杂类型并且使用 ksoap2 时,您必须在实现 kvmSerialized(ksoap2 序列化接口)的类(对象)中创建本地表示。

现在,您可以阅读我的答案以了解如何执行此操作:Link1 https://stackoverflow.com/questions/9023442/android-wsdl-web-service-ksoap2/9042267#9042267,link2 https://stackoverflow.com/questions/8968620/android-soapfault-error/9042499#9042499,link3 https://stackoverflow.com/questions/9068161/android-calling-net-webservice-ksoap2/9074239#9074239。我写了一些详细信息,将帮助您了解如何开始编码。

我今天不会使用电脑。希望这会有所帮助,如果我所说的任何内容含糊不清,请告诉我。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何在 Android 中通过 POST 请求查询 Web 服务? 的相关文章

  • 如何在生产中安全地更改会话 cookie 域或名称?

    我们最近意识到我们的会话 cookie 正在被写入我们网站的完全限定域名 www myapp com 例如 MYAPPCOOKIE 79D5DB83 domain www myapp com 我们希望将其切换为可以跨子域共享的cookie
  • 改造添加带有令牌和 ID 的标头

    我在获取经过身份验证的用户时遇到问题 在此之前我得到了令牌和用户 ID 现在我需要使用访问令牌和 ID 从服务器获取用户 我有标题格式 https i stack imgur com OQ87Y png 现在我尝试使用拦截器添加带有用户令牌
  • setOnTouchListener() 给我一个错误

    button setOnTouchListener new OnTouchListener public void onClick View v Toast makeText MainActivity this YOUR TEXT 5000
  • 在 JUnit 测试中读取资源文件

    我在单元测试中读取文本文件 并将一些输入文本文件放置在资源文件夹中 以下是目录结构 src gt com gt au gt myapp gt util gt MyFileReader 测试 gt com gt au gt myapp gt
  • 测试 Hessian remoting-servlet.xml

    我们使用 Hessian 来实现富客户端和服务器之间的通信 由于移动和重命名 remoting servlet xml 中的条目有时会与实际的类名不匹配 因此 我正在寻找一种简单的方法来测试远程处理 xml 有没有简单的方法可以做到这一点
  • 在单独的模块中使用 Spring AOP 方面

    我在一个 Maven 项目模块中有一个方面 com x NiceAspect 在一个单独的 Maven 模块中有一个类 com x NiceClass 这些模块具有相同的 POM 父级 共同创建一个项目 我想要实现的目标是拥有一个通用的方面
  • 使用 https 的 Java Jersey RESTful Web 服务

    我是 Java EE 的新手 正在开发一个 RESTful API 其中每个 API 调用用户都会发送编码的凭据 我的问题是如何通过默认的 http 实现 https 协议并确保我的连接安全 我正在使用 Jersey Restful Web
  • Kotlin 中的枚举类对于 Android 来说是否像 Java 中那样“昂贵”?

    Are EnumKotlin 中的类对于 Android 来说 昂贵 就像 Java 一样 还可以用吗 IntDefs or StringDefs在科特林 当我将 Kotlin Enum 类反编译为 Java 类时 底层仍然使用了 Java
  • IllegalStateException:无法更改片段的标签,以前是 android:switcher,现在是 android:switcher

    我的活动使用TabLayout ViewPager 这里的选项卡和页面的数量是动态的 具体取决于从服务器获取的数据 崩溃是通过 Crashlytics 报告的 我无法复制它 我的活动代码 Override protected void on
  • 重构 google 的 NetworkBoundResource 类以使用 RxJava 而不是 LiveData

    谷歌的android架构组件教程here https developer android com topic libraries architecture guide html有一部分解释了如何抽象通过网络获取数据的逻辑 在其中 他们使用
  • 超慢的表格布局性能

    我遇到了糟糕的 TableLayout 性能 我在这里读过一些帖子 谈论同样的事情 Android 动态创建表 性能不佳 https stackoverflow com questions 9813427 android dynamical
  • android中ScrollView中的图像

    在我的应用程序中 我想放置一个 png 文件 并且希望它在横向和纵向模式下都被视为滚动图像 请建议代码或示例 要使您的 Imageview 在高度不适合时滚动 您可以在 xml 中的 ScrollView 内添加一个 ImageView 并
  • libgdx SpriteBatch 渲染到纹理

    是否可以使用 libGdx 适用于 Android 桌面的 Java 引擎 中的 SpriteBatch 渲染到纹理 如果是这样 怎么办 基本上我想将所有内容渲染到 512 x 256 纹理的 320 x 240 区域 然后缩放区域以适合屏
  • 如何将模型从 ML Pipeline 保存到 S3 或 HDFS?

    我正在尝试保存 ML Pipeline 生成的数千个模型 正如答案中所示here https stackoverflow com questions 32121046 run 3000 random forest models by gro
  • 什么是“多重”启动模式?

    On http developer android com guide topics manifest activity element html http developer android com guide topics manife
  • SWIG C 函数指针和 JAVA

    我有一些 C 代码 其中一个方法有一个函数指针作为参数 我正在尝试在我的 Android 应用程序中使用 C 代码 我决定使用 SWIG 来完成生成我需要的 java 文件的所有工作 一切都适用于常规函数 没有函数指针作为参数的函数 但我不
  • Android 预安装检测

    我的 Android 应用程序将被预安装 我想继续跟踪预安装的应用程序 为此 我需要以某种方式保存密钥或标志 这意味着该应用程序是预安装的 我会将此密钥添加到后端的每个请求中并对其进行分析 我对此有疑问 有一个问题是关于从 Google P
  • Android studio 问题:找不到广告:AdQuality:未指定

    我已经更新了 Android studio 刚刚打开我的项目 我收到以下错误 您能让我知道如何解决这个问题吗 Error A problem occurred configuring project memoryGameCollection
  • AAR 可以包含传递依赖吗? [复制]

    这个问题在这里已经有答案了 现在我有一个库项目 比如项目 Foo 它依赖于像 OkHttp 这样的库 现在 Foo 有一个 Maven 构建步骤 可以生成 AAR 并将其推送到公共位置 现在假设我有项目 B 我们将其称为 Bar Bar是一
  • 使用基于Optional内容的流

    我从不受我控制的服务获取可能为空的地图 并且想要处理它 比方说 过滤 映射并减少到我需要的单个元素 问题 是否有从Optional到Stream的 链接 我尝试过 除其他外 return Optional ofNullable getMap

随机推荐

  • 比较 C# 和 ColdFusion 之间的密码哈希值 (CFMX_COMPAT)

    我有一个密码哈希值存储在一个表中 并通过以下 Coldfusion 脚本放置在那里 Hash Encrypt Form UserPassword GetSiteVars EnCode 我正在尝试在 C 应用程序中添加一些外部功能 我希望能够
  • 将 php 变量发布到新窗口

    我有一个由数据库动态构建的页面 对于动态构建的每个内容 我希望有一个弹出新窗口的链接 并且该新窗口将根据单击第一页上的哪个项目来填充数据库中的列表 我尝试过 POST 方法并将变量发布到 url 我知道这是危险的 另一个独特之处是 单击的链
  • MATLAB 求最大值一个结构体的

    我试图找到结构的最大值但是max tracks matrix 不起作用 它给我以下错误 使用 horzcat 时出错 CAT 论证维度不一致 你有想法吗 这是我的结构的样子 tracks 1x110470 struct array with
  • Android Edittext光标不可见

    我的应用程序中有一个编辑文本 它将在 Froyo 或 Gingerbread 中正确显示光标 但是在更高版本的 sdks 中 光标是不可见的 我在网上找到的解决方案是设置 android textCursorDrawable null 以便
  • Powershell 中的 CDPATH 功能?

    有没有人实现了等效的行为bash 的 cdpath http www caliban org bash bashtips在 Powershell 中 以前不知道CDPATH 很高兴知道 我为 Powershell 编写了以下内容 funct
  • 以对数刻度显示刻度标签 MS 图表 (log-log)

    我在 Visual Studio 2015 C 中使用 MS Charts 创建了一个具有对数刻度 两个轴 的绘图 见图 我需要在 x 轴上添加更多网格线和相应的标签 我想在 1 2 3 4 和 10 之间以及 10 到 100 20 30
  • 对不受信任(自签名)HTTPS 的 AJAX 调用会默默失败

    我想对使用自签名证书的安全服务器进行 AJAX 调用 在使用我的应用程序的环境中 这很好 我可以向用户提供 CA 证书并让他们在使用应用程序之前安装它 但是 有时 用户会在安装证书之前尝试访问该应用程序 在这些情况下 应用程序会默默地失败
  • 如何将 React 应用程序部署到 Heroku

    我已经使用 React 和 Node js 构建了一个单页天气应用程序 但似乎无法将其部署到 Heroku 到目前为止 我有 在 Heroku 上创建了一个名为 Weather app react node 的新应用程序 在 CLI 上登录
  • 如何在Notepad++中将大写字母转换为小写字母

    我主要使用 Notepad 进行编码 如何将大写字母转换为小写字母 反之亦然 只需选择要更改的文本 右键单击并根据需要选择大写或小写
  • 将 PSD 格式转换为 Gimp 可以读取的格式的方法

    我有一堆 PSD 文件 还有更多 我想将它们转换成我可以使用的格式 我之前曾 一些 成功地使用 Gimp 读取 PSD 但这些文件无法正确读取 有没有办法将 PSD 转换为 XCF 我尝试过 IrfanView 它可以正常显示 PSD 但无
  • 如何在 Python 中将日期时间转换为 UTC 时间戳?

    From http docs python org library time html http docs python org library time html 时间 mktime t 这是 localtime 的反函数 它的论据是 s
  • 使用 numpy.genfromtxt 在 Python 3 中加载 UTF-8 文件

    我有一个从 WHO 网站下载的 CSV 文件 http apps who int gho data view main 52160 http apps who int gho data view main 52160 下载 CSV 格式的多
  • 如何使用 R 编辑或修改或更改大型文本文件中的单行

    我正在使用 R 将一些大型文本文件读入数据库 但它们包含数据库软件的非法字段名称 大型文本文件的列名仅在第一行中 是否可以仅编辑第一行而不循环遍历文件中的每一行 这似乎浪费资源 这是我尝试对一些示例数据执行的操作的两个示例 第一个将所有内容
  • 如何在 Laravel 中使用 SQL Server 连接?

    我有一个用 Laravel 3 制作的工作项目 我必须切换到 MsSQL Server 虽然不是我的电话 嗅探 但我不明白这种数据库类型的 Laravel 配置 我把里面默认的改了database php对此 default gt sqls
  • MPAndroidChart - 向条形图添加标签

    我的应用程序有必要在条形图的每个条形上都有一个标签 有没有办法用 MPAndroidChart 做到这一点 我在项目 wiki javadocs 上找不到执行此操作的方法 如果没有办法做到这一点 是否有其他软件可以让我做到这一点 更新答案
  • 使用四舍五入毫秒从时间戳获取格式化日期 Bash Shell 脚本

    我需要获取特定格式的日期 但不知道该怎么做 这是我目前获取日期的方法 date r timestamp Y m dT H M S s 然而问题是毫秒对于我需要的格式来说有太多数字 我需要将毫秒限制为 3 位数字 知道我该怎么做这样的事情吗
  • 如何使图像表现得像文件输入?

    单击默认照片时 用户应该从计算机中选择一个文件 而不是制作一个文件input type file 这使得用户首先单击浏览按钮而不是选择文件 用户应直接单击默认照片 然后会出现一个文件选择窗口
  • Objective-c:NSString 到枚举

    所以 我有这样的定义 typedef enum red 1 blue 2 white 3 car colors 然后 我有一个 car colors 类型的变量 car colors myCar 问题是 我在 NSString 中收到汽车的
  • 错误类型错误:无法设置未定义的属性“分页器”

    我正在使用表格角度材料创建表格 作为参考 我正在使用这个例子https material angular io components table examples https material angular io components t
  • 如何在 Android 中通过 POST 请求查询 Web 服务?

    我完全陌生网络要素服务 WFS http en wikipedia org wiki Web Feature Service但我想构建一个 Android 应用程序ksoap2 android http code google com p