开发者

Importing a WebService:

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">
<soapenv:Header/>
   <s开发者_运维知识库oapenv: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/">
  <soap:Body>
    <getRegistryResponse xmlns="http://www.biomart.org:80/MartServiceSoap">
      <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


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());
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜