users@glassfish.java.net

Re: Injection of ref to EJB fails

From: Vijay Ramachandran <Vijay.Ramachandran_at_Sun.COM>
Date: Thu, 22 Mar 2007 14:11:59 -0700

Hi Jean,

When you are starting from Java, you have the luxury of not specifying
any of the attributes for @WebService and let the container default to
the spec defined default values.

But when you are starting from WSDL, the @WebService annotation in the
endpoint implementation class should match the corresponding ones in the
WSDL - else the mismatch will cause the issues that you faced. Generally
the IDEs will take care of this matching while creating the @WebService
annotation in the endpoint impl class but if you are using basic editors
and you are creating the endpoint impl class manually, then you have to
match the values.

So in your case, since you have a WSDL and you are packaging the WSDL
along with the SEI, the @WebService annotaiton in the endpoint impl
should at least have the wsdlLocation, serviceName, portName,
targetNamespace and serviceEndpointInterface attributes.

Vijay

glassfish_at_javadesktop.org wrote:
> Hi Vijay
>
> Thanks for taking care of my issue. After a (very long) serie of trial/errors, I finally manage to get rid of the problem and deploy my WebService. However, I still would like to understand what was wrong, and more particularly what's the proper way to start with a WSDL file and make sure that WSDL file is preserved at deploy time (i.e. that clients connecting to URL...?WSDL would retrieve my original WSDL and not one generated by GlassFish).
>
> I ran wsimport:
> here's what I find in the PortType.java interface:
> /**
> * This class was generated by the JAXWS SI.
> * JAX-WS RI 2.0_03-b24-fcs
> * Generated source version: 2.0
> *
> */
> @WebService(name = "HarvestPortType", targetNamespace = "http://limbs.sourceforge.net/wsdl/HarvestProtocol")
> public interface HarvestPortType {
>
> I could successfully use an EJB to implement this interface with the following declaration:
> @Stateless
> @WebService(endpointInterface="net.sourceforge.limbs.wsdl.harvestprotocol.HarvestPortType",
> wsdlLocation="META-INF/wsdl/HarvestProtocol.wsdl", portName="HarvestPort",
> serviceName="HarvestService",
> targetNamespace="http://limbs.sourceforge.net/wsdl/HarvestProtocol")
> public class HarvestManagerBean implements HarvestPortType {
>
> However, I don't understand why I have to specify so many things in the EJB class. Unfortunately, I can't attach files to this email, so I can't send you all files (wsdl, wsimport files,...) Let me know if you need additional information.
>
> Best regards
>
> Jean-Noel
> [Message sent by forum member 'jncolin' (jncolin)]
>
> http://forums.java.net/jive/thread.jspa?messageID=209491
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>