Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2004-11-22
8
Medium Priority
?
260 Views
Last Modified: 2010-03-31
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,







0
Comment
Question by:gelgitdev
7 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 12643924
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12644024
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...
0
 

Author Comment

by:gelgitdev
ID: 12652417
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,
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 35

Expert Comment

by:girionis
ID: 12652440
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 (http://www.experts-exchange.com/Community_Support/) for zero points to PAQ this question and refund the points back to you.
0
 
LVL 35

Expert Comment

by:girionis
ID: 12664753
Fine by me.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12664833
me too
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12665357
PAQ-ing the question and refunding 500  points

Thanks girionis & TimYates !

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question