Pubmed Web Service Deserializing Error In C#
2
0
Entering edit mode
13.0 years ago
chi-hawk ▴ 10

I have a web service setup with the following address: http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/v2.0/efetch_snp.wsdl

The confiruration in app.config is as follows:

<binding name="eUtilsServiceSoap3" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="999999999" maxBufferPoolSize="524288" maxReceivedMessageSize="999999999" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
    <readerQuotas maxDepth="32" maxStringContentLength="999999999" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
    <security mode="None">
    <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
    <message clientCredentialType="UserName" algorithmSuite="Default"/>
    </security>
</binding>
...
<endpoint address="&lt;a href=" http:="" eutils.ncbi.nlm.nih.gov="" soap="" v2.0="" soap_adapter_2_0.cgi?db="snp" "="" rel="nofollow">http://eutils.ncbi.nlm.nih.gov/soap/v2.0/soap_adapter_2_0.cgi?db=snp"
    binding="basicHttpBinding" bindingConfiguration="eUtilsServiceSoap3"
    contract="PubMedWebServiceEfetch_snp.eUtilsServiceSoap" name="eUtilsServiceSoap3" />

I run the code as follows:

PubMedWebServiceEfetch_snp.eUtilsServiceSoapClient snpServer = new PubMedWebServiceEfetch_snp.eUtilsServiceSoapClient();
PubMedWebServiceEfetch_snp.eFetchRequest snpRequest = new PubMedWebServiceEfetch_snp.eFetchRequest();
snpRequest.id = "1870372";
PubMedWebServiceEfetch_snp.eFetchResult snpResult = snpServer.run_eFetch(snpRequest);
PubMedWebServiceEfetch_snp.ExchangeSet snpInfoFromSnpResult = snpResult.ExchangeSet; 
...

If I run the code with the id = "1870377" it will return and I can access the information in the "ExchangeSet". If I use "1870372" (as in the example above) I get the following error:

Error in deserializing body of reply message for operation 'run_eFetch'.

Upon further investigaion of the inner error message in C# I find that it says:

{"Instance validation error: 'intron-variant' is not a valid value for FxnSetFxnClass."}

Has anyone else found this error? As you can see, I tried to up the maxBufferSize, maxReceivedMessageSize, and maxStringContentLength. You can also see from this page what should be returned: http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=SNP&id=1870372

I appreciate any help on ways to avoid this error.

pubmed webservice c • 4.8k views
ADD COMMENT
1
Entering edit mode
13.0 years ago

I think the problem comes from the NCBI. The XSD schema associated to :

http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=SNP&id=1870372&rettype=xml

is

ftp://ftp.ncbi.nlm.nih.gov/snp/specs/docsum_3.1.xsd

but the latest schema is:

ftp://ftp.ncbi.nlm.nih.gov/snp/specs/docsum_3.3.xsd

it contains the following enum that doesn't exist in 3.1:

(...)
<xsd:enumeration value="intron-variant">
(...)
ADD COMMENT
1
Entering edit mode

@Pierre - thank you for this. Great explanation. I am contacting PubMed in hopes they can resolve this issue. I will post when I hear more.

ADD REPLY
0
Entering edit mode
13.0 years ago
Chris Maloney ▴ 360

I agree that it is a bug. As Pierre points out, the XML returned by the URI he gives is not valid according to the XSD schema referenced in the returned document. You can send an email to eutilities@ncbi.nlm.nih.gov to submit this as a bug report.

ADD COMMENT
0
Entering edit mode

This is the reply I received from NIH on 1/23/2012:

Hi, Thanks for sending your feedback to us.

Discussing this with our developers, the decision is not to patch this up since the new released (version 2.5) will be available in a few weeks.

We sincerely apologize for the inconvenience.

ADD REPLY
0
Entering edit mode

Seems to be fixed now.

ADD REPLY

Login before adding your answer.

Traffic: 1944 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6