简体   繁体   中英

Calling .net Webservice from Java using WSDL

I am trying to call webservice in .net using it's wsdl from Java. I am trying to create Client stub using Apache Axis 2 in eclipse Galileo SR2. Same exception with Netbean 6.9.

I have "AddOrgService" method overloaded in webservice. Looks like it is creating a problem.

What could be the solution?

But I am getting following exception :

IWAB0399E Error in generating Java from WSDL:  java.lang.IllegalArgumentException: Duplicate 

operation with name=AddOrgService, found in portType 

'{http://ensim.com/unifyws/Exchange2K7WS}ExchangeManagerSoap'.
    java.lang.IllegalArgumentException: Duplicate operation with name=AddOrgService, found 

in portType '{http://ensim.com/unifyws/Exchange2K7WS}ExchangeManagerSoap'.
    at com.ibm.wsdl.PortTypeImpl.getOperation(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseBindingOperation(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseBinding(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:516)
    at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
    at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
    at java.lang.Thread.run(Unknown Source)

I don't think SOAP allows for multiple operations with the same name (which would be the result of overloading methods in a .NET webservice). Either give the methods different names, or use attributes to make .NET create different operation names on the SOAP side without changing the method name itself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM