Netbeans Platform and web services

View: New views
5 Messages — Rating Filter:   Alert me  

Netbeans Platform and web services

by ymajoros-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,



I have been trying to call a web service from a netbeans platform module. I can get it to work as a module, clicking on "run" from my development environment. But no luck developing a netbeans plugin: see http://forums.netbeans.org/viewtopic.php?t=18922



I tried to open a bug: http://www.netbeans.org/issues/show_bug.cgi?id=175268 . But it is still open and I still don't have a solution.



I tried to use the 3 nb jaxb modules, with the tricks mentioned in various blogs and forum posts.



I then tried to wrap metro and use this, with various combinations. I then got a message telling me that some classes would not be loaded arbitrarily, because they where available from different class loaders.

 I tried different combinations of wrapper modules with the different jars of metro, without luck.



So I still can't have a web service client in a netbeans plugin.



Please, please help, I'm lost! :-(





Re: Netbeans Platform and web services

by Andrea Chiumenti :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I'm using jaxb-ws with nb application platform too.

All you need is :

create a nb service (in my example I use basic authentication too)

public class UserServiceFacadeImpl implements UserServiceFacade {
    private UserWrapper dao;
    private WSUser service;

    private synchronized void ensureDao()
    {
        if (service == null)
        {
            //service = new WSUser();
            GamConfigManager loginManager = Lookup.getDefault().lookup(GamConfigManager.class);
            String baseAddress = loginManager.getServerConfig().getRemoteHost();
            if (!baseAddress.endsWith("/"))
            {
                baseAddress += "/";
            }
            String wsName = "WSUser";
            String plAddress = baseAddress + wsName + "?wsdl";

            QName qName = new QName("http://www.wingstech.it/gam3/", wsName);
            try
            {
                //QName echoQName = new QName("EchoWrapperService");
                URL url = new URL(plAddress);
                service = new WSUser(url, qName);
            }
            catch (MalformedURLException ex)
            {
                NotifyDescriptor d = new NotifyDescriptor(
                    ex.getMessage(),
                    "Errore",
                    NotifyDescriptor.DEFAULT_OPTION,
                    NotifyDescriptor.ERROR_MESSAGE,
                    null, null);
                DialogDisplayer.getDefault().notify(d);
                LifecycleManager.getDefault().exit();
            }
            dao = service.getUserWrapperPort();
        }
    }
    public UserServiceFacadeImpl() {
       
    }

    @Override
    public UserWrapper getService()
    {
        ensureDao();
        return dao;
    }
}

and its interface

public interface UserServiceFacade {
    public UserWrapper getService();
}

then in META-INF/services

create a file named
it.wingstech.gam3.anagraphics.users.service.UserServiceFacade

that simply contains

it.wingstech.gam3.anagraphics.users.service.UserServiceFacadeImpl

that's all

ciao,
kiuma

On Thu, Oct 29, 2009 at 9:36 AM, ymajoros <yannick.majoros@...> wrote:
Hello,



I have been trying to call a web service from a netbeans platform module. I can get it to work as a module, clicking on "run" from my development environment. But no luck developing a netbeans plugin: see http://forums.netbeans.org/viewtopic.php?t=18922



I tried to open a bug: http://www.netbeans.org/issues/show_bug.cgi?id=175268 . But it is still open and I still don't have a solution.



I tried to use the 3 nb jaxb modules, with the tricks mentioned in various blogs and forum posts.



I then tried to wrap metro and use this, with various combinations. I then got a message telling me that some classes would not be loaded arbitrarily, because they where available from different class loaders.

 I tried different combinations of wrapper modules with the different jars of metro, without luck.



So I still can't have a web service client in a netbeans plugin.



Please, please help, I'm lost! :-(






Netbeans Platform and web services

by ymajoros-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,



I'm really interested in your answer to my post, but it has been truncated. Could you please repost it?



Regards,



Yannick





Re: Netbeans Platform and web services

by tomwheel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It's probably best to look at the Web archive of it:

   http://openide.netbeans.org/servlets/ReadMsg?list=dev&msgNo=42050

On Fri, Oct 30, 2009 at 5:57 AM, ymajoros <yannick.majoros@...> wrote:
> Hi,
>
> I'm really interested in your answer to my post, but it has been
> truncated. Could you please repost it?

--
Tom Wheeler
http://www.tomwheeler.com/

Re: Netbeans Platform and web services

by ymajoros :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Still no luck: tried the code, got exceptions, ...

Could someone provide some sample module? This would be really nice.