+ Start a Discussion

Unable to bind (javax.xml.bind.JAXBElement@10014f0)

I am executing queries via the api with java code and I am getting the right results and everything works as it is suppose to however and I do obj.getName() I am not seeing string object, but rather the following ( javax.xml.bind.JAXBElement@10014f0)

Any ideas....it seems that there is something to do with the way I am binding I am using the sample enterprise java quickstart

Thank you.
AFAIK, Axis 1.4 doesn't use JaxB, so i don't know where that's coming from, are you sure you're using a stub generated with axis 1.4 ?

When using JAX-WS there is an option you can provide in your binding file to tell wsimport to genearate simple properties (ie Strings not JAXBElement<String>)


for example;


Create a file called MyBindings.xml 

<jxb:bindings version="2.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <jxb:globalBindings generateElementProperty="false" /> </jxb:bindings>


Then execute something like this;

wsimport -p com.salesforce.stub -d bin -s src -B-XautoNameResolution -b MyBindings.xml partner.wsdl


This may be a litt late for kminev, but maybe it will help someone else.