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_servicesCfcSoapBinding Stub.java
- Web_servicesService.java
- Web_servicesServiceLocator .java
- Web_servicesServiceTestCas e.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,
I'm confused at invoking wsdl(web_services.cfc?wsdl
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_servicesCfcSoapBinding
- Web_servicesService.java
- Web_servicesServiceLocator
- Web_servicesServiceTestCas
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,
Maybe this will help: http://java.sun.com/webservices/docs/1.0/tutorial/
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.getSOAPMappingRegistr y();
call.setSOAPMappingRegistr y(smr);
call.setMethodName("the method name that you want to ivoke");
call.setEncodingStyleURI(C onstants.N S_URI_SOAP _ENC);
call.setTargetObjectURI(ta rget 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...
Call call=new Call();
SOAPMappingRegistry smr = call.getSOAPMappingRegistr
call.setSOAPMappingRegistr
call.setMethodName("the method name that you want to ivoke");
call.setEncodingStyleURI(C
call.setTargetObjectURI(ta
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...
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,
Here is the solution. (for JBuilderX packaging)
Web_servicesService ws = new Web_servicesServiceLocator
Web_services port = ws.getWeb_servicesCfc();
String s = port.getThisShit2("hebe");
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.