views:

56

answers:

1

Hi all, I'm trying to import the following web service: http://www.biomart.org/biomart/martwsdl

Using curl for the service getResistry() : everything is OK:

curl --header 'Content-Type: text/xml' --data '<?xml version="1.0"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mar="http://www.biomart.org:80/MartServiceSoap"&gt;
<soapenv:Header/>
   <soapenv:Body>
      <mar:getRegistry/>
   </soapenv:Body>
</soapenv:Envelope>' http://www.biomart.org:80/biomart/martsoap

it returns:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.o
rg/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/
envelope/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;
  <soap:Body>
    <getRegistryResponse xmlns="http://www.biomart.org:80/MartServiceSoap"&gt;
      <mart>
        <name xsi:type="xsd:string">ensembl</name>
        <displayName xsi:type="xsd:string">ENSEMBL GENES 57 (SANGER UK)</displayName>
        <database xsi:type="xsd:string">ensembl_mart_57</database>
(...)

OK.

But when this service is generated using CXF/wsdl2java ( or even wsimport)

mkdir src
wsdl2java -keep -d src -client "http://www.biomart.org/biomart/martwsdl"
javac -g -d src -sourcepath src src/org/biomart/_80/martservicesoap/MartServiceSoap_BioMartSoapPort_Client.java
java -cp src org.biomart._80.martservicesoap.MartServiceSoap_BioMartSoapPort_Client

the generated client returns an empty list for getRegistry():

Invoking getRegistry...
getRegistry.result=[]

why ? what should I do, to make this code work ?

Many thanks

Pierre

A: 

In the client class have a main method in which you invoke getRegistry operation.

It may look like this

MartServiceSoap_BioMartSoapPort_Client client = new MartServiceSoap_BioMartSoapPort_Client();
System.out.println(client.getRegistry());
shivaspk
shivaspk
sorry but the client genrated by CXF/wsdl2java **does** generate a **main** method and the code contains a call to getRegistry(). java.util.List<org.biomart._80.martservicesoap.Mart> _getRegistry__return = port.getRegistry();System.out.println("getRegistry.result=" + _getRegistry__return);
Pierre