function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
chandraYeruvaRechandraYeruvaRe 

Calling a web service using a SOAP Client

Hi Guys,

I was tryng to invoke the simple web service which I had defined in force.com using apex code it is a simple say hello program which takes a parm and says hello.

I generated the WSDL for hte same hello program using setu -> api -> apex code -> generate wsdl.

Even i have generated the enterprise WSDL for hte same.

I used the WSDL2java and supplied the enterprise wsdl to geenrate the code and i had put in my dev envioronment and it compiled succesfuly.

Now can anyone of you please let me know how to write a SOAP clinet invoke the web service.

 

Thanks

Chandra.

a.schaefera.schaefer
could you elaborate on the desired communications between your Java Program and your Salesforce ORG?

Consider that there are 2 different communication paths: for Inbound Messaging, you only need the Enterprise WSDL and include it in your external program to read/write data in Salesforce.
For Outbound Messaging i.e. reading data from 3rd party system, you'd take their WSDL and generate an Apex class using that file.

- A
chandraYeruvaRechandraYeruvaRe

 

Hi I am using in bound mesageing.
I have developed a simple apex class with a sebservice in it.I want to invoke that web service using a soap client.I was able to geenrate the enterpriseWSDL and got a bunch of java classes using wsdl2java tool.Now can you plz explain how to write a clint or a standalone program to invoke that web service.if possible some code snippet.

 

Thanks

Chandra

SuperfellSuperfell
create an instance on the enterprise API stub, call login. create an instance of your apex stub, set the sessionId header to the sessionId returned by the login call, call your helloWorld operation.
chandraYeruvaRechandraYeruvaRe

hey Simon can u plz little elaborate the issue.

I am new to force.com.

 

I had created all these

1) created apex class with a method sayhello made it as a web service.

2) generated the WSDL using the enterprisewsdl

3) inflated java files using wsdl2java got 11 files.(used enterprisewsdl )

 

now can u tel me wht to do..?

if possible some kind of steps n code snipets.

 

regards

chandra

SuperfellSuperfell
See the getting started guide in the API docs.
chandraYeruvaRechandraYeruvaRe

I did nit find much there and was fully confused..:( can u plz elaborate or send me some docs..

 

regards

chandra

SuperfellSuperfell
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_quickstart_steps.htm
chandraYeruvaRechandraYeruvaRe

hi

one more small doubt.

 

In this sample application where we will mention our endpoint address. if i am not wrong hte generated java files needs to behtere in class path to run this client.

How will i invoke my method say hello in Querysample() method.

 

thanks

Chandra.