搞不上图片了 看这 http://my.csdn.net/my/album/detail/1164126

解决方案 »

  1.   

    详细错误Exception in thread "main" org.apache.axis2.AxisFault: SOAP message MUST NOT contain a Document Type Declaration(DTD)
    at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
    at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:123)
    at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67)
    at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
    at tutorial.rampart.client.SecureServiceStub.add(SecureServiceStub.java:191)
    at tutorial.rampart.client.SecureServiceCGClient.main(SecureServiceCGClient.java:34)
    Caused by: org.apache.axiom.om.OMException: SOAP message MUST NOT contain a Document Type Declaration(DTD)
    at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createDTD(StAXSOAPModelBuilder.java:455)
    at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:282)
    at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:198)
    at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)
    at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:140)
    at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:686)
    at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:197)
    at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:145)
    at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:108)
    ... 7 more
      

  2.   

    字面理解是xml里面不能包含dtd
    在你的transportutils.createsoapmessage里面报的错、你打个断点跟一下吗
    webservice也是能打断点得呀
      

  3.   


    在 public class SecureServiceStub extends org.apache.axis2.client.Stub 中
    这句话
            //execute the operation client
            _operationClient.execute(true);
    报错是不是客户端这边 啥子地方 不对啊
    JVM内存?
      

  4.   

    用axis2的wsdl2java.bat生成SecureServiceStub的时候,生成的不对,
    原因是我没有配置axis2的环境变量AXIS2_HOME,配置了后,
    重新做了一遍就可以了。
      

  5.   

    http://download.csdn.net/detail/s478853630/4200795
    或许对你有帮助
      

  6.   

    public class AxisClient { public static void main(String[] args) throws Exception { String targetEndPoint = "http://localhost:8080/Asix2Demo/services/HelloWorld";
    Service ser = new Service();
    try {
    Call call = (Call) ser.createCall();
    call.setTargetEndpointAddress(targetEndPoint);
    call.setOperationName(new QName(targetEndPoint, "hello" ));
    call.setOperation("hello");
    String result = (String) call.invoke(new Object[] { new String("张三") });
    System.out.println("result=" + result);
    //call.setOperation("add");
    //int addResult = (Integer) call.invoke(new Object[] {new Integer(1), new Integer(1) });
    //System.out.println("addResult=" + addResult);
    } catch (ServiceException e) {
    e.printStackTrace();
    } catch (RemoteException e) {
    e.printStackTrace();
    } }
    这是我弄的一个客户端 楼主是不是客户端方法哪里不对  或者定义的webservice哪里不对
      

  7.   


    //直接调url就可以吧?
    String para = "";//参数
    String url = "http://192.198.1.1:80/Database.asmx/Method?para="+para;DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance(); 
    DocumentBuilder builder=factory.newDocumentBuilder(); 
    org.w3c.dom.Document doc = builder.parse(url);org.w3c.dom.NodeList list =doc.getElementsByTagName("Table");
    //然后循环去读List吧
    //类似于这样//list.item(i).getChildNodes().item(1).getChildNodes().item(0).getNodeValue()