代码:
package webServices;
import weblogic.jws.CallbackService;
import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebParam;
@CallbackService
public interface ICallback {
@WebMethod
@Oneway
public void Receive(
@WebParam(name="name",mode=WebParam.Mode.IN)
String name,
@WebParam(name="msg",mode=WebParam.Mode.IN)
String msg);
}
package webServices;
import javax.jws.*;
import weblogic.jws.Callback;
@ WebService
public class Hello {
@Callback
ICallback callback;
@WebMethod
@Oneway
public void Message(
@WebParam(name="name",mode=WebParam.Mode.IN)
String name,
@WebParam(name="msg",mode=WebParam.Mode.IN)
String msg)
{
callback.Receive(name, msg);
}
}
发布时报错:
oracle.eclipse.tools.webservices.compiler.CompilationException: Errors: 因为批注 weblogic.jws.Callback 是一种 JAX-WS 类型 Web Service,所以不允许在 webServices.ICallback webServices.Hello.callback 上使用它。 (E:\workspace\HelloWorld\src\webServices\Hello.java, line 9)
因为批注 weblogic.jws.Callback 是一种 JAX-WS 类型 Web Service,所以不允许在 webServices.ICallback webServices.Hello.callback 上使用它。 (E:\workspace\HelloWorld\src\webServices\Hello.java, line 9)
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:135)
at oracle.eclipse.tools.webservices.common.compiler.WebServiceProjectCompilerImpl.access$000(WebServiceProjectCompilerImpl.java:53)
at oracle.eclipse.tools.webservices.common.compiler.WebServiceProjectCompilerImpl$1.run(WebServiceProjectCompilerImpl.java:82)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1800)
at oracle.eclipse.tools.webservices.common.compiler.WebServiceProjectCompilerImpl.build(WebServiceProjectCompilerImpl.java:100)
at oracle.eclipse.tools.webservices.publish.WebServiceProjectPublishTask$WebServicesBuildOperation.processWebServices(WebServiceProjectPublishTask.java:164)
at oracle.eclipse.tools.webservices.publish.WebServiceProjectPublishTask$WebServicePublishOperation.processWebModule(WebServiceProjectPublishTask.java:127)
at oracle.eclipse.tools.weblogic. server.model.WeblogicWebPublishOperation.processRootModule(WeblogicWebPublishOperation.java:86)
at oracle.eclipse.tools.weblogic.server.model.WeblogicPublishOperation.execute(WeblogicPublishOperation.java:92)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.performTasks(WeblogicServerBehaviour.java:1203)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishToServer(WeblogicServerBehaviour.java:760)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishOnce(WeblogicServerBehaviour.java:623)
at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publish(WeblogicServerBehaviour.java:516)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:707)
at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:2492)
at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:270)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)