Slow initialization of apache cxf client

 ̄綄美尐妖づ 提交于 2020-01-03 16:51:37

问题


I'm using wsdl2java generated classes and this code:

MyService f = new MyService();
MyServicePortType type = f.getMyServicePortType();

Each of these calls is taking up to 30 seconds. Why is that?


回答1:


After hours of googling and tinkering the problem was in how scheme files were referenced: although WSDL and XSD were locally stored there was still some referenced to w3.org that looked like this:

<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSchema 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd" [...

<import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd" />

w3.org server was resposing super-slowly hence the slow initialization of my client.

I have changed the reference to local:

<import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd" />


来源:https://stackoverflow.com/questions/13330547/slow-initialization-of-apache-cxf-client

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!