我的开发环境是eclipse3.2+tomcat5出现的错误是The AXIS engine could not find a target service to invoke! targetService is ITest我的web Service是选的start service级,勾了Publish the Web Service
发布的是类ITest的hello(string name)方法
package com.tomato;public class ITest {
public String hello(String name){
return name+" : Hello World";
}
}
----------------------------------------------------------------------
生成wsdl时没发生错误
ITest.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://tomato.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://tomato.com" xmlns:intf="http://tomato.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.3
Built on Oct 05, 2005 (05:23:37 EDT)-->
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://tomato.com" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="hello">
<complexType>
<sequence>
<element name="in0" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="helloResponse">
<complexType>
<sequence>
<element name="helloReturn" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types> <wsdl:message name="helloResponse"> <wsdl:part element="impl:helloResponse" name="parameters"/> </wsdl:message> <wsdl:message name="helloRequest"> <wsdl:part element="impl:hello" name="parameters"/> </wsdl:message> <wsdl:portType name="ITest"> <wsdl:operation name="hello"> <wsdl:input message="impl:helloRequest" name="helloRequest"/> <wsdl:output message="impl:helloResponse" name="helloResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="ITestSoapBinding" type="impl:ITest"> <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="hello"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="helloRequest"> <wsdlsoap:body use="literal"/> </wsdl:input> <wsdl:output name="helloResponse"> <wsdlsoap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="ITestService"> <wsdl:port binding="impl:ITestSoapBinding" name="ITest"> <wsdlsoap:address location="http://localhost:8181/testServer/services/ITest"/> </wsdl:port> </wsdl:service></wsdl:definitions>
然后用export->war file,在tomcat的manager页面将他deploy
用http://127.0.0.1:8181/testServer/wsdl/ITest.wsdl访问正常
----------------------------------------------------------------------
Web Service Client
Service defintion: http://127.0.0.1:8181/testServer/wsdl/ITest.wsdl
生ITest,ITestProxy,ITestService,ITestServiceLocator,ITestSoapBindingStub类时也没有报错写的调用方法是:
import javax.xml.rpc.ServiceException;public class TestMain {
public static void main(String[] args) throws ServiceException, RemoteException {
// TODO Auto-generated method stub
ITest test = null;
ITestService ts = new ITestServiceLocator();
test = ts.getITest();
String words = test.hello("zq");
System.out.println(words);
}
}发现调用test.hello("zq")就出错,但调用test.toString()没错,提示
The AXIS engine could not find a target service to invoke! targetService is ITest请教各位高手,如何解决,我已用baidu,google,yahoo,sogou搜过了都没提具体如何解决!拜托了各位!只要提建议就有分!!
发布的是类ITest的hello(string name)方法
package com.tomato;public class ITest {
public String hello(String name){
return name+" : Hello World";
}
}
----------------------------------------------------------------------
生成wsdl时没发生错误
ITest.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://tomato.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://tomato.com" xmlns:intf="http://tomato.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.3
Built on Oct 05, 2005 (05:23:37 EDT)-->
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://tomato.com" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="hello">
<complexType>
<sequence>
<element name="in0" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="helloResponse">
<complexType>
<sequence>
<element name="helloReturn" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types> <wsdl:message name="helloResponse"> <wsdl:part element="impl:helloResponse" name="parameters"/> </wsdl:message> <wsdl:message name="helloRequest"> <wsdl:part element="impl:hello" name="parameters"/> </wsdl:message> <wsdl:portType name="ITest"> <wsdl:operation name="hello"> <wsdl:input message="impl:helloRequest" name="helloRequest"/> <wsdl:output message="impl:helloResponse" name="helloResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="ITestSoapBinding" type="impl:ITest"> <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="hello"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="helloRequest"> <wsdlsoap:body use="literal"/> </wsdl:input> <wsdl:output name="helloResponse"> <wsdlsoap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="ITestService"> <wsdl:port binding="impl:ITestSoapBinding" name="ITest"> <wsdlsoap:address location="http://localhost:8181/testServer/services/ITest"/> </wsdl:port> </wsdl:service></wsdl:definitions>
然后用export->war file,在tomcat的manager页面将他deploy
用http://127.0.0.1:8181/testServer/wsdl/ITest.wsdl访问正常
----------------------------------------------------------------------
Web Service Client
Service defintion: http://127.0.0.1:8181/testServer/wsdl/ITest.wsdl
生ITest,ITestProxy,ITestService,ITestServiceLocator,ITestSoapBindingStub类时也没有报错写的调用方法是:
import javax.xml.rpc.ServiceException;public class TestMain {
public static void main(String[] args) throws ServiceException, RemoteException {
// TODO Auto-generated method stub
ITest test = null;
ITestService ts = new ITestServiceLocator();
test = ts.getITest();
String words = test.hello("zq");
System.out.println(words);
}
}发现调用test.hello("zq")就出错,但调用test.toString()没错,提示
The AXIS engine could not find a target service to invoke! targetService is ITest请教各位高手,如何解决,我已用baidu,google,yahoo,sogou搜过了都没提具体如何解决!拜托了各位!只要提建议就有分!!
解决方案 »
- sql 转 hql Criteria 语句怎么写?
- 乱码的问题。
- 120求教一个struts配置问题
- 求一lucene入门例子
- 新手问题
- 在STRUTS中插入form表单的内容后,如果不停的刷新页面就会继续插入重复的数据,该怎么做才让刷新不会继续插入数据呢?
- <meta http-equiv="Cache-Control" CONTENT="no-cache">是干啥的?
- <jsp:useBean >标签中的beanName 和 type 属性在应用中起什么作用
- 为什么是这样的??大家来说说,你们有没有遇到同样的情况?
- 使用jspSmartUpload组件上传文件是不是有大小限制?
- 请教一个将jsp网站转换为静态网站的问题
- .JSP通过数据源访问数据库时出错!!!!
server-config.wsdd 和 web.xml 这两文件是不是有哪里没配置正确。