+ Start a Discussion
chandraYeruvaRechandraYeruvaRe 

hosting a java application

hi all,

 

can u guys please let me know how to host a simple helo world application as a webservice in force ?

 

thnks

chandra

SuperfellSuperfell

you can't run java code server side at salesforce, but you can write web services in apex code, something like

 

global class HelloWorldService {

  static webservice String sayHello(String name) {

     return 'hello ' + name;

   }

}

 

This should be covered in the apex language docs. 

Message Edited by SimonF on 03-13-2009 10:03 AM
chandraYeruvaRechandraYeruvaRe

Hey Simon,

 

If i write a code using java not apex code how can i deploy my service there..?and how to inkvoe the same ?

SuperfellSuperfell
You cannot deploy/run java code on the salesforce.com servers.
chandraYeruvaRechandraYeruvaRe
Hey Simon, can you please elaborate a little.. why it can not be and what the limitations to doing so ?
SuperfellSuperfell

because its not a service that salesforce.com offers, if you want to run code on the salesforce.com servers, it has to be written in apex.

 

Have you seen some of the intro material for the platform? try http://developer.force.com/gettingstarteddevelopers

chandraYeruvaRechandraYeruvaRe

Hey Simon thnks for immediate help. One more question for u. If i wanna invoke that webservice frm a stand alone client(like java class) what should i do?

 

thanks

chandra.

SuperfellSuperfell
the class will automatically generate a wsdl for the service, download the wsdl, import it into your java soap client of choice, and off you go (you'll also need the regular partner or enterprise WSDL as well, so you can call login).
chandraYeruvaRechandraYeruvaRe

Hey Simon,

 

I have generated the wsdl using generate wsdl and tried using AXIS wsdl2java by suuplying the generated WSDL.But was getting some strange error "[ERROR] No operation found in the portType element". is i am isisng something ?.

 

Thanks

Chandra.

SuperfellSuperfell
Sounds like you have no methods in your class marked as webservice, so there's no operations in your webservice wsdl.
chandraYeruvaRechandraYeruvaRe

simon can you please send me the complete webservice code which includes the client invokation(such as axis2).