2014-02-27 27 views
0

我試圖從一本書執行一個簡單的Web服務示例:編程Web服務WebLogic Server的

package com.alsb.hello; 

import javax.jws.WebMethod; 
import javax.jws.WebService; 
import javax.jws.soap.SOAPBinding; 

import weblogic.jws.WLHttpTransport; 
import weblogic.jws.WSDL; 

@WebService 
@WSDL(exposed=true) 
@WLHttpTransport(portName="HelloWorldSoapPort", serviceUri = "HelloWorldService", contextPath = "business/hello") 
@SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.WRAPPED) 
public class HelloWorld { 

    @WebMethod 
    public String hello(String arg) { 
     return arg + "z"; 
    } 
} 

但是,當我啓動服務器(Weblogic的10.3.6),它發生了以下錯誤:

Errors: The annotation weblogic.jws.WSDL is not allowed on com.alsb.hello.HelloWorld because it is a JAX-WS type web service.

與註釋@WLHttpTransport相同。

有人能找出問題出在哪裏嗎? 「

回答

1

」儘管此版本的WebLogic Server支持基於JAX-RPC 1.1和基於JAX-WS 2.0的Web服務,但您可以僅將WebLogic特定的註釋與基於JAX-RPC的Web服務一起使用。「,請從Weblogic中檢查Overview of JWS Annotation Tags 。也許這可能是原因。