soap

SOAP Webservice和RESTful Webservice

纵饮孤独 提交于 2020-01-02 01:45:06
REST是一种架构风格,其核心是面向资源,REST专门针对网络应用设计和开发方式,以降低开发的复杂性,提高系统的可伸缩性。REST提出设计概念和准则为: 1.网络上的所有事物都可以被抽象为资源(resource) 2.每一个资源都有唯一的资源标识(resource identifier),对资源的操作不会改变这些标识 3.所有的操作都是无状态的 REST简化开发,其架构遵循CRUD原则,该原则告诉我们对于资源(包括网络资源)只需要四种行为:创建,获取,更新和删除就可以完成相关的操作和处理。您可以通过统一资源标识符(Universal Resource Identifier,URI)来识别和定位资源,并且针对这些资源而执行的操作是通过 HTTP 规范定义的。其核心操作只有GET,PUT,POST,DELETE。 由于REST强制所有的操作都必须是stateless的,这就没有上下文的约束,如果做分布式,集群都不需要考虑上下文和会话保持的问题。极大的提高系统的可伸缩性。 对于SOAP Webservice和Restful Webservice的选择问题,首先需要理解就是SOAP偏向于面向活动,有严格的规范和标准,包括安全,事务等各个方面的内容,同时SOAP强调操作方法和操作对象的分离,有WSDL文件规范和XSD文件分别对其定义。而REST强调面向资源

浅谈SOAP Webservice和RESTful Webservice

流过昼夜 提交于 2020-01-02 01:43:53
REST是一种架构风格,其核心是面向资源,REST专门针对网络应用设计和开发方式,以降低开发的复杂性,提高系统的可伸缩性。REST提出设计概念和准则为: 1.网络上的所有事物都可以被抽象为资源(resource) 2.每一个资源都有唯一的资源标识(resource identifier),对资源的操作不会改变这些标识 3.所有的操作都是无状态的 REST简化开发,其架构遵循CRUD原则,该原则告诉我们对于资源(包括网络资源)只需要四种行为:创建,获取,更新和删除就可以完成相关的操作和处理。您可以通过统一资源标识符(Universal Resource Identifier,URI)来识别和定位资源,并且针对这些资源而执行的操作是通过 HTTP 规范定义的。其核心操作只有GET,PUT,POST,DELETE。 由于REST强制所有的操作都必须是stateless的,这就没有上下文的约束,如果做分布式,集群都不需要考虑上下文和会话保持的问题。极大的提高系统的可伸缩性。 对于SOAP Webservice和Restful Webservice的选择问题,首先需要理解就是SOAP偏向于面向活动,有严格的规范和标准,包括安全,事务等各个方面的内容,同时SOAP强调操作方法和操作对象的分离,有WSDL文件规范和XSD文件分别对其定义。而REST强调面向资源

SOAP与restful webservice

南楼画角 提交于 2020-01-02 01:42:47
SOAP   什么是SOAP,我想不用多说,google一把满眼都是。其实SOAP最早是针对RPC的一种解决方案,简单对象访问协议,很轻量,同时作为应用协议可以基于多种传输协议来传递消息(Http,SMTP等)。但是随着SOAP作为WebService的广泛应用,不断地增加附加的内容,使得现在开发人员觉得SOAP很重,使用门槛很高。在SOAP后续的发展过程中,WS-*一系列协议的制定,增加了SOAP的成熟度,也给SOAP增加了负担。   REST   REST其实并不是什么协议也不是什么标准,而是将Http协议的设计初衷作了诠释,在Http协议被广泛利用的今天,越来越多的是将其作为传输协议,而非原先设计者所考虑的应用协议。SOAP类型的WebService就是最好的例子,SOAP消息完全就是将Http协议作为消息承载,以至于对于Http协议中的各种参数(例如编码,错误码等)都置之不顾。其实,最轻量级的应用协议就是Http协议。Http协议所抽象的get,post,put,delete就好比数据库中最基本的增删改查,而互联网上的各种资源就好比数据库中的记录,对于各种资源的操作最后总是能抽象成为这四种基本操作,在定义了定位资源的规则以后,对于资源的操作通过标准的Http协议就可以实现,开发者也会受益于这种轻量级的协议。   REST专门针对网络应用设计和开发方式,以降低开发的复杂性

Python SOAP client, WSDL call with suds gives Transport Error 401 Unauthorized for HTTP basic authentication

痴心易碎 提交于 2020-01-02 01:25:09
问题 Background I'm building a SOAP client with python 2.7.3 and using the suds 0.4.1 library provided by Canonical. The server is using basic authentication over HTTPS. Problem Can't pass authentication on the server, even to get at the WSDL. I get the following error: suds.transport.TransportError: HTTP Error 401: Unauthorized Attempts at resolution and code I have tried both of the authentication methods described in the suds documentation, but still get the error above at the client = Client

How to deserialize a WCF soap response message from a file with DataContractSerializer?

谁说我不能喝 提交于 2020-01-02 01:10:13
问题 When I call a web service operation, WCF deserializes the message to the proxy class with the DataContractSerializer: why couldn't I do the same ? Here is the soap message in the file ActLoginResponse.xml: <SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:PlotiIntf" xmlns:ns2="urn:PlotiIntf-IPloti" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema

RESTful vs SOAP based webservices?

感情迁移 提交于 2020-01-01 19:37:08
问题 Folks I recently went thru webservices book which covered SOAP based webservices and RESTful webservices. I am not sure on what parameters I should select one of them as both of them looks similar(even from developer perspective). Here are my points In SOAP webservices we use WSDL file generated out of webservices and then create client side stubs based on that. My understanding is that internally stub also will use HTTP protocol to communicate with remote java webservice. Right? Here there

SoapFault exception: [HTTP] Bad Request In eway

南楼画角 提交于 2020-01-01 14:23:49
问题 I am going to integrate the eway token payment integration and i am facing this problem. SoapFault exception: [HTTP] Bad Request the wsdl file is here https://www.eway.com.au/gateway/ManagedPaymentService/managedCreditCardPayment.asmx?wsdl and the xml format is here https://www.eway.com.au/gateway/ManagedPaymentService/test/managedcreditcardpayment.asmx?op=CreateCustomer and i get the xml file with $client->__getLastRequest(); script is <?xml version="1.0" encoding="UTF-8"?> <env:Envelope

How to mock SoapException using Moq to unit test error handling

末鹿安然 提交于 2020-01-01 12:02:23
问题 I've inherited a small console application that makes calls to a SOAP web service. It's a tragic mess of nested try-catches that log exceptions in various ways, and I'd like to wrap some test coverage around how it behaves when a SoapException gets thrown. Question: How can I mock a class like SoapException using Moq when I can't mock an interface and I can't make properties or methods "virtual"? A little more explanation: To test this error handling, I need to control the Actor property of

spring-boot-starter-ws performance when run as jar

走远了吗. 提交于 2020-01-01 11:37:25
问题 We've noticed in our that SOAP web-services seem to run faster when run as spring-boot:run as opposed to packaging up the JAR as we do for deployment and running java -jar mySpringApp.jar The speed up is in the order of 2-3x so obviously we would like this for our live environment. To validate that this wasn't something in our app I've tried this with the sample app from the spring guide git source https://github.com/spring-guides/gs-soap-service.git Testing this with JMeter shows the same

change the soap:address location in generated wsdl

主宰稳场 提交于 2020-01-01 10:58:27
问题 I am using JAX-WS annotation to create soap services running on JBOss 5.1.0 G.A, the generates WSDL has got the following bit at the end - <service name="DataServiceService"> <port binding="tns:DataServiceBinding" name="DataServicePort"> <soap:address location="http://mymachine:8080/myapp/webservice" /> </port> </service> I have made the service https enabled on port 8443, I am able to connect to the service using the right protocol and port number but is there is a way to change the soap