Skip to main content

GET WSDL on proxy factory instantiation: how to suppress or secure?

4 replies [Last post]
UrsusD
Offline
Joined: 2011-09-05

Hi

The Metro-generated proxy factory does a GET WSDL call on instantiation:

// wsimport -> class XYZ_Service extends Service, interface XYZ
XYZ_Service proxyFactory = new XYZ_Service(<with or w/o parameters>);  // GET WSDL call
XYZ         xyzProxy     = proxyFactory.getXYZPort();

Why does Metro do this GET WSDL call after the proxy has long been generated?
(C# proxies do not.)

Our WSDLs are protected.
- Can we suppress this call?
- Is there a way to put a security header (Negotiate token) or cookie on this GET WSDL call?

Thanks,
UrsusD

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
eskatos
Offline
Joined: 2007-05-14

Embed the WSDL as a resource and then provide it on proxy instanciation.

WSDL is fetched only if it is not provided.

Something like: new XYZ_Service( XYZ_Service.class.getResource( "/path/to/your/XYZ.wsdl" ), new QName( "NameSpace", "ServiceName" ) );

/Paul

UrsusD
Offline
Joined: 2011-09-05

Hi Paul

Thanks for the hint, but the proxy factory seems to always fetch a WSDL, either that one provided as a constructor parameter or, without parameter, that one originally used by wsimport and generated into the proxy factory.

UrsusD

eskatos
Offline
Joined: 2007-05-14

Sure it need the WSDL but if you provide it from your classpath there's no network request to fetch it.

Anyway, that's what I observed when using Metro last year.

Hope this helps.

/Paul

UrsusD
Offline
Joined: 2011-09-05

Hi Paul

I misunderstood your first reply.
Yes, referring to a local WSDL file works and prevents the remote call. This is not really what I hoped for, but it is a workaround.

I found these infos regarding my question:
http://stackoverflow.com/questions/4315229/wsdl-requests-with-metro-jax-...
which refers to this FAQ:
http://jax-ws.java.net/faq/index.html#wsdl_at_runtime

Thanks again,
UrsusD