Question

I used the example code "Using WebEnv & QueryKey example" from http://www.ncbi.nlm.nih.gov/books/NBK55696/ - the ESearch part seems to work fine, but not EFetch. I added the command "e.printStackTrace()" to get the full error message:

WebEnv: NCID_1_160921978_130.14.18.34_9001_1392822285_1227953195  
QueryKey: 1

org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_pubmed}Affiliation  
org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_pubmed}Affiliation  
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)  
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub.fromOM(EFetchPubmedServiceStub.java)  
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub.run_eFetch(EFetchPubmedServiceStub.java:190)  
at preparation.Client.main(Client.java:39)  
Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_pubmed}Affiliation  
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$AuthorType$Factory.parse(EFetchPubmedServiceStub.java:47561)  
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$AuthorListType$Factory.parse(EFetchPubmedServiceStub.java:12284)  
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$ArticleType$Factory.parse(EFetchPubmedServiceStub.java)  
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$MedlineCitationType$Factory.parse(EFetchPubmedServiceStub.java:27035)  
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$PubmedArticleType$Factory.parse(EFetchPubmedServiceStub.java:17841)  
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$PubmedArticleSetChoiceE$Factory.parse(EFetchPubmedServiceStub.java)  
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$PubmedArticleSet_type0$Factory.parse(EFetchPubmedServiceStub.java:54143)  
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$EFetchResult$Factory.parse(EFetchPubmedServiceStub.java:48494)  
... 3 more  
Caused by: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://www.ncbi.nlm.nih.gov/soap/eutils/efetch_pubmed}Affiliation  
at gov.nih.nlm.ncbi.www.soap.eutils.EFetchPubmedServiceStub$AuthorType$Factory.parse(EFetchPubmedServiceStub.java:47555)  
... 10 more  

I am using Eclipse (Version: 3.7.2) with Ubuntu 12.04 LTS and java-7-openjdk-amd64 as JRE. The NCBI page mentions to use this command before runnning Client.java:

wsdl2java -uri http://eutils.ncbi.nlm.nih.gov/soap/v2.0/efetch_pubmed.wsdl

Instead of that, I simply included the jar files (only binaries) that have been shown as output in console, because this worked fine for all other exapmles on http://www.ncbi.nlm.nih.gov/books/NBK55696/ except the ELink example:

org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://www.ncbi.nlm.nih.gov/soap/eutils/elink}error 

I will describe which jar files I included in my project.

As the FTP link for downloading eutils_axis2.jar on the above mentioned page did not work, I searched for the current path and added it to my Eclipse project.
Their README says that JDK version 7.0.45 and Axis2 version 1.6.2 should be used and that it was released in December 2013.

I searched for "download wsdl2java.sh" in Google to get the Axis2 version in connection to WSDL and found the package axis2-eclipse-service-plugin-1.6.2.zip . I downloaded the package and added all jar files to my project:

apache-mime4j-core-0.7.2.jar  
axiom-api-1.2.13.jar  
axiom-impl-1.2.13.jar  
axis2-adb-1.6.2.jar  
axis2-codegen-1.6.2.jar  
axis2-kernel-1.6.2.jar  
commons-codec-1.3.jar  
commons-fileupload-1.2.jar  
commons-httpclient-3.1.jar  
geronimo-jta_1.1_spec-1.1.jar  
geronimo-ws-metadata_2.0_spec-1.1.2.jar  
jaxen-1.1.1.jar  
jsr311-api-1.0.jar  
neethi-3.0.2.jar  
servlet-api-2.3.jar  
woden-api-1.0M9.jar  
woden-impl-commons-1.0M9.jar  
woden-impl-dom-1.0M9.jar  
wsdl4j-1.6.2.jar  
XmlSchema-1.4.7.jar  

Then I searched the packages for the remaining error messages:

axis2-transport-http-1.6.2.jar  
axis2-transport-local-1.6.2.jar   
commons-logging-1.1.3.jar  
geronimo-javamail_1.4_spec-1.7.1.jar  
httpcore-4.3.2.jar  

I searched for similar cases with Google, but I did not find a solution. How can I fix this message mentioned at the beginning?

Was it helpful?

Solution

The corresponding wsdl file mentioned in the NCBI tutorial is from 2010. Maybe it is outdated, but first, be sure that creating the specified java classes works fine. Do the following steps result in an error?

Download and extract axis2-1.6.2.

Set the environment variables

export AXIS2_HOME=<path/to/axis2-1.6.2>
export JAVA_HOME=<path/to/java-7-openjdk-amd64>

Download the following files

http://eutils.ncbi.nlm.nih.gov/soap/v2.0/efetch_pubmed.xsd
http://eutils.ncbi.nlm.nih.gov/soap/v2.0/efetch_db_pubmed.xsd
http://eutils.ncbi.nlm.nih.gov/soap/v2.0/efetch_pubmed.wsdl

and execute bin/wsdl2java.sh within the axis2-1.6.2 directory using the efetch_pubmed.wsdl file.

sh wsdl2java.sh -uri <path/to/efetch_pubmed.wsdl>

Two java classes should appear in

src/gov/nih/nlm/ncbi/www/soap/eutils

(still in your axis/bin directory). Import and use these files with your Client.java (pointing to the filename in the tutorial).

Works fine for me. Hope that helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top