Slow initialization of apache cxf client

I am using the classes generated by wsdl2java and this code:

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

Each of these calls takes up to 30 seconds. Why is this?

+4
source share
1 answer

After several hours of work in search engines and alterations, the problem was how the schema files were referenced: although WSDL and XSD were locally saved, there are still links 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" /> 
Server

w3.org was very slow, so my client was slow to initialize.

I changed the link to local:

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

Source: https://habr.com/ru/post/1445317/


All Articles