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
othmaneothmane 

JBilling integration with SF

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

 

Nimble TedNimble Ted

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

 

Yes. 

 

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

 

No. 

 

SF doesn't expose events natively. A workflow is needed to construct an outbound message for the listener. The listener can also respond back to SF as part of the same transaction, but a SF workflow is needed to kick-off the process. 

 

http://tedhusted.blogspot.com/2012/03/unloading-salesforce-crm-data-with.html

 

There is also a data replication API, which may or may not provide sufficient utility. 

 

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_guidelines_datareplication.htm

 

Though, the workflow/messaging approach provides superior response and granularity.

 

-Ted.


othmaneothmane

Thanks Ted for prompt response,

In fact I would like this integration to be self contained and not dependent on any particular setup that a specific SF or jbilling customer has. In other words, I would like later to be able to sell and deploy this integration module to other customers.

In your opinion should i Develop this integration as a Force.com App that i can package and redistribute?

if yes , i suppose i will configure the workflows/messaging inside my Force.com App? I would like to enable users of my Force.com App to configure the workflow themselves (they will need to specify their own jbilling webservice url etc..). should i build a Force.com UI to enable users to configure the workflows and then bind these workflows to jbilling API?

I suppose building a Force.com App is the way to go for this integration -what you propose?

Nimble TedNimble Ted

Workflow and outbound messages are standard Salesforce components. Given the endpoint that you would provide, any Salesforce adminsitrator can configure workflow and outbound messages. That part of the integration is trivial, and it would not require a Force.com app per se. It's just a set of configuration points. 

 

The listener would need to implement the Salesforce notification interface, but it could act as a facade for a standard API being shared by other integrations. 

 

A standard workflow can invoke an outbound message sent to a listener implementing the notification interface, and it can then call back if needed. 

 

http://www.salesforce.com/us/developer/docs/workbook/index.htm

 

othmaneothmane

Nimble Ted wrote:

Workflow and outbound messages are standard Salesforce components. Given the endpoint that you would provide, any Salesforce adminsitrator can configure workflow and outbound messages. That part of the integration is trivial, and it would not require a Force.com app per se. It's just a set of configuration points. 

 

The listener would need to implement the Salesforce notification interface, but it could act as a facade for a standard API being shared by other integrations. 

 

A standard workflow can invoke an outbound message sent to a listener implementing the notification interface, and it can then call back if needed. 

 

http://www.salesforce.com/us/developer/docs/workbook/index.htm

 


I'm thinking to implement my SF notification java listener as a java Message bean. this is b/c we want it to be part of jbilling system which is a Java EE web application with grails front end. is it possible to implement the SF notification listener as a Java Message bean?

thanks

othmaneothmane

if i understand well, for every workflow rule defined by a SF admin there will be a WSDL file that i will need to download and use to generate the java client stubs to write the java listener . is that correct?

 

if yes , is there a way to automate this process? we want a packages distributed app with minimal config that could be used for jbilling and SF integration. i suppose we need to write some scripts to auto-generate the java client stubs given the name of wsdl file?

as i explained we want a self contained app at the end. that could be deployed to customer with minimal config.

how would you approach this issue?

Nimble TedNimble Ted

The outbound message is just a SOAP call. Any technology that can consume a SOAP message would be fine. 

 

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_om_outboundmessaging_listener.htm

 

Multiple workflows could resolve to the same outbound message. 

 

Workflow and outbound messages can be packaged.

 

http://www.salesforce.com/us/developer/docs/workbook_isv/index.htm

 

 

othmaneothmane

Thank you Ted for help.

yet i still didn't get a response how you would opt to implement this jbilling/SF integration?would you do it as a configured integration using outbound messaging feature ? would it be necessary to build a new Force.com App that encapsulates UI and business logic for this integration?

 

thanks.

Nimble TedNimble Ted

The best option would be to prototype some code and decide for yourself. Most force.com apps are a set of pre-configured components, with a sprinkling of code. The options are not as black and white as your original post implies. 

othmaneothmane

Nimble Ted wrote:

The best option would be to prototype some code and decide for yourself. Most force.com apps are a set of pre-configured components, with a sprinkling of code. The options are not as black and white as your original post implies. 


Thank you. i will do more research & reading to come up with best way to implement SF integration with jbilling.

thank you for helpful information you kindely provided

othmanothman

Hi again,

when i tried the workflow /outbound messaging method i discovered it is not appropiate for this Task:

if i create a workflow rule on Object "Lead" then the outbounding message will send a soap message with Lead fields . but the jbilling system is not aware of this "Lead" Object so jbilling WS will not undestand the SOAP message sent when workflow lead convetred is triggered.

do you know how i can overcome this issue? should i build apex classes or Force.com custom objects that maps to jbilling WS classes? 

better , is there a way i can do the jbilling WS callout from  apex code directly without configuring an outbound message ? could apex call an external WS provided the url , credentials and ws method ?

I hope my question does makes sense.

 

thanks.

othmanothman

note : othman is same user as othmane . sorry for this inconveniece!

 

what i meant by last post is that our jbilling webservice is built already and we can't download the wsdl from outbound message and make a new ws . it is difficult to add this new service created from outboud message wsdl into our existing jbilling ws.

does this makes sense? if yes what you propose i do in this case?

 

thanks.

othmanothman

othman wrote:

note : othman is same user as othmane . sorry for this inconveniece!

 

what i meant by last post is that our jbilling webservice is built already and we can't download the wsdl from outbound message and make a new ws . it is difficult to add this new service created from outboud message wsdl into our existing jbilling ws.

does this makes sense? if yes what you propose i do in this case?

 

thanks.


i suppose we will need to create a Facade ws to serve as intermediary between SF and our jbilling WS. right? is there any other solution ?

Nimble TedNimble Ted

If it were me, I would find a prospective customer who is using Salesforce and wants to use this billing system, and be sure whatever is built will meet the business needs. A Salesforce business user or admnistrator is the one who should determine if the system should utilize existing fields or define its own custom fields. 

othmaneothmane

Nimble Ted wrote:

If it were me, I would find a prospective customer who is using Salesforce and wants to use this billing system, and be sure whatever is built will meet the business needs. A Salesforce business user or admnistrator is the one who should determine if the system should utilize existing fields or define its own custom fields. 


Ok.

I'm surprised how the Force.com Integration mechanism is restrictive and not flexible! maybe b/c i'm new to Force.com i still can't figure out the right way to call jbilling ws from Force.com. i thought it was as simple as connecting to jbilling ws with a url , username and password. isn't it possible to write an Apex class that connects to remote jbilling ws programatically using the ws url and credentials?

It's weired how i can't figure out how to do this simple task!

othmaneothmane

maybe if i feed the jbilling.wsdl file Force.com could generate Apex classes that i could use to call jbilling ws. Is this solution good? i read somewhere it is not reliable as the wsdl2apex generation fails in some cases if the wsdl file is not well understood by Force.com. i actually tried generating apex classes from jbilling wsdl file and it gives this error:



Error: Failed to parse wsdl: Unknown element: import
othmaneothmane

Hi,

do you know how i can format the below wsdl file so that Force.com could parse it without errors?

 

 the jbilling.wsdl file is shared in gdocs at this link: https://docs.google.com/open?id=0ByfoCNegjN7zZFUtZkZCZEJBU0U

the referenced IWebServicesSessionBean.wsdl file is at link : https://docs.google.com/open?id=0ByfoCNegjN7zRUFoRG1Sc05SVWs

 

 how can i edit manually this jbilling.wsdl file so SF parses it correctly?

 

 the SF WSDL2Apex  parser is very limited and it can't handle many of the wsdl files! (see this : http://www.grigsbyconsulting.com/Postings/dgrigsbyFieldNotesSeries.aspx )

 

I'm again surprised about this! How can we do serious integration with all these limitations! .

if you don't agree that Force.com disadvantages are numerous and serious , take a look at this discussion in SO : http://stackoverflow.com/q/1664503/497984

 

here is a challenging exercise: write a java utility that parses the webservice data and publish the schema based on SFDC requirements of schema.

is there anyone who has an idea how to write a java method to re-generate a new schema wsdl that is accepted by SF?

 

thanks.