Note that there are some explanatory texts on larger screens.

plurals
  1. POCXF client loads wsdl for both service and port?
    text
    copied!<p>In a java web app, I need to call a remote soap service, and I'm trying to use a CXF 2.5.0-generated client. The soap service is provided by a particular ERP vendor, and its wsdl is monstrous, thousands of types, dozens of xsd imports, etc. wsdl2java generates the client ok, thanks to the -autoNameResolution flag. But at runtime it retrieves the remote wsdl twice, once when I create the service object, and again when I create a port object.</p> <pre><code>MyService_Service myService = new MyService_Service(giantWsdlUrl); // fetches giantWsdl MyService myPort = myService.getMyServicePort(); // fetches giantWsdl again </code></pre> <p>Why is that? I can understand retrieving it when creating myService, you want to see that it matches the client I'm currently using, or let a runtime wsdl location dictate the endpoint address, etc. But I don't understand why asking for the port would reload everything it <em>just</em> went out on the wire for. Am I missing something?</p> <p>Since this is in a web application, and I <a href="http://cxf.apache.org/faq.html#FAQ-AreJAXWSclientproxiesthreadsafe%3F" rel="nofollow noreferrer">can't be sure that myPort is threadsafe</a>, then I'd have to create a port for each thread, except that's way too slow, 6 to 8 seconds thanks to the monstrous wsdl. Or add my own pooling, create a bunch in advance, and do check-outs and check-ins. Yuck. </p> <p>For the record, the <a href="https://stackoverflow.com/a/1422037/545195">JaxWsProxyFactoryBean creation route</a> does <em>not</em> ever fetch the wsdl, and that's good for my situation. It still takes a long time on the first create(), then about a quarter second on subsequent create()s, and even that's less than desirable. And I dunno... it sorta feels like I'm under the hood hotwiring the thing rather than turning the key. :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload