I tried something like this example:
Code: Select all
@WebServiceRef(value=LogWebService.class, type=LogLog.class)
But with these two attributes, the service can still be injected.
Moderators: Site Manager, fjwalraven
Code: Select all
@WebServiceRef(value=LogWebService.class, type=LogLog.class)
Code: Select all
@WebServiceRef(value=LogWebService.class, type=LogLog.class)
LogWebService o;
Code: Select all
@WebServiceRef(value=LogWebService.class)
LogWebService o;
javax.servlet.ServletException: PWC1392: Error instantiating servlet class nl.notes.servlet.LogServlet
root cause
com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class nl.notes.servlet.LogServlet
root cause
com.sun.enterprise.container.common.spi.util.InjectionException: Exception attempting to inject Env-Prop: nl.notes.servlet.LogServlet/o@Field-Injectable Resource. Class name = nl.notes.servlet.LogServlet Field name=o@javax.jws.WebServiceRef@@@ into class nl.notes.servlet.LogServlet: Lookup failed for 'java:comp/env/nl.notes.servlet.LogServlet/o' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}
root cause
javax.naming.NamingException: Lookup failed for 'java:comp/env/nl.notes.servlet.LogServlet/o' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NamingException [Root exception is com.sun.xml.ws.model.RuntimeModelerException: A WebService annotation is not present on class: client.LogWebService]]
root cause
javax.naming.NamingException [Root exception is com.sun.xml.ws.model.RuntimeModelerException: A WebService annotation is not present on class: client.LogWebService]
root cause
com.sun.xml.ws.model.RuntimeModelerException: A WebService annotation is not present on class: client.LogWebService
Code: Select all
@WebService(serviceName="LogWebService", name="LogLog")
public class LogServiceImpl {
@Oneway
public void log(String msg) {
System.out.println(msg);
}
}
From the WSDL you can already see that the Generated SEI will have the name "LogLog":
Code: Select all
<definitions ...>
...
<portType name="LogLog">
<operation name="log">
<input wsam:Action="http://ws.notes.nl/LogLog/log" message="tns:log"/>
</operation>
</portType>
<binding name="LogLogPortBinding" type="tns:LogLog">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="log">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
</operation>
</binding>
<service name="LogWebService">
<port name="LogLogPort" binding="tns:LogLogPortBinding">
<soap:address location="http://localhost:8080/WebServiceReference/LogWebService"/>
</port>
</service>
</definitions>
You can see that the SEI is called LogLog:wsimport -p client -keep -verbose http://localhost:8080/WebServiceReference/LogWebService
Code: Select all
@WebService(name = "LogLog", targetNamespace = "http://ws.notes.nl/")
@XmlSeeAlso({
ObjectFactory.class
})
public interface LogLog {
@WebMethod
@Oneway
@RequestWrapper(localName = "log", targetNamespace = "http://ws.notes.nl/", className = "client.Log")
@Action(input = "http://ws.notes.nl/LogLog/log")
public void log(
@WebParam(name = "arg0", targetNamespace = "")
String arg0);
}
There is no "value" here. Is it the case that this is not referring to SEI but is referring to generated service type than this makes sense. But how did you arrive at the conclusion that this is referring to generated service?When the @WebServiceRef is defined on a (field) property and refers to a generated SEI type (e.g. LogLog) - the value element must be present - the type element may be present
Code: Select all
@WebServiceRef
LogWebService o;
Code: Select all
@WebServiceRef
LogLog o;
Users browsing this forum: No registered users and 6 guests