Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slow initialization of apache cxf client

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?

like image 937
Ljudevit Avatar asked Nov 11 '12 11:11

Ljudevit


1 Answers

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" />
like image 117
Ljudevit Avatar answered Oct 06 '22 02:10

Ljudevit