• Nageswara Reddy Rami Reddy
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 1
    Replies

HI all,

 

 I am new to webservices .Please  hlep me  in detail  what are all ways how to call  external webservices with soap in apex.

 

 

 

 

Thanks

Nageswara 

 

HI all ,

 

 I  am  new to  webservice. I am integrate java apps with Force.com APIs. and  I am follwoing the below link. and getting  the error.

http://wiki.developerforce.com/page/Introduction_to_the_Force.com_Web_Services_Connector

 


F:\>java -classpath FF:\force-wsc-29.0.0.jar;F:\ST-4.0.7.jar; com.sf
orce.ws.tools.wsdlc F:\mywebservice.wsdl F:\mywebservice.jar

 

 


Exception in thread "main" java.io.FileNotFoundException: F:\mywebservice.wsdl (
The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(UnknownSo
urce)
at java.net.URL.openStream(Unknown Source)
at com.sforce.ws.wsdl.WsdlFactory.create(WsdlFactory.java:47)
at com.sforce.ws.codegen.Generator.generate(Generator.java:81)
at com.sforce.ws.tools.wsdlc.run(wsdlc.java:108)
at com.sforce.ws.tools.wsdlc.run(wsdlc.java:142)
at com.sforce.ws.tools.wsdlc.main(wsdlc.java:64)

 

 

and I place the tools.jar file ,force-wsc-29.0.0.jar to rnning directory   . Please guide me to relove the issue.

 

Thanks 

Nageswara Reddy

 

 

I have two developer orgnazations. In one developer I  have Written  rest Class . I want call this Rest class from another Organizations .  I have followed the Following Link

 

http://salesforce.stackexchange.com/questions/17382/apex-rest-api-call-from-javascript-via-ajax-toolkit

 

 I Have created one button to call the rest class . In the button I have placed the following code and I am getting Error like " 

 

"A problem with the OnClick JavaScript for this button or link was encountered:

missing : after property id"

 

MY Java Script Code  Is:

----------------------------------------


var result = sforce.connection.login("nagesh@health.com", "chintu@123+DQUEVD4sj3ZMhnuEb6CoucZf");

sforce.connection.init(result.sessionid,'https://ap1.salesforce.com/services/data/a/ShowResult/prasad' );

sforce.connection.remoteFunction({
"https://ap1.salesforce.com/services/data/v20.0/ShowResult/{!Contact.LastName}",

requestHeaders: {"Authorization":"Bearer " + result.sessionid,
"Content-Type":"application/json"},

method: "GET",


onSuccess : function(response) {
sforce.debug.log(response);
},
onFailure : function(response) {
alert("Failed" + response)
}
});

 

 

----------------------------------------------------------

MY Rest Class :

 

@RestResource(urlMapping='/ShowResult/*')
global with sharing class MyRestResource {


@HttpGet
global static String doGet()
{
String SendMessage='';
List<Contact> Conlist;
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
String SampEmail=req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
System.debug('@@@@@@@@'+SampEmail);
if(SampEmail!=null&&SampEmail!='' )
{
Conlist =[select id,FirstName,lastName from Contact where LastName=:SampEmail limit 100];
If(Conlist.size()>0)
{
System.debug('*********'+Conlist.size());
SendMessage='success';
System.debug('*************'+SendMessage);
}
else
{
System.debug('$$$$$$$$$$$$$$$$$$$$$$'+SendMessage);
SendMessage='fail';
}
}
else
{
SendMessage='Please pass any String';
}
System.debug('%%%%%%%%%%%%%%'+SendMessage);
Return SendMessage;
}
}

 

 

 

I Have not included any Resources.Please Let me  how to accomplish  this. Thanks In advance

 

Hi All,

 

  Recently  I am  started  Learning Rest ApI . I Have created one Apex rest class . I am calling my Rest call  from WorkBench Rest Explorer tool

 

MY Rest Class is

 

@RestResource(urlMapping='/ShowResult/*')
global with sharing class MyRestResource {

        @HttpGet
        global static String doGet()
        {
        String SendMessage='';
        List<contact> Conlist;
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
        String SampEmail=req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
        System.debug('@@@@@@@@'+SampEmail);    
        if(SampEmail!=null&&SampEmail!='' )
        {
            Conlist =[select id,FirstName,lastName from Contact where Email=:SampEmail limit 100];  // Instead of  email , If I                                                                                                                                                              use phone,Lastname it's workin fine
            If(Conlist.size()>0)
            {
                System.debug('*********'+Conlist.size());
                SendMessage='success';
                System.debug('*************'+SendMessage);
            }
            else
            {
            System.debug('$$$$$$$$$$$$$$$$$$$$$$'+SendMessage);
            SendMessage='fail';
            }
        }
        else
        {
            SendMessage='Please pass any String';
        }
        System.debug('%%%%%%%%%%%%%%'+SendMessage);
        Return SendMessage;
      }

 

 In  the  URL I am  giving the  like    /services/apexrest/ShowResult/nagesh@advaanz.com.  In the debug log It's executing perfectly,  but giving this Error
     

 

 

 

"HTTP/1.1 404 Not Found Date: Wed, 30 Oct 2013 11:26:17 GMT Content-Type: application/json;charset=UTF-8 Transfer-Encoding: chunked
[ { "message" : "The requested resource does not exist", "errorCode" : "NOT_FOUND" } ]"

 

 IF   we  use  LastName ,Phone, Firstname, MobilePhone.... In stead of  Email In  the query    It's Working perfectly.  problem with  Check with  email. 

 

 


 Please Guide me  to solve this problem    
       
        
  
  

Hi all 

 

 I Have created   Custom Button  Like " Clone  to Lead"  In Account   Object .  when  click On the this  button  On perticular accoutn record  , a  new lead page will be papuplated with  firast name and last name . But   Email  and phone field values   are Not Populated . why so...

 

/setup/ui/recordtypeselect.jsp?ent=Lead&retURL=%2F00Q%2Fo&save_new_url=%2F00Q%2Fe%3FretURL%3D%252F00Q%252Fo&name_lastlea2={!Account.LastName}&name_firstlea2={!Account.FirstName}& name_salutationlea2={!Account.Salutation} & phone={!Account.Phone} & Email={!Account.PersonEmail}

 

 

Thanks  In advance

 

 

Hi All,

 

 I have  upload  a word document  in attachment. I want to dispaly  the tyhat word document data  in visual  force pages .visual force pages .  I have gone through this link. Apart from this  is there any alternative inorder to accomplish this.....

http://boards.developerforce.com/t5/Apex-Code-Development/Decode-Encode-Word-Documents-in-Apex/m-p/329545#M58393

 

 

Thanks in advance

I have two developer orgnazations. In one developer I  have Written  rest Class . I want call this Rest class from another Organizations .  I have followed the Following Link

 

http://salesforce.stackexchange.com/questions/17382/apex-rest-api-call-from-javascript-via-ajax-toolkit

 

 I Have created one button to call the rest class . In the button I have placed the following code and I am getting Error like " 

 

"A problem with the OnClick JavaScript for this button or link was encountered:

missing : after property id"

 

MY Java Script Code  Is:

----------------------------------------


var result = sforce.connection.login("nagesh@health.com", "chintu@123+DQUEVD4sj3ZMhnuEb6CoucZf");

sforce.connection.init(result.sessionid,'https://ap1.salesforce.com/services/data/a/ShowResult/prasad' );

sforce.connection.remoteFunction({
"https://ap1.salesforce.com/services/data/v20.0/ShowResult/{!Contact.LastName}",

requestHeaders: {"Authorization":"Bearer " + result.sessionid,
"Content-Type":"application/json"},

method: "GET",


onSuccess : function(response) {
sforce.debug.log(response);
},
onFailure : function(response) {
alert("Failed" + response)
}
});

 

 

----------------------------------------------------------

MY Rest Class :

 

@RestResource(urlMapping='/ShowResult/*')
global with sharing class MyRestResource {


@HttpGet
global static String doGet()
{
String SendMessage='';
List<Contact> Conlist;
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
String SampEmail=req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
System.debug('@@@@@@@@'+SampEmail);
if(SampEmail!=null&&SampEmail!='' )
{
Conlist =[select id,FirstName,lastName from Contact where LastName=:SampEmail limit 100];
If(Conlist.size()>0)
{
System.debug('*********'+Conlist.size());
SendMessage='success';
System.debug('*************'+SendMessage);
}
else
{
System.debug('$$$$$$$$$$$$$$$$$$$$$$'+SendMessage);
SendMessage='fail';
}
}
else
{
SendMessage='Please pass any String';
}
System.debug('%%%%%%%%%%%%%%'+SendMessage);
Return SendMessage;
}
}

 

 

 

I Have not included any Resources.Please Let me  how to accomplish  this. Thanks In advance

 

Hi,

 

Any one have some idea about DODGE Leads? I do not have any idea about DODGE Leads and I needs to import DODGE Leads to the salesforce. Please help me.