SOAP教程[转]

2023-10-31

SOAP教程 需要帮助?

SOAP是一个简单的基于XML的协议,它让应用程序跨HTTP进行信息交换。
在我们的SOAP教程,你将了解什么是SOAP,以及它是怎样利用XML来让程序间的信息进行交换的

内容目录

SOAP 介绍
This chapter explains what SOAP is and why SOAP is useful.
介绍了什么是SOAP以及它的用处

SOAP 语法
This chapter describes the building blocks of SOAP and SOAP syntax rules.
这章介绍了如何建立SOAP块结构和SOAP的语法规则

SOAP Envelope
This chapter describes the SOAP Envelope element.
SOAP的封套元素

SOAP Header
This chapter describes the SOAP Header element.
这章介绍了SOAP的Header[报头]元素

SOAP Body
This chapter describes the SOAP Body element.
这章介绍了SOAP的Body元素

SOAP Fault
This chapter describes the SOAP Fault element.
这章介绍了SOAP的默认元素

SOAP HTTP Binding
This chapter is an introduction to the SOAP HTTP binding.
介绍有关SOAP HTTP 绑定

SOAP 举例
This chapter describes a SOAP example.
一个SOAP的举例

SOAP 摘要


SOAP 介绍
w3pop.com / 2006-09-19

SOAP is a simple XML based protocol to let applications exchange information over HTTP.
SOAP是一个简单的基于XML的协议,它让应用程序跨HTTP进行信息交换。

Or more simply: SOAP is a protocol for accessing a Web Service.
或者更简单的:SOAP是用于访问网络服务的协议。


What You Should Already Know
你应该已经了解的:

Before you study SOAP you should have a basic understanding of XML and XML Namespaces.
在你学习SOAP 之前,你应该能基本理解以下XML和XML命名空间。

If you want to study these subjects first, please read our XML Tutorial.
如果你想继续看下去,请先访问XML 教程.


What is SOAP?
什么是SOAP?

  • SOAP stands for Simple Object Access Protocol
    SOAP代表Simple Object Access Protocol(简单对象访问协议)
  • SOAP is a communication protocol
     SOAP是通讯协议
  • SOAP is for communication between applications
    SOAP用于应用程序之间的通讯
  • SOAP is a format for sending messages
    SOAP是一种信息发送的格式
  • SOAP is designed to communicate via Internet
    SOAP是通过因特网来通讯的
  • SOAP is platform independent
    SOAP是独立的平台
  • SOAP is language independent
    SOAP是独立的语言
  • SOAP is based on XML
    SOAP是建立在XML基础之上的
  • SOAP is simple and extensible
    SOAP是简单并可以扩展的
  • SOAP allows you to get around firewalls
    SOAP允许透过防火墙传播
  • SOAP will be developed as a W3C standard
    SOAP会以W3C标准为标准而发展起来。

Why SOAP?
为什么使用SOAP?

It is important for application development to allow Internet communication between programs.
对应用程序而言,允许程序之间的因特网通讯是非常重要的。

Today's applications communicate using Remote Procedure Calls (RPC) between objects like DCOM and CORBA, but HTTP was not designed for this. RPC represents a compatibility and security problem; firewalls and proxy servers will normally block this kind of traffic.
如今的应用软件都是通过对象之间的RPC(远程过程调用,如:DCOM和CORBA)来实现通讯的,但是HTTP却不是这样的。RPC表现为兼容性和安全问题。一般情况下,防火墙和代理服务器会阻塞流量。

A better way to communicate between applications is over HTTP, because HTTP is supported by all Internet browsers and servers. SOAP was created to accomplish this.
因为所有的因特网浏览器都支持HTTP,所以在应用程序之间进行通讯还有一个更好的办法,就是跨HTTP。SOAP就是基于这个理论而被创建出来的。

SOAP provides a way to communicate between applications running on different operating systems, with different technologies and programming languages.
SOAP提供了一条途径使在不同操作系统上运行的应用程序间实现通讯(通过不同技术和程序设计语言)。


Microsoft and SOAP
微软和SOAP

SOAP is a key element of Microsoft's .NET architecture for future Internet application development.
在未来因特网应用程序发展进程中,SOAP是微软.NET体系结构的主要元素。


SOAP 1.1 was Proposed to W3C
向W3C提议SOAP1.1

UserLand, Ariba, Commerce One, Compaq, Developmentor, HP, IBM, IONA, Lotus, Microsoft, and SAP proposed to W3C, in May 2000, the SOAP Internet protocol that they hope will revolutionize application development by connecting graphic user interface desktop applications to powerful Internet servers using the standards of the Internet: HTTP and XML.
在2000年5月,UserLand, Ariba, Commerce One, Compaq, Developmentor, HP, IBM, IONA, Lotus, Microsoft和 SAP对W3C做出提议:他们所设想的SOAP英特网协议将通过使用HTTP以及XML两个网络标准把图形用户界面桌面应用程序(graphic user interface desktop applications)连接到强大的英特网服务中。


W3C is Working on SOAP 1.2
W3C将在SOAP 1.2上运行

The first public Working Draft on SOAP was published from W3C in December 2001. To read more about the SOAP activities at W3C please visit our W3C tutorial.
2001年12月,SOAP上的第一份公共工作草案将在W3C上公布。如想了解更多SOAP在W3C上的活动,请访问W3C 教程。

SOAP 语法
w3pop.com / 2006-09-21

SOAP Building Blocks
SOAP组件群

A SOAP message is an ordinary XML document containing the following elements:
Soap信息是包含以下元素的普通XML文件。

  • A required Envelope element that identifies the XML document as a SOAP message
    必需的把XML文件定义为SOAP信息的封套(Envelope)元素
  • An optional Header element that contains header information
    包含标题信息的可选标题(header)元素
  • A required Body element that contains call and response information
    包含请求与响应信息的必要主体元素
  • An optional Fault element that provides information about errors that occurred while processing the message
    处理信息时,提供关于产生错误信息的可选择的错误元素

All the elements above are declared in the default namespace for the SOAP envelope:
上面所有元素都在SOAP 封套(envelope)的错误命名空间中被声明

http://www.w3.org/2001/12/soap-envelope

and the default namespace for SOAP encoding and data types is:
SOAP编码和数据类型的的错误命名空间是:

http://www.w3.org/2001/12/soap-encoding

Syntax Rules
语法规则

Here are some important syntax rules:
下面是一些重要的语法规则:

  • A SOAP message MUST be encoded using XML
    SOAP信息必须通过XML进行编码
  • A SOAP message MUST use the SOAP Envelope namespace
    SOAP信息必须使用SOAP 封套(Envelope)命名空间(namespace)
  • A SOAP message MUST use the SOAP Encoding namespace
    SOAP 信息必须使用SOAP编码命名空间
  • A SOAP message must NOT contain a DTD reference
    SOAP信息决不能包含DTD参数
  • A SOAP message must NOT contain XML Processing Instructions
    SOAP信息决不能包含XML处理指令

Skeleton SOAP Message
SOAP纲要(Skeleton)信息

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header>
...
...
</soap:Header>
<soap:Body>
...
...
<soap:Fault>
...
...
</soap:Fault>
</soap:Body>
</soap:Envelope>

SOAP 封套
w3pop.com / 2006-09-21

The mandatory SOAP Envelope element is the root element of a SOAP message.
具有强制性的SOAP封套(Envelope)元素是SOAP信息的根元素。


The SOAP Envelope Element
SOAP封套元素

The required SOAP Envelope element is the root element of a SOAP message. It defines the XML document as a SOAP message.
必要的SOAP封套元素是SOAP元素的根元素。它把XML文件定义为SOAP信息。

Note the use of the xmlns:soap namespace. It should always have the value of:
注意xmlns:soap命名空间(namespace)的使用。它一般含有以下值:

http://www.w3.org/2001/12/soap-envelope

and it defines the Envelope as a SOAP Envelope:
它以SOAP 封套(Envelope)的形式定义了封套(Envelope)。

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
...
Message information goes here
...
</soap:Envelope>


The xmlns:soap Namespace
xmlns:soap命名空间

A SOAP message must always have an Envelope element associated with the "http://www.w3.org/2001/12/soap-envelope" namespace.
SOAP信息必须含有与"http://www.w3.org/2001/12/soap-envelope" 命名空间相关的Envelope元素。

If a different namespace is used, the application must generate an error and discard the message.
如果使用了不同的命名空间,那应用程序肯定会产生一个错误信息并忽略信息。


The encodingStyle Attribute
encodingStyle属性

The SOAP encodingStyle attribute is used to define the data types used in the document. This attribute may appear on any SOAP element, and it will apply to that element's contents and all child elements. A SOAP message has no default encoding.
SOAPencodingStyle属性的作用:定义用于文档中的数据类型。属性可能会在任何SOAP元素中出现,并且会应用于元素的内容及其所有子元素上。SOAP信息没有默认编码。

Syntax
语法
soap:encodingStyle="URI"
Example
实例
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"

soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
...
Message information goes here
...
</soap:Envelope>

SOAP Header
w3pop.com / 2006-09-21

The optional SOAP Header element contains header information.
可选择的SOAP标题元素包含了标题信息。


The SOAP Header Element
SOAP标题元素

The optional SOAP Header element contains application specific information (like authentication, payment, etc) about the SOAP message. If the Header element is present, it must be the first child element of the Envelope element.
可选择的SOAP标题元素包含了关于SOAP信息的应用程序的详细信息(如:验证(authentication)、返还值(payment)等)。如果标题元素是存在的,那它必须是Envelope元素的第一个子元素。

Note: All immediate child elements of the Header element must be namespace-qualified.
注意:标题(Header)元素的所有紧接着的子元素必须是有命名空间资格(namespace-qualified)的。

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"

soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header>
<m:Trans
xmlns:m="http://www.w3schools.com/transaction/"
soap:mustUnderstand="1">234</m:Trans>
</soap:Header>
...
...
</soap:Envelope>

The example above contains a header with a "Trans" element, a "mustUnderstand" attribute value of "1", and a value of 234.
上面的例子包含了含有"Trans"元素的标题,属性值为1的"mustUnderstand"以及一个234值。

SOAP defines three attributes in the default namespace ("http://www.w3.org/2001/12/soap-envelope"). These attributes are: actor, mustUnderstand, and encodingStyle. The attributes defined in the SOAP Header defines how a recipient should process the SOAP message.
SOAP定义了3个默认空间("http://www.w3.org/2001/12/soap-envelope")的属性。这些属性是:actor, mustUnderstand,和 encodingStyle。定义在SOAP中的这些属性定义了容器如何处理SOAP信息。


The actor Attribute
行为(actor)属性

A SOAP message may travel from a sender to a receiver by passing different endpoints along the message path. Not all parts of the SOAP message may be intended for the ultimate endpoint of the SOAP message but, instead, may be intended for one or more of the endpoints on the message path.
SOAP信息会通过不同的端点沿着信息路径从发送人传到接收者。不是所有SOAP部分都会用于SOAP信息的最终端点,但是,作为交换,在信息路径中它们可能用于一个或更多端点。

The SOAP actor attribute may be used to address the Header element to a particular endpoint.
SOAP行为属性可能用于特定端点的标题元素寻址。

Syntax
语法
soap:actor="URI"
Example
实例
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"

soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header>
<m:Trans
xmlns:m="http://www.w3schools.com/transaction/"
soap:actor="http://www.w3schools.com/appml/">
234
</m:Trans>
</soap:Header>
...
...
</soap:Envelope>


The mustUnderstand Attribute
mustUnderstand属性

The SOAP mustUnderstand attribute can be used to indicate whether a header entry is mandatory or optional for the recipient to process.
Soap mustUnderstand属性可以用来指明标题入口(header entry)对于接受者信息处理是强制的还是可选的。

If you add "mustUnderstand="1" to a child element of the Header element it indicates that the receiver processing the Header must recognize the element. If the receiver does not recognize the element it must fail when processing the Header.
如果你把"mustUnderstand="1"添加到一个子标题元素的元素上去的话,那就意味着接受者处理标题(Header)元素时,这个(标题)元素必须是可识别的;如果接收器无法识别该元素,那么处理标题元素时将会失败。

Syntax
语法
soap:mustUnderstand="0|1"
Example
实例
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header>
<m:Trans
xmlns:m="http://www.w3schools.com/transaction/"
soap:mustUnderstand="1">
234
</m:Trans>
</soap:Header>
...
...
</soap:Envelope>


The encodingStyle Attribute
encodingStyle属性

The SOAP encodingStyle attribute is explained in the previous chapter.
SOAP encodingStyle属性在前一章中已得以阐述。

SOAP Body
w3pop.com / 2006-09-21

The mandatory SOAP Body element contains the actual SOAP message.
具有强制性的SOAP主体元素包含了现行的SOAP信息。


The SOAP Body Element
Soap主体元素

The required SOAP Body element contains the actual SOAP message intended for the ultimate endpoint of the message.
所要求的SOAP主体元素包含了用于信息终端的现行SOAP信息。

Immediate child elements of the SOAP Body element may be namespace-qualified. SOAP defines one element inside the Body element in the default namespace ("http://www.w3.org/2001/12/soap-envelope"). This is the SOAP Fault element, which is used to indicate error messages.
直接的SOAP主体元素的子元素可能是有资格获得命名空间(name-space)的。SOAP以默认的命名空间定义了("http://www.w3.org/2001/12/soap-envelope")主体元素内的一个元素。这是SOAP用来显示错误信息的“错误元素”。

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body>
   <m:GetPrice xmlns:m="http://www.w3schools.com/prices">
      <m:Item>Apples</m:Item>
   </m:GetPrice>
</soap:Body>
</soap:Envelope>

The example above requests the price of apples. Note that the m:GetPrice and the Item elements above are application-specific elements. They are not a part of the SOAP standard.
上面举的是请求苹果价格的例子。注意,上面的m:GetPrice和项目元素都是详细的应用程序(application-specific)元素。它们不是SOAP标准的一部分。

A SOAP response could look something like this:
SOAP响应如下:

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"

soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body>
   <m:GetPriceResponse xmlns:m="http://www.w3schools.com/prices">
      <m:Price>1.90</m:Price>
   </m:GetPriceResponse>

</soap:Body>
</soap:Envelope>

SOAP Fault
w3pop.com / 2006-09-21

The optional SOAP Fault element is used to hold error and status information for a SOAP message.
可选择的SOAP错误元素的作用是:保存SOAP信息中的错误信息和状态信息。


The SOAP Fault Element
SOAP错误信息

An error message from a SOAP message is carried inside a Fault element.
SOAP信息中包含的错误信息位于“错误元素”中。

If a Fault element is present, it must appear as a child element of the Body element. A Fault element can only appear once in a SOAP message.
如果错误元素是存在的,那它肯定以主体元素的子元素形式出现。错误元素只能在SOAP元素中出现一次。

The SOAP Fault element has the following sub elements:
SOAP错误元素含有以下子元素:

Sub Element
子元素
Description
描述
<faultcode> A code for identifying the fault
鉴别错误信息的代码
<faultstring> A human readable explanation of the fault
将错误信息解释为可以被人们读懂的信息
<faultactor> Information about who caused the fault to happen
引发错误产生的信息
<detail>

Holds application specific error information related to the Body element
解释了与主体元素相关的应用程序中详细的错误信息

SOAP Fault Codes
SOAP错误代码

The faultcode values defined below must be used in the faultcode element when describing faults:
以下定义的错误代码值必须是用于错误代码元素(描述错误时):

Error
错误
Description
描述
VersionMismatch Found an invalid namespace for the SOAP Envelope element
为SOAP包络(Envelope)元素找出一个无效的命名空间
MustUnderstand An immediate child element of the Header element, with the mustUnderstand attribute set to "1", was not understood
如果Header 元素中的直接子元素的“mustUnderstand” 设置为1,那表示这个子元素不可识别。
Client The message was incorrectly formed or contained incorrect information
信息格式错误或包含了错误信息
Server There was a problem with the server so the message could not proceed
由于服务器的错误而导致信息不能被处理

SOAP HTTP Binding
w3pop.com / 2006-09-21

The HTTP Protocol

HTTP communicates over TCP/IP. An HTTP client connects to an HTTP server using TCP. After establishing a connection, the client can send an HTTP request message to the server:
HTTP是通过TCP/IP进行通讯的。 HTTP客户端通过TCP协议连接到HTTP服务器。在建立连接之后,客户端就可以向服务器发送HTTP请求信息了。

POST /item HTTP/1.1
Host: 189.123.345.239
Content-Type: text/plain
Content-Length: 200

The server then processes the request and sends an HTTP response back to the client. The response contains a status code that indicates the status of the request:
服务器会处理请求并通过HTTP来响应客户端。响应包含有指明请求者状态的状态代码。

200 OK
Content-Type: text/plain
Content-Length: 200

In the example above, the server returned a status code of 200. This is the standard success code for HTTP.
在下面这个例子中,服务器会返回一个200的状态代码。这是HTTP的标准成功代码。

If the server could not decode the request, it could have returned something like this:
如果服务器不能破解请求代码,那它就会如下返回:

400 Bad Request
Content-Length: 0


SOAP HTTP Binding
SOAP HTTP捆绑

A SOAP method is an HTTP request/response that complies with the SOAP encoding rules.
SOAP方式是一个遵照SOAP编码规则的HTTP请求/响应。

HTTP + XML = SOAP

A SOAP request could be an HTTP POST or an HTTP GET request.
SOAP请求是HTTP POST 或 HTTP GET请求。

The HTTP POST request specifies at least two HTTP headers: Content-Type and Content-Length.
HTTP POST请求详细说明了最少2个HTTP标题(HTTP header) :Content-Type (内容类型)和 Content-Length.(内容长度)


Content-Type
内容类型

The Content-Type header for a SOAP request and response defines the MIME type for the message and the character encoding (optional) used for the XML body of the request or response.
SOAP请求和响应的内容长度标题定义了用于请求或响应的XML主要部分的信息和字符编码(可选择的)的MIME类型 。

Syntax
语法
Content-Type: MIMEType; charset=character-encoding
Example
实例
POST /item HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8


Content-Length
内容长度

The Content-Length header for a SOAP request and response specifies the number of bytes in the body of the request or response.
SOAP请求和响应的内容长度标题详细说明了请求和响应的主体部分的字节数。

Syntax
语法
Content-Length: bytes
Example
实例
POST /item HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 250

SOAP 实例
w3pop.com / 2006-09-21

A SOAP Example
Soap实例

In the example below, a GetStockPrice request is sent to a server. The request has a StockName parameter, and a Price parameter will be returned in the response. The namespace for the function is defined in "http://www.example.org/stock" address.
在下面的实例中会发送GetStockPrice请求给服务器。请求中包含一个StockName参数,价格参数会在响应中返回。函数的命名空间(namespace)在http://www.example.org/stock中有详细说明。

The SOAP request:
SOAP请求:

POST /InStock HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
  <soap:Body xmlns:m="http://www.example.org/stock">
   <m:GetStockPrice>
<m:StockName>IBM</m:StockName>
    </m:GetStockPrice>
</soap:Body>
</soap:Envelope>

A SOAP response:
SOAP响应:

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn
<?xml version="1.0"?>

<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
  <soap:Body xmlns:m="http://www.example.org/stock">
<m:GetStockPriceResponse>
<m:Price>34.5</m:Price>

</m:GetStockPriceResponse>
</soap:Body>
</soap:Envelope>

SOAP 摘要
w3pop.com / 2006-09-21

SOAP Summary
SOAP 概要

This tutorial has taught you how to use SOAP to exchange information between applications over HTTP.
此教程说明的是如何通过SOAP在跨HTTP的应用程序之间进行信息转换。

You have learned about the different elements and attributes in a SOAP message.
你已经在一条SOAP信息中了解了在SOAP信息中的不同元素与属性。

You have also learned how use SOAP as a protocol for accessing a web service.
你也了解了如何把SOAP当作一份访问网络服务的协议来使用。


Now You Know SOAP, What's Next?
你已经了解了SOAP,那接下来就要了解:

The next step is to learn about WSDL and Web Services.
下一步你需要学习WSDL和网络服务内容:

WSDL

WSDL is an XML-based language for describing Web services and how to access them.
WSDL是以一种基于XML的语言。它是用于描述网络服务和如何对他们进行访问的一种语言。

WSDL describes a web service, along with the message format and protocol details for the web service.
WSDL是根据网络服务的信息格式以及协议细节对一个网络服务进行描述的。

If you want to learn more about WSDL, please visit our WSDL tutorial.
如想了解更多,请访问WSDL 教程.

Web Services

Web services can convert your applications into web-applications.
网络服务可以把应用程序转换成网络应用程序。

By using XML,  messages can be sent between applications.
通过XML ,信息可以在应用程序之间互发。

If you want to learn more about web services, please visit our Web Services tutorial.
如想了解更多,请访问Web Services 教程.

转载于:https://www.cnblogs.com/caoxch/archive/2006/11/17/563706.html

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

SOAP教程[转] 的相关文章

  • 网络请求及协议

    TCP IP 协议 图解HTTP常见问题 归类 目录
  • 《clickhouse原理解析与应用实践》读书笔记

    福利置顶 温馨提示 电子版可在微信读书app阅读 第一章 ClickHouse的前世今生 传统BI的局限性 数据仓库 为了解决数据孤岛的问题 即通过引入一个专门用于分析类场景的数据库 将分散的数据统一汇聚到一处 数据仓库的衍生概念 对数据进
  • Docker网络学习

    文章目录 Docker容器网络 1 Docker为什么需要网络管理 2 Docker网络简介 3 常见的网络类型 4 docker 网络管理命令 5 两种网络加入差异 6 网络讲解 docker Bridge 网络 docker Host

随机推荐

  • 腾讯云私有云平台运维面试

    文章目录 概述 JD 岗位描述 一面 二面 三面 HR面 概述 根据会议将面试问题进行总结 很多问题感觉当时没回答好 这是为啥呢 应该还是不熟练吧 或者不善于表达 将次经历分享出来 大家多练练 JD 岗位描述 私有云平台运维 JD 腾讯云智
  • ThreadLocal,看我就够了!

    ThreadLocal 开胃菜 研究过Handler的应该对ThreadLocal比较眼熟的 线程中的Handler对象就是通过ThreadLocal来存放的 初识ThreadLocal的可能被它的名字有所误导 ThreadLocal初一看
  • 将Android项目作为module导入到主项目中

    导入module流程 1 主项目中import需要导入项目的app模块 2 修改该module中build gradle里的com android application为com android library 3 删除该module的ap
  • 【Java】JDBC操作Oracle数据库

    1 Statement 用于执行静态 SQL 语句并返回它所生成结果的对象 statement每次执行sql语句 相关数据库都要执行sql语句的编译 import java sql Connection import java sql Dr
  • 前端例程20220802:玻璃背光按钮

    演示 原理 使用元素包裹按钮 按钮设置为玻璃质感 设置光标悬停动画 使用元素的before和after两个元素作为背景灯光 设置光标悬停动画 代码
  • cmd for命令

    for命令式批处理命令中最复杂也是功能最为强大的一个命令 它可以对一组不同的文件或数据进行循环处理 FOR variable variable IN set DO command command parameters variable 指定
  • pytorch语义分割-全卷积网络

    文章目录 1 语义分割和实例分割 2 语义分割的数据集处理 3 转置卷积 4 全卷积神经网络 FCN 1 语义分割和实例分割 2 语义分割的数据集处理 最重要的语义分割数据集之一是Pascal VOC2012 matplotlib inli
  • linux 可能从硬盘安装吗,从硬盘安装linux(radHat)

    1 gt 从网上下载redhat iso安装文件 并放在同一文件夹中 2 gt 用WinISO解开第一张盘的 iso文件 如解到cd1文件加中 不用全部解出 只要dosutils子文件夹就可以了 3 gt 进入MS DOS打开cd1文件夹的
  • 使用可视化库matplotlib绘图时,plt.show()过后只出现Figure size 640x480 with 1 Axes而没有生成图片

    使用可视化库matplotlib绘图时 plt show 过后只出现
  • Tomcat源码:Acceptor与Poller、PollerEvent

    参考资料 Tomcat源码解析系列 十一 ProtocolHandler Tomcat源码解析系列 十二 NioEndpoint 前文 Tomcat源码 启动类Bootstrap与Catalina的加载 Tomcat源码 容器的生命周期管理
  • 联想计算机连接不上蓝牙耳机,thinkpad如何连接蓝牙耳机_thinkpad连接蓝牙耳机的步骤...

    现在的电脑一般都配备有蓝牙功能 可以方便用户们使用一些蓝牙设备 例如最近就有小伙伴问小编thinkpad如何连接蓝牙耳机 那么针对这一问题 今天小编就来为大家整理分享关于thinkpad连接蓝牙耳机的步骤 一起往下看吧 具体步骤如下 1 先
  • VB封装DLL并调用

    首先明确DLL函数是什么 DLL 动态链接库 Dynamic Link Library 一个DLL文件里面可以包含多个函数 其实就是实现共享函数的一种方式 一个应用程序可能需要多个DLL联合起来才可以正常使用 一 新建ActiveX Dll
  • SpringCloud PK K8s 谁更胜一筹

    SpringCloud PK K8s 谁更胜一筹 Spring Cloud 和 Kubernetes 都声称自己是开发和运行微服务的最佳环境 但它们在本质上有很大的不同 解决的问题也不同 在本文中 我们将看看每个平台是如何交付基于微服务架构
  • 在Eclipse中进行Junit测试的个人总结

    1 怎样在Eclipse中集成使用Junit 想要在Eclipse这个IDE中集成使用Junit 首先需要下载Junit的包 具体下载方式可以自行查阅或翻看我之前有关Junit的博客的前半部分 下载完成后 进入Eclipse 打开工程 左键
  • 转帖:如何注册Filter

    参考文章 http apps hi baidu com share detail 16291532 AX文件的一个对外接口DllRegisterServer 由外部调用 比如注册AX的时候 regsvr32 xxx ax 通常情况下 我们的
  • Web3和 NFT将如何影响电子商务?

    每日更新 欢迎交流 感兴趣可以点个关注 你有没有发现 万维网上有很多改变 并且改变速度还很快 也许你已经读到过青少年将数字资产卖到数百万美元 匿名的加密货币创始人颠覆了传统的金钱概念 那么 这些新的 令人兴奋的 而且通常是奇怪的东西到底是关
  • F#的尾递归编译优化需要再好好优化优化

    先来看一道简单的算法题 给定一个整数序列 给定一个目标值 求出该序列中任意三个数之和中最接近目标值的那个数 这道题很容易想到的算法 对序列做从小到大排序 固定其中一个数的下标a 对剩下的两个数双指针b c 指向a右侧区域 窗口 的两端 根据
  • 连Hibernate技术都不清楚,你敢说你自己会ORM框架?

    前言 ORM框架不是一个新话题 它已经伴随我们很多年了 它提供了概念性的 易于理解的数据模型 将数据库中的表和内存中的对象建立了很好的映射关系 在Java中常用的ORM框架主要有两个 Hibernate和iBatis 本篇文章主要介绍Hib
  • SpringBoot 2.6.3 web(静态资源、欢迎页、favicon.ico)

    一 静态资源 静态资源访问路径 static or public or resources or META INF resources 访问方式 项目根路径 静态资源文件名 静态映射 请求进来先在controller中判断能 不能处理 不能
  • SOAP教程[转]

    SOAP教程 需要帮助 SOAP是一个简单的基于XML的协议 它让应用程序跨HTTP进行信息交换 在我们的SOAP教程 你将了解什么是SOAP 以及它是怎样利用XML来让程序间的信息进行交换的 内容目录 SOAP 介绍This chapte