如何使用Eclipse和https在weblogic中创建Web服务

时间:2014-08-27 16:03:12

标签: java web-services https wsdl weblogic

我想使用OEPE(Oracle Enterprise Pack for Eclipse)和Java从WSDL创建weblogic中的Web服务。

我尝试遵循以下tutorial和本教程的第一部分:使用自上而下(WSDL First)方法的Web Service。

如果我在WSDL文件中使用http协议,它可以正常工作。例如,如果我把类似的东西放在:

<wsdl:service name="WsService">
    <wsdl:port name="WsPort" binding="tns:WsServiceSoapBinding">
        <soap:address location="http://localhost:7001/WSService" />
    </wsdl:port>
</wsdl:service>

它运作正常。

但是我需要使用https,所以WSDL会改变(我认为)到类似的东西:

<wsdl:service name="WsService">
    <wsdl:port name="WsPort" binding="tns:WsServiceSoapBinding">
        <soap:address location="https://localhost:7002/WSService" />
    </wsdl:port>
</wsdl:service>

问题在于,当我尝试在服务器中运行项目或添加并删除项目时,会出现错误: JAX-WS仅支持HTTP端口

我在Weblogic Admin Console中启用了SSL,但收到了同样的错误。

我尝试关注these instructions并将以下内容添加到web.xml:

<security-constraint>
        <display-name>SecurityConstraint</display-name>
        <web-resource-collection>
            <web-resource-name>Secure Area</web-resource-name>
            <url-pattern>/WsService</url-pattern>
            <!--
                JSR-109 specifies that http-method POST must be used.
                If we include GET here, access to the WSDL will also be
                protected, otherwise not.
            -->
            <http-method>POST</http-method>
        </web-resource-collection>
        <!--
            Plain SSL and mutual authentication both require CONFIDENTIAL
            transport-guarantee to be configured.
        -->
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

没有任何改变。

你知道我怎么解决它吗?或者有更好的方法吗?

非常感谢!

更新

这是完整的堆栈跟踪(第一行是西班牙语错误:JAX-WS仅支持HTTP端口):

oracle.eclipse.tools.webservices.compiler.CompilationException: Errors: Sólo se soportan los puertos HTTP para JAX-WS. (C:\Proyectos\workspace-weblogic\Test6\src\es\xxx\yyy\ws\WsService_WsPortImpl.java, line 14)
    at oracle.eclipse.tools.webservices.common.compiler.WebServiceCompilerImpl.compile0(WebServiceCompilerImpl.java:300)
    at oracle.eclipse.tools.webservices.common.compiler.WebServiceCompilerImpl.compile(WebServiceCompilerImpl.java:247)
    at oracle.eclipse.tools.webservices.common.compiler.WebServiceProjectCompilerImpl.build0(WebServiceProjectCompilerImpl.java:132)
    at oracle.eclipse.tools.webservices.common.compiler.WebServiceProjectCompilerImpl.access$000(WebServiceProjectCompilerImpl.java:54)
    at oracle.eclipse.tools.webservices.common.compiler.WebServiceProjectCompilerImpl$1.run(WebServiceProjectCompilerImpl.java:83)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at oracle.eclipse.tools.webservices.common.compiler.WebServiceProjectCompilerImpl.build(WebServiceProjectCompilerImpl.java:101)
    at oracle.eclipse.tools.webservices.publish.WebServiceProjectPublishTask$WebServicesBuildOperation.processWebServices(WebServiceProjectPublishTask.java:173)
    at oracle.eclipse.tools.webservices.publish.WebServiceProjectPublishTask$WebServicePublishOperation.processWebModule(WebServiceProjectPublishTask.java:127)
    at oracle.eclipse.tools.weblogic.server.model.WeblogicWebPublishOperation.processRootModule(WeblogicWebPublishOperation.java:88)
    at oracle.eclipse.tools.weblogic.server.model.WeblogicPublishOperation.execute(WeblogicPublishOperation.java:92)
    at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.performTasks(WeblogicServerBehaviour.java:1311)
    at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishToServer(WeblogicServerBehaviour.java:855)
    at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishOnce(WeblogicServerBehaviour.java:686)
    at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publish(WeblogicServerBehaviour.java:539)
    at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
    at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3027)
    at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:341)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

0 个答案:

没有答案