Web 服务 - SOAP 与“XML over HTTP" [英] Webservices - SOAP vs. "XML over HTTP"

查看:32
本文介绍了Web 服务 - SOAP 与“XML over HTTP"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于网络服务的一般性问题,希望您能帮助我澄清我对这个主题的困惑.

I have a general web services question and I'm hoping you can help me clear up my confusion on the subject.

我正在使用主机调用XML over HTTP 服务"的 Web 服务.他们声称该服务不是 SOAP 服务,但响应是 SOAP 信封响应.该服务当前通过 HTML 表单发布调用;这是 HTML 表单和响应:

I am working with a web service that the host is calling an "XML over HTTP service". They claim that this service is NOT a SOAP service, yet the response is a SOAP envelope response. The service is currently invoked via HTML form post; here is the HTML form and response:

HTML:

<FORM name=TestForm action=http://intranet/TheWSMethod enctype="text/plain" method="POST">
    <TEXTAREA name=Data rows=22 cols=91 type="text" style="position: absolute; left: 78; top: 69; width:752px; height:330px"></TEXTAREA>
    <INPUT type=xml> 
    <INPUT type=submit value="Transmit">
</FORM>

响应 - 基于 SOAP?

RESPONSE - SOAP Based?

<?xml version="1.0" encoding="UTF-8" ?> 
<soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> 
    <faultcode>soap-env:Server</faultcode> 
    <faultstring>9001</faultstring> 
    <faultactor>/TheWSMethod</faultactor> 
    <detail> ... </detail> 
</soapenv:Fault>

主持人告诉我,这个过程没有没有 WSDL,这就是我的困惑开始的地方.

The host tells me that there is no WSDL for this process, which is where my confusion begins.

所以我的问题是,是否存在/应该存在现有的 WSDL?(即他们是在拉我的腿还是他们不明白我在问什么)或者是否可能没有此类服务的 WSDL?

So my question is, whether or not there is/should be an existing WSDL? (i.e. are they pulling my leg or do they not understand what I am asking) or is it possible to not have a WSDL for this type of service?

推荐答案

SOAP 只是 XML over HTTP 的特殊化,您发布的响应确实看起来像 SOAP 响应(a 实际上是SOAP错误).

SOAP is just a specialization of XML over HTTP and that response you posted does indeed look like a SOAP response (a SOAP fault actually).

这看起来是一个很大的误会,所以不要以为他们在拉你的腿.尝试以不同的方式提问.

This looks like a big misunderstanding, so don't assume they are pulling your leg. Try asking your question in a different way.

至于 WSDL,如果这确实是 100% SOAP Web 服务,请注意对于 SOAP Web 服务并不强制要求具有 WSDL.

As for the WSDL, if this is indeed a 100% SOAP web service, do note that it is not mandatory to have a WSDL for a SOAP web service.

Web 服务只是一个通过网络公开一组操作的应用程序.为了调用这些操作,您需要知道它们的名称、它们期望的参数、参数的类型等,以便您知道如何构建您的 客户端存根.

A web service is just an application that exposes a set of operations over the network. In order to call these operations you need to know what their name is, what parameters they expect, what types the parameters have etc, so that you know how to build your client stub.

这意味着需要记录 Web 服务,否则您将不知道如何编写与 Web 服务交互的代码.此文档可以是 Word 文档或 PDF,您可以从中手动构建客户端(这涉及为您的客户端存根编写大量管道代码)文档可以是 WSDL 文件,与 PDF 或 Word 文档不同,可以将其提供给工具以自动为您生成存根管道代码.

This means the web service needs to be documented or else you would not know how to write the code that interact with the web service. This documentation can be a Word document or a PDF and you could build the client manually from that (which involves writing a lot of plumbing code for that client stub of yours) OR the documentation could be a WSDL file which unlike a PDF or Word document can be fed to a tool to generate the stub plumbing code for you automatically.

WSDL 描述了 Web 服务 - 提供一个服务是一种很好的做法 - 但 Web 服务与 WSDL 分开存在.

The WSDL describes the web service - and it's good practice to provide one - but the web service exists separately from the WSDL.

这篇关于Web 服务 - SOAP 与“XML over HTTP"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆