2010-01-18 51 views
1

我想使用wsdl2java.bat生成存根,我的wsdl由兩個綁定組成。我看到wsdl2bat在第一個綁定中爲操作創建接口,但不會爲秒綁定中的操作生成任何內容。 wsdl2java.bat -uri http:// ... -o client -d adb -s -u。Axis wsdl2java沒有生成存根中的所有接口

例如,代碼應該是這樣的

try { 
    //Create the stub by passing the AXIS_HOME and target EPR. 
    //We pass null to the AXIS_HOME and hence the stub will use the current directory as the AXIS_HOME 
    Axis2SampleDocLitPortTypeStub stub= new Axis2SampleDocLitPortTypeStub(null, 
           "http://localhost:8080/axis2/services/Axis2SampleStub"); 
    //Create the request document to be sent. 
    EchoString reqDoc= EchoString.Factory.newInstance(); 
    reqDoc.setEchoString("Echo this"); 
    //invokes the Web service. 
    EchoStringReturn resDoc=stub.echoString(reqDoc); 
    System.out.println(resDoc.getEchoStringReturn()); 

    } catch (Exception e) { 
     e.printStackTrace(); 
    } 

這裏的問題是,我看到一個方法getEchoStringReturn存根的resDoc實例。

回答

0

易一個是::

E:\使用\罐子\軸罐子>設置類路徑=%類路徑%;軸-1.4.jar;軸的ant.jar;軸1.4.jar;公地發現-0.5.jar;共享記錄-API-1.1.1.jar; JAXRPC-api.jar文件; log4j的-1.2.jar; org.apache.commons.logging.jar;沒有saaj.jar; WSDL4J-1.5。 1.jar;

然後::

E:\使用\罐子\軸罐子>的java org.apache.axis.wsdl.WSDL2Java -N 「甕:/ crmondemand/XML /聯繫/數據」=「crmondemand。 xml.Contact.Data「-N」urn:/ crmondemand/xml/Contact/Query「=」crmondemand.xml.Contact.Query「-N」urn:crmondemand/ws/ecbs/contact/10/2004「=」crmondemand 「.ws.ecbs.contact」-o E:\ use \ test2「Contact1.wsdl」

1

我認爲你給出的代碼片段是指xmlbeans數據綁定而不是adb。當使用數據綁定ADB你不必創建一個請求文檔等等等等

好吧,我知道這可能不會解決你的問題,但我認爲這是很好的提...

我有同樣的問題,如果我找到解決方案,我會讓你知道

+0

這應該可能是一個評論而不是答案,但我看到你還沒有足夠的聲望發表評論.. .. – 2012-12-15 07:00:01

相關問題