JAXB Naming Collision Salesforce Integration - salesforce

I'm attempting to integrate with Salesforce using MyEclipse. The wizard fails because of a naming collision on a complex type "DescribeLayout". I need to write a JAXB binding file to ensure that the two interfaces that are created by the xjc compiler are in different packages, but I have absolutely no idea how to do this.
I do not have the URI's to the schemas that make up the WSDL, only the URN's.

This blog post shows how to append a suffix to type names to avoid this. I'm not a JAXB expert, but presumably there is a way to configure it to use a different package instead of a suffix.
http://blog.teamlazerbeez.com/2009/05/23/salesforcecom-partner-soap-api-jax-ws-tutorial-part-1/

Related

Programmatically getting Apache Camel components operations, parameters, options decriptions

Is there a way to get any Apache Camel component "metadata" using Java code, like the list of options and other parameters and their types? I think some automatic help builder was mentioned somewhere that might be of use for this task without using reflection.
A way to get the registered components of all types (including data formats and languages) with java code is also sought. Thanks
Yeah take a look at the camel-catalog JAR which includes all such details. This JAR is what the tooling uses such as some of the Maven tooling itself, or IDE plugs for IntelliJ or Eclipse etc. The JAR has both Java API and metadata files embedded in the JAR you can load.
At runtime you can also access this catalog via RuntimeCamelCatalog which you can access via CamelContext. The runtime catalog is a little bit more limited than CamelCatalog as it has a view of what actually is available at runtime in the current Camel application.
Also I cover this in my book Camel in Action 2nd edition where there is a full chapter devoted on Camel tooling and how to build custom tooling etc.
This is what I've found so far
http://camel.apache.org/componentconfiguration.html

Custom UIMA annotators in IBM Watson Retrieve&Rank

Is it possible to use custom uima annotators in Retrieve&Rank service?
How can I upload my custom annotator (packaged as jar file) to the service?
I need to create an entity annotator to discover my custom domain entities.
I don't think there is an obvious straightforward way to use a custom UIMA annotator in R&R.
Possible approaches you could use, if you want to try integrating the two though:
Use a UIMA pipeline to annotate your documents before storing them in R&R, or as you query R&R for them. I've not tried this myself, but I've seen references to this sort of thing - e.g. http://wiki.apache.org/solr/SolrUIMA so there might be some value in trying this
Use the annotations from your UIMA pipeline to generate additional feature scores that the ranker you train can include in it's training. For example, if your annotator detects the presence or absence of a particular custom domain entity, it could turn this into a score that contributes to the feature scores for a search result. For an example of contributing custom feature scorers to R&R, see https://github.com/watson-developer-cloud/answer-retrieval

Creating JPA from database

I know this is a duplicate question.
But even i couldn't find any tool to create JPA entity file from database source.
I used eclipse to do this. I only got DTO kind of classes with getters & setters.
Can anyone suggest some tools that create DAO files too.
TIA
You can use Telosys Tools,
an Eclipse plugin working from an existing database with customizable Velocity templates
See: https://sites.google.com/site/telosystools/
Eclipse Marketplace : http://marketplace.eclipse.org/content/telosys-tools
For JPA generation, use the JPA set of templates available on GitHub : https://github.com/telosys-tools
you can use netbeans instead of eclipse. After you create own project, you can select "JPA controller classes from entity classes" in netbeans menu. For example http://ensode.net/roller/dheffelfinger/entry/automated_dao_generation_from_jpa
Minuteproject is a generator tool and can generate JPA2 artifacts from Database.
You can instruct the generator to apply convention for your java code that do not follow your DB convention, but the mapping will be correct. (Example strip DB name prefix; table starting with ADMIN_ such as ADMIN_ENVIRONMENT are Environment (w/out Admin) as java class) For the moment there 20+ conventions that help you reshape your model to be less DB look-and-feel by more Java-OO-friendly.
If you want DAO minuteproject has a track BSLA that generate spring-integrated DAO

Will Service Reference from Sandbox WSDL work on Production endpoint given there are some differences between the two environments?

Let's say I have both the Production and Sandbox environments.
There are differences between the two - let's just say Sandbox has more modules installed, or the other way around.
I then generate a WSDL from Sandbox, add the Service Reference based on that WSDL and proceed to code up my application in .NET. The .NET application however uses only the methods which would be common to both Sandbox and Production environments, such as login(), query(), using the standard objects such as Lead etc.
Can I simply change the endpoint to point to Production and expect what I coded to work?
Yes. If the methods you are calling has same signature in both environment, nothing will cause the problem. If you alter the signature of the methods in service contract, that will cause runtime exception.
Also I would like to comment, if you change (ONLY addition of new members) the data contracts for these Service Methods, it will also work fine. For this to work, your service needs allow ExtensionDataObject. Any extra data from client will be stored in this object on the server.
Hope it answers your question.
As far as I'm aware, if you're only dealing with the standard API calls then yes, changing the end point should be enough. Of course you need to make sure you use the appropriate credentials and security token too!
When you create extra webservices via apex, they have their own WSDL to describe them — if you're using one of those then it should be the same for both environments if the methods are the same. As for custom objects etc., they're supported by the standard WSDLs.
For the sake of completeness, the Partner.wsdl is designed for connecting to different orgs rather than a specific one, so it is identical across environments and it's loosely typed, this may be the best one for your purposes.
A loosely typed WSDL for customers, partners, and ISVs who are building client applications for multiple organizations. It can be used to access data within any organization.

Creating a RDF in Jython

How do we create RDF database in Jython? I use this to implement SparQL in Jython. So I need to create the database first.
See RDFAlchemyJython for reusing most well known Java tools for RDF and SPARQL in Jython; or go for RDFLIB, a wide spread RDF and SPARQL framework for Python.
I was going to say use the Jena libs, but msalvadores got there already, check the RDFAlchemyJython link. I'll add that it is pretty straightforward, just use them like you would any other Java libs in Jython.
TDB is probably the best bet for a SPARQLable database, see:
https://jena.apache.org/documentation/tdb/java_api.html
Just put the libs on your classpath, tweak the code to be js not Java.

Resources