Monday, 15 August 2011

java - Dynamic web service client from wsdl -



java - Dynamic web service client from wsdl -

one of scheme need invoke soap based webservices. of now, every new webservices, generate java stubs provided wsdl file , redeploy web application new webservice consumer code. there approach dynamically create webservice client can invoke methods provided wsdl files? expecting

put wsdl file in location can accessed web application invoke servlet keyword having wsdl file name, , other params required webservice method.

can apache cxf help in this? read in post, generating wsdl2java in runtime , loading classes, on time, can exhaust pemgen memory space.

you should here : http://cxf.apache.org/docs/dynamic-clients.html that.

here example:

clientimpl client = (clientimpl)doc.getclientfromwsdl("http://myurl:8080/datacentersws?wsdl"); string operationname = "getvirtualisationmanageruuid"; bindingoperationinfo op = doc.getoperation(client, operationname); list<messagepartinfo> messagesparts = op.getinput().getmessageparts(); object[] params = new object[messagesparts.size()]; /* feed yours params here (this feeding heavy in code */ object[] res = client.invoke(op, params);

there many other examples in source distribution of cxf.

java web-services wsdl cxf

No comments:

Post a Comment