- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Python 3 中有一个带有 pysimplesoap 的 SOAP 服务器。
代码
from wsgiref.simple_server import make_server
application = WSGISOAPHandler(dispatcher)
wsgid = make_server('', 8008, application)
wsgid.serve_forever()
我不知道为什么会出现以下错误。
Traceback (most recent call last):
File "/usr/lib/python3.4/wsgiref/handlers.py", line 138, in run
self.finish_response()
File "/usr/lib/python3.4/wsgiref/handlers.py", line 180, in finish_response
self.write(data)
File "/usr/lib/python3.4/wsgiref/handlers.py", line 266, in write
"write() argument must be a bytes instance"
AssertionError: write() argument must be a bytes instance
最佳答案
这都是因为 WSGI 是为 Python 2 制作的,所以你在 Python 3 中使用它可能会遇到一些麻烦。如果你不想像第一个答案那样改变库的行为,解决方法是 encode()
所有文本数据,如:
def application(environ,start_response):
response_body = 'Hello World'
return [response_body.encode()]
关于python-3.x - "AssertionError: write() argument must be a bytes instance"运行 WSGI SOAPHandler 时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35886782/
我正在使用 SOAPHandler.handleMessage(...) 拦截从客户端到服务器的传出 SOAP 消息。 我需要确认拦截是在消息发送后发生的。不确定情况是否属实。有什么想法吗? 最佳答案
当 SOAPHandler 的 handleFault(SOAPMessageContext context) 方法被调用时,任何人都可以解释一下吗? 我的处理程序类是: public class W
我正在尝试设置一个 SOAPHandler在我的服务器上转换此传入请求 92623-15853588 对这个要求。
我尝试使用 SOAPHandler 更改 SOAP 消息的正文(请求的一部分的命名空间URI),但这似乎不起作用。更改的原因是,我必须与不同的客户端一起工作,并且有一个旧的客户端无法更改,因此我想更改
我正在编写一个 Java SOAP 客户端,其中多个响应异步返回到客户端 WebService。由于响应是异步的,客户端必须将 MessageId 传递到 SOAPHeader 中。然后,多个响应将传
我正在尝试用 java 创建一个 Soap 客户端,我必须使用我的私钥对 Soap 消息进行签名。 我正在使用配置了 WS-Security 的 SoapUI 获取响应。 我已经使用 wsimport
我在使用 Websphere7 和 RSA 7.5 中的注释来实现 JAX-WS 服务时遇到问题。请查看此链接,解释我遇到的确切问题: Exception java.util.zip.ZipFile.
我有一个也使用 SOAP WS(在 doGet 中)的 servlet。我想查看 SOAP 信封(或 soap 消息中的任何其他内容)。我将此代码添加到我的 servlet 类中: class Cli
我的 JAX-WS war 包含以下条目。 WEB-INF/lib/ WEB-INF/beans.xml // empty WEB-INF/lib/commons-logging-1.1.1.jar
使用 JAX-WS 2,我看到了其他人也提到过的一个问题。问题是,如果在处理程序中接收到 SOAP 消息,并且该 SOAP 消息很大——无论是由于碰巧有大量内容的内联 SOAP 正文元素,还是由于 M
IBM WebSphere Jax-WS RI 框架。我有一个 chunkHandler。我需要向客户端发送一行 xml 响应。我制作oneline xml。调试显示一切正常 - xml 是单行的。但
我只想在 handler-chain.xml 中调用的 handleMessage() 方法中使用 spring bean。 这是我的 handler-chain.xml:
我尝试使用 Mtom 传输文件,它工作得很好,直到我使用 SoapHandler 验证客户端签名。 SoapHandler 保留所有消息并将其更改为 base64 编码。因此,当我尝试获取大文件时,J
我需要在运行时根据soap header 的内容动态地将EntityManager分配给我的bean。我的计划是使用 SOAPHandler 从 header 中提取信息,然后将其存储在请求范围中。我
我有一个 SOAPHandler。我需要捕获响应的请求 public class SOAPLoggingHandler implements SOAPHandler { @Override
我在客户端创建了一个 SOAPHandler 来记录对服务器的传出请求并在 SOAP 消息中添加了一个 SOAP header 。它正在记录没有 header 部分的传出 soap xml。但是在服务
我有一个实现 SOAPHandler interface 的类. handleMessage 定义为: public boolean handleMessage(SOAPMessageContext
我正在客户端寻找一种方法,将对象传递给我的 SOAPHandler,而无需将我的 Port 对象转换为 BindingProvider 来获取请求上下文。通常您会看到如下代码: Map request
目前,我有两个处理程序,一个用于日志记录,一个用于签署 SOAP 消息(本质上会篡改 SOAP 消息)。如果没有处理程序链,MTOM 会按预期工作,插入对二进制内容的引用,而不是内联 base64 二
我有一个 JAX-WS 2.2 Web 服务,我必须获取与其通信的每个客户端的 IP 地址。我写了一个 SOAP 协议(protocol)处理程序,但我看不到地址,因为处理程序不包含此信息,并且使用
我是一名优秀的程序员,十分优秀!