Maybe this is a daft suggestion, but why not just download the wsdl using your web browser and then run wsdl2java using the downloaded copy of the wsdl? On Jan 9, 2012 3:03 PM, "Andrew Cheung" <andrew.che...@brookfieldrps.com> wrote:
> Hi, all. I’m using Axis 2 version 1.6.1 (wsdl2java command specifically) > to generate code for a .NET web service. This .NET web service has > auto-detect cookie support turned on (this is hosted at a third party > vendor’s server whose settings we have no control over). I got the > following error message when I use the following command :**** > > ** ** > > Command : %AXIS2_HOME%/bin/wsdl2java -ss -g -uri > https://www.myvendor.com/myPath/abc.asmx?wsdl**** > > ** ** > > Error message below:**** > > ** ** > > Using AXIS2_HOME: E:\Software\ApacheAxis2-1.6.1\axis2-1.6.1**** > > Using JAVA_HOME: C:\Program Files\Java\jdk1.6.0_21\**** > > Retrieving document at > '/myPath/abc.asmx?wsdl&AspxAutoDetectCookieSupport=1'.**** > > log4j:WARN No appenders could be found for logger > (org.apache.axis2.i18n.Project**** > > ResourceBundle).**** > > log4j:WARN Please initialize the log4j system properly.**** > > Exception in thread "main" > org.apache.axis2.wsdl.codegen.CodeGenerationException**** > > : Error parsing WSDL**** > > at > org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat**** > > ionEngine.java:178)**** > > at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)**** > > at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)**** > > Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: > Unabl**** > > e to resolve imported document at '/myPath/abc.asmx?wsdl&**** > > AspxAutoDetectCookieSupport=1'.: java.io.FileNotFoundException: This file > was no**** > > t found: file:/C:/myPath/abc.asmx?wsdl&AspxAutoDetectCook**** > > ieSupport=1**** > > at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)**** > > at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)**** > > at > org.apache.axis2.wsdl.codegen.CodeGenerationEngine.readInTheWSDLFile(**** > > CodeGenerationEngine.java:320)**** > > at > org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat**** > > ionEngine.java:133)**** > > ... 2 more**** > > Caused by: java.io.FileNotFoundException: This file was not found: > file:/C:/myPath/abc.asmx?wsdl&AspxAutoDetectCookieSupport=1**** > > at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown > Source)**** > > ** ** > > ... 6 more**** > > ** ** > > The wsdl file is present if I use a browser to open the url “ > https://www.myvendor.com/myPath/abc.asmx?wsdl”**** > > ** ** > > I got the same error messages if I use the command > “%AXIS2_HOME%/bin/wsdl2java -ss -g -uri > https://www.myvendor.com/myPath/abc.asmx?wsdl&AspxAutoDetectCookieSupport=1” > as well.**** > > ** ** > > In another scenario, if I use the following command, I’ll get the > following error message:**** > > ** ** > > Command : %AXIS2_HOME%/bin/wsdl2java -ss -g -uri > https://www.myvendor.com/myPath/abc.asmx?AspxAutoDetectCookieSupport=1**** > > ** ** > > Error message:**** > > Using AXIS2_HOME: E:\Software\ApacheAxis2-1.6.1\axis2-1.6.1**** > > Using JAVA_HOME: C:\Program Files\Java\jdk1.6.0_21\**** > > Retrieving document at 'https://www.myvendor.com/myPath/abc.asm**** > > x?AspxAutoDetectCookieSupport=1'.**** > > [Fatal Error] abc.asmx?AspxAutoDetectCookieSupport=1:59:19: The elemen**** > > t type "br" must be terminated by the matching end-tag "</br>".**** > > log4j:WARN No appenders could be found for logger > (org.apache.axis2.i18n.Project**** > > ResourceBundle).**** > > log4j:WARN Please initialize the log4j system properly.**** > > Exception in thread "main" > org.apache.axis2.wsdl.codegen.CodeGenerationException**** > > : Error parsing WSDL**** > > at > org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat**** > > ionEngine.java:178)**** > > at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)**** > > at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)**** > > Caused by: javax.wsdl.WSDLException: WSDLException: > faultCode=PARSER_ERROR: Prob**** > > lem parsing 'https://www.myvendor.com/myPath/abc.asmx?AspxAutoD**** > > etectCookieSupport=1'.: org.xml.sax.SAXParseException: The element type > "br" mus**** > > t be terminated by the matching end-tag "</br>".**** > > at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)**** > > at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)**** > > at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)**** > > at > org.apache.axis2.wsdl.codegen.CodeGenerationEngine.readInTheWSDLFile(**** > > CodeGenerationEngine.java:320)**** > > at > org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerat**** > > ionEngine.java:133)**** > > ... 2 more**** > > Caused by: org.xml.sax.SAXParseException: The element type "br" must be > terminat**** > > ed by the matching end-tag "</br>".**** > > at > com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.**** > > java:249)**** > > at > com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Doc**** > > umentBuilderImpl.java:284)**** > > ... 7 more**** > > ** ** > > How should I generate the files properly in this case? Any help is > appreciated.**** > > ** ** > > -Andrew**** > > ** ** >