Link to home
Start Free TrialLog in
Avatar of gelgitdev
gelgitdev

asked on

calling a web services method via java stand-alone client application

Hello,

I'm confused at invoking wsdl(web_services.cfc?wsdl) from java stand-alone client application.

Coding Program, JBuilderX and i've installed Web Services Developer pack.

I have one web service wsdl file which has a simple method returns one String.

I'm already import the wsdl file to the JBuilderX project and program is put these files in to the project folder.
Files:
- Web_Service.java
- Web_servicesCfcSoapBindingStub.java
- Web_servicesService.java
- Web_servicesServiceLocator.java
- Web_servicesServiceTestCase.java


And after these processes, i don't know how to call the method in that wsdl file...


I searched the google and the groups. But i can't find anything that helps.

So, how can i get the String? or call the method?


Thank you,







Avatar of girionis
girionis
Flag of Greece image

You should be able to do: (from http://forum.java.sun.com/thread.jspa?forumID=331&messageID=2809692&threadID=563855)

Call call=new Call();
SOAPMappingRegistry smr = call.getSOAPMappingRegistry();
call.setSOAPMappingRegistry(smr);
call.setMethodName("the method name that you want to ivoke");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setTargetObjectURI(target where the soap is implemented);
Vector params = new Vector();
params.addElement(new Parameter("parameter to be passed", type of parameter,null);

call.setParams(params);
Response resp = call.invoke(url to be invoked, target object uri);

Assuming it's a SOAP service...
Avatar of gelgitdev
gelgitdev

ASKER

I solved the problem.
Here is the solution. (for JBuilderX packaging)

Web_servicesService ws = new Web_servicesServiceLocator();
Web_services port = ws.getWeb_servicesCfc();
String s = port.getThisShit2("hebe"); //gotcha!



Thank you,
Nice to hear you got it solved :)

If you feel you have been helped please accept an answer/split the points otherwise ask a question to Community Support (https://www.experts-exchange.com/Community_Support/) for zero points to PAQ this question and refund the points back to you.
Fine by me.
me too
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial