我应该使用第三方公开的 SOAP 服务。我有两个基本问题:
Q1。WSDL 需要基本身份验证才能通过浏览器进行访问。现在,当我尝试wsgen/WSDL2JAVA/
使用Eclipse Webservice
客户端创建客户端 jar 时,我得到HTTP 401 unauthorised
. 如果我在本地下载并保存 WSDL 然后使用axis's WSDL2JAVA
,我会得到
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.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: Problem parsing 'file:/C:/TEST/TOOLS/Authentication.wsdl'.: org.xml.sax.SAXParseException: The prefix "wsdl" for element "wsdl:definitions" is not bound.
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>(CodeGenerationEngine.java:133)
... 2 more
Caused by: org.xml.sax.SAXParseException: The prefix "wsdl" for element "wsdl:definitions" is not bound.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
... 7 more
Q2。我们如何处理频繁更改的 WSDL,我们是否每次都生成客户端 jar 并重新部署应用程序?
帮助我创建的任何指示client.jar
都会很棒。