• sridevi
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 5
    Replies

Hi All,

 

 

DefaultHttpClient client = new DefaultHttpClient();

HttpPost oauthPost = new HttpPost(baseUrl);

HttpResponse response = client.execute(oauthPost);

int code = response.getStatusLine().getStatusCode();

Map<String, String> oauthLoginResponse = (Map<String, String>) JSON.parse(EntityUtils
.toString(response.getEntity()));

 

eclipse show the error The method parse(String) is undefined for the type JSON

 

plz need help

Hi All,

 

 

DefaultHttpClient client = new DefaultHttpClient();

HttpPost oauthPost = new HttpPost(baseUrl);

HttpResponse response = client.execute(oauthPost);

int code = response.getStatusLine().getStatusCode();

Map<String, String> oauthLoginResponse = (Map<String, String>) JSON.parse(EntityUtils
.toString(response.getEntity()));

 

eclipse show the error The method parse(String) is undefined for the type JSON

 

plz need help

Hi All

 

Plz Need help.........

 

I am examining a sample which is in the salesforce developer site.

In that sample when we click a link it will be redirected to the salesforce login page. If the login successful, then an access token is issued.
I dont want my application to redirect to the salesforce login page. 
What should I do to avoid redirecting to salesforce login page.

 

plz need ur help..................................

Hi All

 

Plz Need help.........

 

I am examining a sample which is in the salesforce developer site.

In that sample when we click a link it will be redirected to the salesforce login page. If the login successful, then an access token is issued.
I dont want my application to redirect to the salesforce login page. 
What should I do to avoid redirecting to salesforce login page.

 

plz need ur help..................................

Hi All.

 

Im Integrating salesforce to java ,Im using  salesforce Rest api Oauth example.

 

when i run the program the auth url and request url displayed ,In that url hit the browser ,but i don't want every time hit the url in

the  browser.

 

I want add the slesforce username and paw in auth url or request url  how?

 

i want to directly redirecting the url how? 

Hi All,

 

How to using  salesforce REST API's ?

 

I am new to webservices and rest api's , i am integrating the salesforce to openbravo

 

 

 

Plz need help

 

Hi All,

 

I am working on salesforce to java through integration, I am new to webservices and triggers.

plz see the below webservices program and how to trigger the web services. 
plz help.. 

package com.ws; 

import java.rmi.RemoteException; 
import java.sql.Connection; 
import java.sql.DriverManager; 
import java.sql.PreparedStatement; 
import java.sql.SQLException; 

import javax.xml.rpc.ServiceException; 

import com.sforce.soap.enterprise.LoginResult; 
import com.sforce.soap.enterprise.QueryResult; 
import com.sforce.soap.enterprise.SessionHeader; 
import com.sforce.soap.enterprise.SforceServiceLocator; 
import com.sforce.soap.enterprise.SoapBindingStub; 
import com.sforce.soap.enterprise.fault.InvalidFieldFault; 
import com.sforce.soap.enterprise.fault.InvalidIdFault; 
import com.sforce.soap.enterprise.fault.InvalidQueryLocatorFault; 
import com.sforce.soap.enterprise.fault.InvalidSObjectFault; 
import com.sforce.soap.enterprise.fault.LoginFault; 
import com.sforce.soap.enterprise.fault.MalformedQueryFault; 
import com.sforce.soap.enterprise.fault.UnexpectedErrorFault; 
import com.sforce.soap.enterprise.sobject.Contact; 

public class ContactBpartner { 
private static final String USERNAME = ""; 
private static final String TOKEN = ""; 
private static final String PASSWORD = "" + TOKEN; 
private SoapBindingStub binding; 

public static void main(String args[]) throws InvalidSObjectFault, MalformedQueryFault, InvalidFieldFault, InvalidIdFault, UnexpectedErrorFault, InvalidQueryLocatorFault, RemoteException, InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { 
ContactBpartner d = new ContactBpartner(); 
d.login(); 
d.search(); 



private void login() throws InvalidIdFault, UnexpectedErrorFault, LoginFault, RemoteException { 
try { 
binding = (SoapBindingStub) new SforceServiceLocator().getSoap(); 
} catch (ServiceException e1) { 
e1.printStackTrace(); 

LoginResult loginresult = null; 
loginresult = binding.login(USERNAME, PASSWORD); 
binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY, 
loginresult.getServerUrl()); 
SessionHeader sh = new SessionHeader(); 
sh.setSessionId(loginresult.getSessionId()); 
binding.setHeader(new SforceServiceLocator().getServiceName() 
.getNamespaceURI(), "SessionHeader", sh); 



private void search() throws InvalidSObjectFault, MalformedQueryFault, 
InvalidFieldFault, InvalidIdFault, UnexpectedErrorFault, 
InvalidQueryLocatorFault, RemoteException, InstantiationException, 
IllegalAccessException, ClassNotFoundException, SQLException { 
Connection conn = null; 

PreparedStatement ps = null; 
StringBuffer sql = new StringBuffer(256); 

try{ 
QueryResult qr = binding.query("select id, Name from Contact "); 

if (qr.getSize() > 0) { 
for (int i = 0; i <= qr.getSize(); i++) { 
Contact l = (Contact)qr.getRecords(i); 
.......................................................... 
................................................................................................... 
.................................................................................. 



}catch (Exception e) { 


}

Hi All,

 

I am working on salesforce to java through integration, I am new to webservices and triggers.

plz see the below webservices program and how to trigger the web services. 
plz help.. 

package com.ws; 

import java.rmi.RemoteException; 
import java.sql.Connection; 
import java.sql.DriverManager; 
import java.sql.PreparedStatement; 
import java.sql.SQLException; 

import javax.xml.rpc.ServiceException; 

import com.sforce.soap.enterprise.LoginResult; 
import com.sforce.soap.enterprise.QueryResult; 
import com.sforce.soap.enterprise.SessionHeader; 
import com.sforce.soap.enterprise.SforceServiceLocator; 
import com.sforce.soap.enterprise.SoapBindingStub; 
import com.sforce.soap.enterprise.fault.InvalidFieldFault; 
import com.sforce.soap.enterprise.fault.InvalidIdFault; 
import com.sforce.soap.enterprise.fault.InvalidQueryLocatorFault; 
import com.sforce.soap.enterprise.fault.InvalidSObjectFault; 
import com.sforce.soap.enterprise.fault.LoginFault; 
import com.sforce.soap.enterprise.fault.MalformedQueryFault; 
import com.sforce.soap.enterprise.fault.UnexpectedErrorFault; 
import com.sforce.soap.enterprise.sobject.Contact; 

public class ContactBpartner { 
private static final String USERNAME = ""; 
private static final String TOKEN = ""; 
private static final String PASSWORD = "" + TOKEN; 
private SoapBindingStub binding; 

public static void main(String args[]) throws InvalidSObjectFault, MalformedQueryFault, InvalidFieldFault, InvalidIdFault, UnexpectedErrorFault, InvalidQueryLocatorFault, RemoteException, InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { 
ContactBpartner d = new ContactBpartner(); 
d.login(); 
d.search(); 



private void login() throws InvalidIdFault, UnexpectedErrorFault, LoginFault, RemoteException { 
try { 
binding = (SoapBindingStub) new SforceServiceLocator().getSoap(); 
} catch (ServiceException e1) { 
e1.printStackTrace(); 

LoginResult loginresult = null; 
loginresult = binding.login(USERNAME, PASSWORD); 
binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY, 
loginresult.getServerUrl()); 
SessionHeader sh = new SessionHeader(); 
sh.setSessionId(loginresult.getSessionId()); 
binding.setHeader(new SforceServiceLocator().getServiceName() 
.getNamespaceURI(), "SessionHeader", sh); 



private void search() throws InvalidSObjectFault, MalformedQueryFault, 
InvalidFieldFault, InvalidIdFault, UnexpectedErrorFault, 
InvalidQueryLocatorFault, RemoteException, InstantiationException, 
IllegalAccessException, ClassNotFoundException, SQLException { 
Connection conn = null; 

PreparedStatement ps = null; 
StringBuffer sql = new StringBuffer(256); 

try{ 
QueryResult qr = binding.query("select id, Name from Contact "); 

if (qr.getSize() > 0) { 
for (int i = 0; i <= qr.getSize(); i++) { 
Contact l = (Contact)qr.getRecords(i); 
.......................................................... 
................................................................................................... 
.................................................................................. 



}catch (Exception e) { 


}

Hi All,

 

I am working on salesforce to java integration through webservices

 

How to write a select query using two tables like QuoteLineItem and PricebookEntry and compare id's  and get the product2id . this query how to write ?

 

i write a query like this 

 

QueryResult q = binding.query("select id,(select id,product2id from PricebookEntry)from QuoteLineItem");

 

i am getting errors

 

AxisFault
faultCode: {urn:fault.enterprise.soap.sforce.com}INVALID_TYPE
faultSubcode:
faultString: INVALID_TYPE:
id,(select id,product2id from PricebookEntry)from QuoteLineItem
^
ERROR at Row:1:Column:38
Didn't understand relationship 'PricebookEntry' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
faultActor:
faultNode:
faultDetail:
{urn:fault.enterprise.soap.sforce.com}InvalidSObjectFault:<ns1:exceptionCode>INVALID_TYPE</ns1:exceptionCode><ns1:exceptionMessage>
id,(select id,product2id from PricebookEntry)from QuoteLineItem
^

 

plz help..

 

 

  • September 21, 2012
  • Like
  • 0

Hi All,

 

I have got a Enterprise  WSDL ,Partner  WSDL file from my account. From that i have extracted all the Java classes to connect and interact with Salesforce.

 

I am getting this error EnterpriseConnection cannot be resolved to a type

 

Please help me out..

  • September 04, 2012
  • Like
  • 0

Hi All,

 

 

DefaultHttpClient client = new DefaultHttpClient();

HttpPost oauthPost = new HttpPost(baseUrl);

HttpResponse response = client.execute(oauthPost);

int code = response.getStatusLine().getStatusCode();

Map<String, String> oauthLoginResponse = (Map<String, String>) JSON.parse(EntityUtils
.toString(response.getEntity()));

 

eclipse show the error The method parse(String) is undefined for the type JSON

 

plz need help

Hi All

 

Plz Need help.........

 

I am examining a sample which is in the salesforce developer site.

In that sample when we click a link it will be redirected to the salesforce login page. If the login successful, then an access token is issued.
I dont want my application to redirect to the salesforce login page. 
What should I do to avoid redirecting to salesforce login page.

 

plz need ur help..................................

Hi All

 

Plz Need help.........

 

I am examining a sample which is in the salesforce developer site.

In that sample when we click a link it will be redirected to the salesforce login page. If the login successful, then an access token is issued.
I dont want my application to redirect to the salesforce login page. 
What should I do to avoid redirecting to salesforce login page.

 

plz need ur help..................................

Hi All,

 

How to using  salesforce REST API's ?

 

I am new to webservices and rest api's , i am integrating the salesforce to openbravo

 

 

 

Plz need help

Hi All,

 

I am working on salesforce to java integration through webservices

 

How to write a select query using two tables like QuoteLineItem and PricebookEntry and compare id's  and get the product2id . this query how to write ?

 

i write a query like this 

 

QueryResult q = binding.query("select id,(select id,product2id from PricebookEntry)from QuoteLineItem");

 

i am getting errors

 

AxisFault
faultCode: {urn:fault.enterprise.soap.sforce.com}INVALID_TYPE
faultSubcode:
faultString: INVALID_TYPE:
id,(select id,product2id from PricebookEntry)from QuoteLineItem
^
ERROR at Row:1:Column:38
Didn't understand relationship 'PricebookEntry' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
faultActor:
faultNode:
faultDetail:
{urn:fault.enterprise.soap.sforce.com}InvalidSObjectFault:<ns1:exceptionCode>INVALID_TYPE</ns1:exceptionCode><ns1:exceptionMessage>
id,(select id,product2id from PricebookEntry)from QuoteLineItem
^

 

plz help..

 

 

  • September 21, 2012
  • Like
  • 0