Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用SOAPUI在WebSphereV7上调用JAX-WSWeb服务_Java_Jax Ws_Websphere 7 - Fatal编程技术网

Java 使用SOAPUI在WebSphereV7上调用JAX-WSWeb服务

Java 使用SOAPUI在WebSphereV7上调用JAX-WSWeb服务,java,jax-ws,websphere-7,Java,Jax Ws,Websphere 7,我将JAX-WSWeb服务打包在EAR中,并部署到WebSphereV7。 耳朵包含: -APP-INF目录:类目录(.class文件位于正确的包层次结构中)加上带有所需JAR的lib目录 -META-INF目录 -带有空WEB-INF和META-INF目录以及HelloWorld index.html的战争 我有两门课: @WebService public interface Service {} 以及: (libdir中的jar是业务逻辑所必需的,我只是用一个简单的hello+who替换

我将JAX-WSWeb服务打包在EAR中,并部署到WebSphereV7。 耳朵包含:
-APP-INF目录:类目录(.class文件位于正确的包层次结构中)加上带有所需JAR的lib目录
-META-INF目录
-带有空WEB-INF和META-INF目录以及HelloWorld index.html的战争

我有两门课:

@WebService
public interface Service {}
以及:

(libdir中的jar是业务逻辑所必需的,我只是用一个简单的hello+who替换了这个逻辑)

我已经在WASV7中部署了EAR,现在我想使用SOAPUI测试它。我已为以下内容设置了上下文根:
/服务
在部署期间

在哪里可以找到生成的WSDL及其地址/端点是什么


我对这一点一无所知,在WASV7上提供一个有用的JAX-WS完整教程链接也可以。我找不到任何,尽管我已经在谷歌上搜索了几个小时…

当您不直接定义时,默认情况下,JAX-WS运行时会向实现该服务的类添加后缀
Service
,尽管这不是所有运行时的规则。如果您想要获得部署的WSDL,请尝试

http://localhost:9080/service/ServiceImplService?wsdl

如果要更改模式URL

@WebService(serviceName = "EchoService")
public class ServiceImpl implements Service {
    @WebMethod
    public String test(String who) {
        return ("Hello " + who + "!");
    }
}
试一试

更多信息请参见

更新

如果要在WAS中部署EAR,基本结构是:

TestEAR.ear
|   TestWeb.war
|
\---META-INF
        MANIFEST.MF
此EAR中WAR文件的结构为:

TestWeb.war
+---META-INF
|       MANIFEST.MF
|
\---WEB-INF
    |   ibm-web-bnd.xml
    |   ibm-web-ext.xml
    |   web.xml
    |
    +---classes
    |   \---org
    |       \---paulvargas
    |           \---test
    |               |   Service.class
    |               |   ServiceImpl.class
    |               |
    |               \---jaxws
    |                       Test.class
    |                       TestResponse.class
    |
    \---lib
文件
IBMWebxxx.xml
是本例的可选文件。
MANIFEST.MF
只有:

Manifest-Version: 1.0
Class-Path: 
文件
Test.class
TestResponse.class
(用于WSDL文档文件中的操作
Test
)由
wsgen
工具生成,命令类似于:

wsgen -cp . org.paulvargas.test.ServiceImpl
web.xml
包含:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <display-name>TestWeb</display-name>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
</web-app>
请参阅更多:


我仍然无法获取wsdl。感谢您的回答,但我仍然无法获取wsdl。我的webapp就在那里,当在浏览器中输入以ctxroot结尾的url时,它会显示我的欢迎索引.html的内容。我的耳朵包含:meta-inf和manifest和war。war包含:meta-inf(+manifest)、index.html和WEB-inf。WEB-inf包含WEB.xml和欢迎文件。war的WEB-inf目录下有classes目录。在类中:一个wsdl和一个xsd,都是由WebSphereV7的wsGen工具生成的;还有由java包生成的目录。在注释服务类的包中,有一个包含.class的jaxws目录,也是由wsgen工具生成的。这些类与我的webservice的方法(Test.class)同名,而且响应类也很复杂。如果您使用的是Rational Application Developer,则不需要使用
wsgen
工具生成工件。在类中只需要
@WebService
注释。自动生成工件。我只有Eclipse和ant。我在Eclipse中添加了一个Websphere服务器,但它说:“不支持托管(联合)Websphere Application server网络部署环境”,因此我通过管理控制台部署由ant任务创建的EAR。
Manifest-Version: 1.0
Class-Path: 
wsgen -cp . org.paulvargas.test.ServiceImpl
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <display-name>TestWeb</display-name>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
</web-app>
http://localhost:9080/TestWeb/ServiceImplService/ServiceImplService.wsdl