我正在使用JAX-WS生成的客户端(使用与Glassfish 2.1.1捆绑的wsimport)连接到IIS 6中运行的ASP.NET生成的WebService.
当我在响应中请求压缩时(通过包含HTTP头)Accept-Encoding: 通过JAX-WS SOAP处理程序gzip)IIS 6以压缩响应回答,但不包括Content-Encoding:gzip HTTP响应头,因此我得到以下异常:
com.sun.xml.ws.protocol.soap.MessageCreationException: Couldn't create SOAP message due to exception: XML reader error: com.sun.xml.stream.XMLStreamException2: ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:361) at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:173)
at com.sun.xml.xwss.XWSSClientPipe.process(XWSSClientPipe.java:160)
at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
at com.sun.xml.ws.client.Stub.process(Stub.java:248)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:135)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
Run Code Online (Sandbox Code Playgroud)
编辑于2011年4月17日
我也尝试使用我用于请求压缩响应的相同SOAPHandler来修改响应标头,但是在调用Handler之前发生了异常.
结束编辑2011年4月17日
此外,当我通过soapUI 3.6.1使用首选项"接受来自主机的压缩响应"向WebService发出相同的请求时,我可以看到我所说的内容:IIS 6服务器不包括用于压缩的HTTP响应头,和soapUI将响应显示为"二进制数据"并显示这些响应标头:
HTTP/1.1 200 OK
Date: Wed, 13 Apr 2011 08:50:55 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET …Run Code Online (Sandbox Code Playgroud) Given a playbook like this:
- name: "Tasks for service XYZ"
hosts: apiservers
roles:
- { role: common }
Run Code Online (Sandbox Code Playgroud)
Is there a way to reference the playbook's name ("Tasks for service XYZ")? (i.e. a variable)
EDIT:
My intention is to be able to reference the playbook's name in a role task, i.e. sending a msg via slack like
- name: "Send Slack notification indicating deploy has started"
slack:
channel: '#project-deploy'
token: '{{ slack_token }}'
msg: '*Deploy started* to _{{ inventory_hostname …Run Code Online (Sandbox Code Playgroud) 我正在尝试解压缩MySQL的COMPRESS函数返回的值:
SQLQuery query = session
.createSQLQuery("SELECT ID, COMPRESS(TEXT_COL) AS TEXT_COL FROM TABLE WHERE ID IN (1,2,3,...);")
.addScalar("ID", Hibernate.INTEGER)
.addScalar("TEXT_COL", Hibernate.TEXT);
List<Object[]> list = query.list();
for (Object[] result : list) {
String text = decompress(((String) result[1]).getBytes());
}
(...)
private String decompress(byte[] bs) {
InputStream in = new InflaterInputStream(new ByteArrayInputStream(bs));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
byte[] buffer = new byte[8192];
int len;
while((len = in.read(buffer))>0)
baos.write(buffer, 0, len);
return new String(baos.toByteArray(), "UTF-8");
} catch (IOException e) {
throw new AssertionError(e); …Run Code Online (Sandbox Code Playgroud) java ×2
ansible ×1
ansible-2.x ×1
compression ×1
gzip ×1
hibernate ×1
iis-6 ×1
jax-ws ×1
mysql ×1