鉴于wsdl无法创建java客户端

时间:2015-08-20 15:45:01

标签: java web-services wsdl client nusoap

从nusoap生成的wsdl创建java客户端时遇到问题 链接到wdsl是heredropbox link 到目前为止我尝试了什么: 1.使用wsimport,错误消息:

 wsimport http://118.96.57.189:8883/ws/sandbox.php?wsdl
 parsing WSDL...


[ERROR] "Use of SOAP Encoding is not supported. 
SOAP extension element on line 245 in http://118.96.57.189:8883/ws/sandbox.php?wsdl has use="encoded" "


Failed to parse the WSDL.

2。使用eclipse axis2,成功并创建了2个类:    blablaHandler.java& blablablstubs.java    我运行时的代码:

WSPDDIKTIStub stub = new WSPDDIKTIStub();
GetToken gt = new GetToken();
gt.setUsername("031031");;
gt.setPassword("54ty494m4");
GetTokenResponse gtr = stub.getToken(gt); -- error occure here
.
.

ERROR msg :

 type Exception report
 message javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,329]

 description The server encountered an internal error that prevented it from fulfilling this request.

 exception
 org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,329]
 Message: http://www.w3.org/TR/1999/REC-xml-names-19990114#EmptyPrefixedAttName?prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:276)
org.apache.axiom.om.impl.llom.OMContainerHelper.buildNext(OMContainerHelper.java:164)
org.apache.axiom.om.impl.llom.OMContainerHelper.getFirstOMChild(OMContainerHelper.java:182)
org.apache.axiom.om.impl.llom.OMElementImpl.getFirstOMChild(OMElementImpl.java:643)
org.apache.axiom.om.impl.llom.OMElementImpl.getFirstElement(OMElementImpl.java:806)
org.apache.axiom.soap.impl.llom.SOAPBodyImpl.hasFault(SOAPBodyImpl.java:99)
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.hasFault(SOAPEnvelopeImpl.java:292)
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:372)
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
_105._1._168._192.soap.wspddikti.WSPDDIKTIStub.getToken(WSPDDIKTIStub.java:1760)
servlet.pdpt.feeder.Main.doGet(Main.java:46)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

root cause
javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,329]
Message: http://www.w3.org/TR/1999/REC-xml-names-19990114#EmptyPrefixedAttName?prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"
com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:598)
org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:34)
org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
org.apache.axiom.util.stax.dialect.SJSXPStreamReaderWrapper.next(SJSXPStreamReaderWrapper.java:138)
org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:651)
org.apache.axiom.om.impl.builder.StAXOMBuilder.lookahead(StAXOMBuilder.java:681)
org.apache.axiom.soap.impl.llom.SOAPBodyImpl.hasLookahead(SOAPBodyImpl.java:152)
org.apache.axiom.soap.impl.llom.SOAPBodyImpl.hasFault(SOAPBodyImpl.java:93)
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.hasFault(SOAPEnvelopeImpl.java:292)
org.apache.axis2.context.MessageContext.isFault(MessageContext.java:4299)
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:154)
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:364)
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
_105._1._168._192.soap.wspddikti.WSPDDIKTIStub.getToken(WSPDDIKTIStub.java:1760)
servlet.pdpt.feeder.Main.doGet(Main.java:46)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.30 logs.
  1. 使用maven
  2. POM

    <project xmlns="http://maven.apache.org/POM/4.0.0"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <groupId>maven.pddikti.client</groupId>
     <artifactId>PddiktiFeederClient</artifactId>
     <version>0.0.1-SNAPSHOT</version>
    
      <build>
        <plugins>
            <plugin>
                <groupId>org.apache.axis2</groupId>
                <artifactId>axis2-wsdl2code-maven-plugin</artifactId>
                <version>1.6.3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>wsdl2code</goal>
                        </goals>
                        <configuration>
                            <unpackClasses>trie</unpackClasses>
                            <packageName>maven.ws.client</packageName>
                            <wsdlFile>src/main/resources/wsdl/pddikti.wsdl</wsdlFile>
                            <databindingName>xmlbeans</databindingName>
                            <syncMode>sync</syncMode>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    

    错误:

    [INFO] ------------------------------------------------------------------------
     [INFO] BUILD FAILURE
     [INFO] ------------------------------------------------------------------------
     [INFO] Total time: 8.074 s
     [INFO] Finished at: 2015-08-20T22:31:00+07:00
     [INFO] Final Memory: 10M/148M
     [INFO] ------------------------------------------------------------------------
     [ERROR] Failed to execute goal org.apache.axis2:axis2-wsdl2code-maven-plugin:1.6.3:wsdl2code (default) on project PddiktiFeederClient: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException: org.apache.xmlbeans.XmlException: error: src-resolve.a: Could not find type 'Array@http://www.w3.org/2001/XMLSchema'. Do you mean to refer to the element named Array@http://schemas.xmlsoap.org/soap/encoding/? ->    [Help 1]
     [ERROR] 
     [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
     [ERROR] Re-run Maven using the -X switch to enable full debug logging.
     [ERROR] 
     [ERROR] For more information about the errors and possible solutions, please read the following articles:
     [ERROR] [Help 1] 
    
    从maven

    错误很明显,找不到类型数组@ xxxxx

    我的技能在这方面非常有限,我在谷歌上搜索如何让maven识别这种阵列类型,我是否正确方向?

    任何人都可以帮助我解决这个问题,提前谢谢。

0 个答案:

没有答案