• othman
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 12
    Replies

Hello,

is the programming language of the Force.com platform limited to apex? can i write a native Force.com app using languages like Java or python?

  • December 31, 2013
  • Like
  • 0

Hello guys,

 

I'm using a wsdl2apex generated class to make callouts to a remote webservice.

I have the below error when i call one of the WS methods.It refers to some failure to parse datetime. i'm not able to spot where the dateTime parsing fails and why it should fail. does apex has a specific date time parsing logic?

Hope someone suggests what this error means.

thanks.

 

Web service callout failed: Failed to deserialize value '0', due to:Unable to parse dateTime							

 

Hello,

I'm writing an intergration application where SF communicates with an external system.

I need to track some SF Fields data that are sent to the external system. I thought to create a SF Custom field Object called 'DataStore' where i save data for Objects that are linked to other system (like ids of contacts , ids of opportunitys , id list of opportunity products ect..)

do you have Ideas how i can achive this? does a custom Object field support List<String> to strore ids of my data sent to other system?

In fact i need your Ideas on best solution to synchronize SF with the external system. is it good idea to keep a List of ids of the SF objects that are exchanged with the external system? is there in Force.com some mechanism to keep a history of Objects exchanged with some external system?

 

Thanks.

I have the below apex code that when called returns a bad request 400

is there anything i missed in the http request i send below?

 

@future (callout=true)	
	public static void invoke(String email, String firstName){
		Http h = new Http();
        HttpRequest req = new HttpRequest();
       	req.setMethod('POST');
			
		Blob headerValue = Blob.valueOf(USERNAME + ':' + PASSWORD);
		String authorizationHeader = 'BASIC ' +   EncodingUtil.base64Encode(headerValue);
		req.setHeader('Authorization', authorizationHeader);
		 req.setHeader('Accept', 'text/xml;charset=utf-8');	
		 	
		req.setEndpoint('http://localhost:8080/jbilling/rest/users');
				
		String requestString = '<list>'+
		'<user>'+'<userId>0</userId>'+'<userName>othmanelmoulat</userName>'+
		'<password>123qwe</password>'+'<mainRoleId>5</mainRoleId>'+
		'<contact>'+'<email>'+email+'</email>'+
		'<firstName>'+firstName+'</firstName></contact>'+
		'</user></list>';
						
		req.setHeader('Content-Length',String.valueOf(requestString.length()));
		
		req.setBody(requestString);
		HttpResponse res;
		 try {
            res = h.send(req);
		   string bodyRes=res.getBody();
		    System.debug(bodyRes);
        } catch(System.CalloutException e) {
            System.debug('Callout error: '+ e);
            System.debug(res.toString());
        }
		
       //parse body response to extract results values
	}

 

here is the debug log of the request sf tried to process and returned 400.

is there something not right in this request? any reason why the server returns a 400?

 

18:19:43:000 USER_DEBUG POST /jbilling/rest/users/ HTTP/1.0

18:19:43:000 USER_DEBUG Content-Type: text/xml;charset=utf-8

18:19:43:000 USER_DEBUG Authorization: BASIC YWRtaW47MToxMjNxd2U=

18:19:43:000 USER_DEBUG SFDC_STACK_DEPTH: 1

18:19:43:000 USER_DEBUG Content-Length: 238

18:19:43:000 USER_DEBUG User-Agent: SFDC-Callout/25.0

18:19:43:000 USER_DEBUG Accept: text/xml;charset=utf-8

18:19:43:000 USER_DEBUG Host: localhost:8080

18:19:43:000 USER_DEBUG Via: 1.1 proxy-chi.net.salesforce.com:8080 (squid)

18:19:43:000 USER_DEBUG X-Forwarded-For: 10.232.12.20

18:19:43:000 USER_DEBUG Cache-Control: max-age=259200

18:19:43:000 USER_DEBUG Connection: keep-alive

 

Hello,

is the programming language of the Force.com platform limited to apex? can i write a native Force.com app using languages like Java or python?

  • December 31, 2013
  • Like
  • 0

Hello,

I'm writing an intergration application where SF communicates with an external system.

I need to track some SF Fields data that are sent to the external system. I thought to create a SF Custom field Object called 'DataStore' where i save data for Objects that are linked to other system (like ids of contacts , ids of opportunitys , id list of opportunity products ect..)

do you have Ideas how i can achive this? does a custom Object field support List<String> to strore ids of my data sent to other system?

In fact i need your Ideas on best solution to synchronize SF with the external system. is it good idea to keep a List of ids of the SF objects that are exchanged with the external system? is there in Force.com some mechanism to keep a history of Objects exchanged with some external system?

 

Thanks.

I have the below apex code that when called returns a bad request 400

is there anything i missed in the http request i send below?

 

@future (callout=true)	
	public static void invoke(String email, String firstName){
		Http h = new Http();
        HttpRequest req = new HttpRequest();
       	req.setMethod('POST');
			
		Blob headerValue = Blob.valueOf(USERNAME + ':' + PASSWORD);
		String authorizationHeader = 'BASIC ' +   EncodingUtil.base64Encode(headerValue);
		req.setHeader('Authorization', authorizationHeader);
		 req.setHeader('Accept', 'text/xml;charset=utf-8');	
		 	
		req.setEndpoint('http://localhost:8080/jbilling/rest/users');
				
		String requestString = '<list>'+
		'<user>'+'<userId>0</userId>'+'<userName>othmanelmoulat</userName>'+
		'<password>123qwe</password>'+'<mainRoleId>5</mainRoleId>'+
		'<contact>'+'<email>'+email+'</email>'+
		'<firstName>'+firstName+'</firstName></contact>'+
		'</user></list>';
						
		req.setHeader('Content-Length',String.valueOf(requestString.length()));
		
		req.setBody(requestString);
		HttpResponse res;
		 try {
            res = h.send(req);
		   string bodyRes=res.getBody();
		    System.debug(bodyRes);
        } catch(System.CalloutException e) {
            System.debug('Callout error: '+ e);
            System.debug(res.toString());
        }
		
       //parse body response to extract results values
	}

 

here is the debug log of the request sf tried to process and returned 400.

is there something not right in this request? any reason why the server returns a 400?

 

18:19:43:000 USER_DEBUG POST /jbilling/rest/users/ HTTP/1.0

18:19:43:000 USER_DEBUG Content-Type: text/xml;charset=utf-8

18:19:43:000 USER_DEBUG Authorization: BASIC YWRtaW47MToxMjNxd2U=

18:19:43:000 USER_DEBUG SFDC_STACK_DEPTH: 1

18:19:43:000 USER_DEBUG Content-Length: 238

18:19:43:000 USER_DEBUG User-Agent: SFDC-Callout/25.0

18:19:43:000 USER_DEBUG Accept: text/xml;charset=utf-8

18:19:43:000 USER_DEBUG Host: localhost:8080

18:19:43:000 USER_DEBUG Via: 1.1 proxy-chi.net.salesforce.com:8080 (squid)

18:19:43:000 USER_DEBUG X-Forwarded-For: 10.232.12.20

18:19:43:000 USER_DEBUG Cache-Control: max-age=259200

18:19:43:000 USER_DEBUG Connection: keep-alive

 

Hello,

I'm a Java jbilling developer and I'm new to the salesforce platform. we have started a project in our company to integrate JBilling with salesforce.basically the integration will consist of listeneing to SF events like a lead has been converted etc..and when these SF events are triggered i should then contact Jbilling to do Jbilling tasks based on SF events.

I did some research and discovered the Force.com platform which could be used to develop Force.com Apps deployable and installable in SF.

I still can't make a descision what is the best option to implement this integration. I thought of two options:

1- Develop a Force.com App that talks to JBilling webservice API

2-Develop a pure Java client that talks both to SF webservice API and JBilling webservice API.

while i prefer the second option b/c i'm basically a Java developer and want to avoid the learning curve of the Force.com platform ; i have concerns & questions about the second option:

-is it possible to implement pure Java Listeners for SF events (like a lead has been converted etc..)

-can i do all logic in pure java without configuring SF with workflows etc..

 

I would like some guidelines how to approach this integration. I would like to avoid using the Force.com App if possible and use pure Java client. but i'm not sure if pure java client would be able to listen and capture SF workflows (events) without having to manually configure SF .

 

thanks for your time & help