File Binding component for writing files

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

File Binding component for writing files

by nickd-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can anyone point me to an example how I can use NetBeans 6.5 to write files with the File Binding component. I have followed the Flight Plan File Binding tutorial which uses a File Binding component to read and write files but I have no idea how I can use the file binding component to simply write files.





Re: File Binding component for writing files

by Jason Baragry-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Nick,

The netbeans enterprise pack used to contain a core set of the OpenESB
project tooling - including FileBC.
http://wiki.open-esb.java.net/
However, I'm not sure if that is still the case.

OpenESB tooling is still using NB6.1 and I'm not sure how stable the
openesb bits are if you deploy them to NB6.5

I recommend that you grab the OpenESB or GlassfishESB installer.
(GlassfishESB is the stable release of OpenESB).
https://open-esb.dev.java.net/Downloads.html

You can then use FileBC quite simply. Here's some docs including how to
write files:
http://wiki.open-esb.java.net/Wiki.jsp?page=CommonUserScenarios

If you have further questions you should probably ask on the openesb forum.
https://open-esb.dev.java.net/MailingLists.html

rgds
Jason

nickd wrote:
> Can anyone point me to an example how I can use NetBeans 6.5 to write files with the File Binding component. I have followed the Flight Plan File Binding tutorial which uses a File Binding component to read and write files but I have no idea how I can use the file binding component to simply write files.
>
>
>
>
>  

--
Jason Baragry
Lead Architect, SOA / Business Integration.
Sun Microsystems, Central and Northern Europe
Mobile +47 4899 4603
Email Jason.Baragry@...



File Binding component for writing files

by nickd-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jason,

thanks for your quick reply.



I am a little confused about the relationship between OpenESB and NetBeansIDE 6.5.



I have downloaded and am using NetBeans 6.5 (with the bundled GlassFish) and have completed a few of the SOA Tutorials. I have, in this time, read several documents from OpenESB (including the one you point me to) which describe a similar but not identitical functionality in the area of File Binding.



Is OpenESB a subset of NetBeans 6.5? Does NetBeans 6.5 just 'use' a subset of FileBinding as specified by OpenESB? Can OpenESB be used with NetBeans 6.5? Boy, am I confused.

 



Ideally I would like to know how I can use the File Binding that comes with NetBeans 6.5 IDE to write files.





Re: File Binding component for writing files

by Vitaly Bychkov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Nick,

OpenESB design side is based on Netbeans 6.1
In general case you can't install Netbeans 6.1 modules into Netbeans 6.5
because they are binary incompatible.

Although You can use GlassFish ESB with the latest JBI runtime from the
Netbeans 6.5 you can't use the latest design side modules from OpenESB.
That is why it is better to use Netbeans 6.1 bundled with OpenESB.

More over File BC has both design and runtime parts.

Vitaly.

nickd wrote:

> Hi Jason,
>
> thanks for your quick reply.
>
>
>
> I am a little confused about the relationship between OpenESB and NetBeansIDE 6.5.
>
>
>
> I have downloaded and am using NetBeans 6.5 (with the bundled GlassFish) and have completed a few of the SOA Tutorials. I have, in this time, read several documents from OpenESB (including the one you point me to) which describe a similar but not identitical functionality in the area of File Binding.
>
>
>
> Is OpenESB a subset of NetBeans 6.5? Does NetBeans 6.5 just 'use' a subset of FileBinding as specified by OpenESB? Can OpenESB be used with NetBeans 6.5? Boy, am I confused.
>
>  
>
>
>
> Ideally I would like to know how I can use the File Binding that comes with NetBeans 6.5 IDE to write files.
>
>
>
>
>  


Re: File Binding component for writing files

by Jason Baragry-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Nick,

In addition to what Vitaly wrote.

OpenESB is a project which provides integration capabilities. It
includes run-time engines (e.g., bpel, XSLT) and bindings (e.g., file,
webservices, jms, email). These runtime pieces are (JBI) plugins for
Glassfish. For each of these service engines and bindings OpenESB also
includes design time components. Each of the design time pieces is a
plugin to netbeans - specifically netbeans 6.1.

So OpenESB is something that builds on the core netbeans and glassfish
platforms.

However, to make life a little confusing, if you simply download
netbeans or glassfish you often get a few small pieces of OpenESB
included by default. This seems to be what you have discovered.
Sometimes these few small pieces will just work. However, to be sure
that you have everything you need, I suggest using the GlassfishESB or
OpenESB installer. It includes Glassfish and NetBeans with all the
relevant runtime and designtime plugins.

The only issue is that, as Vitaly pointed out, OpenESB is still using
netbeans6.1 for its design time environment.

hth
Jason



nickd wrote:

> Hi Jason,
>
> thanks for your quick reply.
>
>
>
> I am a little confused about the relationship between OpenESB and NetBeansIDE 6.5.
>
>
>
> I have downloaded and am using NetBeans 6.5 (with the bundled GlassFish) and have completed a few of the SOA Tutorials. I have, in this time, read several documents from OpenESB (including the one you point me to) which describe a similar but not identitical functionality in the area of File Binding.
>
>
>
> Is OpenESB a subset of NetBeans 6.5? Does NetBeans 6.5 just 'use' a subset of FileBinding as specified by OpenESB? Can OpenESB be used with NetBeans 6.5? Boy, am I confused.
>
>  
>
>
>
> Ideally I would like to know how I can use the File Binding that comes with NetBeans 6.5 IDE to write files.
>
>
>
>
>  

--
Jason Baragry
Lead Architect, SOA / Business Integration.
Sun Microsystems, Central and Northern Europe
Mobile +47 4899 4603
Email Jason.Baragry@...



File Binding component for writing files

by nickd-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks very much for the 'smallprint' Vitaly and Jason.



I shall follow your suggestion and try NetBeans 6.1 with OpenESB.

Does this mean I just have to download NetBeans 6.1 and I automatically get the correct OpenESB?





Re: File Binding component for writing files

by Jason Baragry-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

No probs.

You should grab the glassfishesb RC1 installer from here:
https://open-esb.dev.java.net/Downloads.html

It includes netbeans, glassfish, and all the runtime and design time
plug-ins for openesb.

rgds
Jason

nickd wrote:

> Thanks very much for the 'smallprint' Vitaly and Jason.
>
>
>
> I shall follow your suggestion and try NetBeans 6.1 with OpenESB.
>
> Does this mean I just have to download NetBeans 6.1 and I automatically get the correct OpenESB?
>
>
>
>
>  

--
Jason Baragry
Lead Architect, SOA / Business Integration.
Sun Microsystems, Central and Northern Europe
Mobile +47 4899 4603
Email Jason.Baragry@...



File Binding component for writing files

by nickd-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Case solved - isn't it quick getting somewhere if you start from the right place.



Now I'm just a little worried that I am going to need some functionality that is available in NetBeans 6.5 but is not available in 6.1. Still, with you guys here to help...



Many Thanks.





File Binding component for writing files

by nickd-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I now have a problem when invoking a WebService from within a JBI Module.



I have a simple example whereby a File binding component reads a file containing plain text. This text is processed in my JBI Module by the 'poll' method. Up to now, everything is OK. The 'poll' method, however, calls an existing WebService that processes the string. This worked fine in NetBeans 6.5 - the Service Assembly of the Composite Apllication recognised that the JBI Component made a call to a Soap WSDL Port and connected the consumer port of the JBI Module with the correct provider port a Soap WSDL port.

In NetBeans 6.1 I the Service Assemly shows the consumer port of the JBI Module as unconnected and the Web Service does not exist.

In NetBeans 6.5 this all worked like a dream - I really was 'programming' by drag'n'drop. Is it also so simple in 6.1 or am I doing something wrong? Please advise.



Below is the code snippet of the poll process in 6.1 and attached is a screen dump of the Service Assemply design in 6.5 and 6.1











@WebService(serviceName = "FileInboundService", portName = "upperBindWSDL_InboundPort", endpointInterface = "org.netbeans.j2ee.wsdl.upperca.upperbindwsdl.FileInboundPortType", targetNamespace = "http://j2ee.netbeans.org/wsdl/upperCa/upperBindWSDL", wsdlLocation = "META-INF/wsdl/upperWebServiceFromWSDL/upperBindWSDL.wsdl")

@Stateless

public class upperWebServiceFromWSDL implements FileInboundPortType {



    @WebServiceRef(wsdlLocation = "http://localhost:8080/upperServiceService/upperService?wsdl")

    private UpperServiceService service;



    public void poll(java.lang.String part1) {



        try { // Call Web Service Operation

            upper.UpperService port = service.getUpperServicePort();

            // TODO initialize WS operation arguments here

            java.lang.String parameter = part1;

            // TODO process result here

            java.lang.String result = port.upper(parameter);

            System.out.println("Result = " + result);

        } catch (Exception ex) {

            // TODO handle custom exceptions here

        }



    }

}




Attachments:
http://forums.netbeans.org//files/serviceassembly_359.jpg


Re: File Binding component for writing files

by Jason Baragry-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Nick,

Its not so easy to see what you are trying to do from the diagrams.

In the NB6.5 example you have joined the File BC to a local JavaEE EJB
Service. The EJB Service then calls the remote Webservice.
In the NB6.1 example there is no remote WebService.

Are you trying to join the FileBC directly to a remove webservice or
does it go through an intermediate EJB Service?

However, it should be very easy to do what you are trying with OpenESB
(Netbeans 6.1). So a step must have been left out. You simply:
- create the EJB service which communicates with the remote service
- add it to a composite application. When you build, you should see the
JavaEE service linked to an outgoing SOAP Binding.
- in the CASA editor, drag the File Binding onto the canvas and join it
to the EJB Service. A wizard will pop-up letting you configure the
properties of the File Binding.

I suggest you only use the OpenESB and GlassfishESB technology (which
comes bundled with NB6.1). There is no guarantee that NB6.5 will do what
you want - even if it seems to work this time. Also, I suggest you ask
subsequent questions on the OpenESB users mailing list. You will get
better response from that list
https://open-esb.dev.java.net/MailingLists.html

rgds
Jason


nickd wrote:

> I now have a problem when invoking a WebService from within a JBI Module.
>
>
>
> I have a simple example whereby a File binding component reads a file containing plain text. This text is processed in my JBI Module by the 'poll' method. Up to now, everything is OK. The 'poll' method, however, calls an existing WebService that processes the string. This worked fine in NetBeans 6.5 - the Service Assembly of the Composite Apllication recognised that the JBI Component made a call to a Soap WSDL Port and connected the consumer port of the JBI Module with the correct provider port a Soap WSDL port.
>
> In NetBeans 6.1 I the Service Assemly shows the consumer port of the JBI Module as unconnected and the Web Service does not exist.
>
> In NetBeans 6.5 this all worked like a dream - I really was 'programming' by drag'n'drop. Is it also so simple in 6.1 or am I doing something wrong? Please advise.
>
>
>
> Below is the code snippet of the poll process in 6.1 and attached is a screen dump of the Service Assemply design in 6.5 and 6.1
>
>
>
>
>
>
>
>
>
>
>
> @WebService(serviceName = "FileInboundService", portName = "upperBindWSDL_InboundPort", endpointInterface = "org.netbeans.j2ee.wsdl.upperca.upperbindwsdl.FileInboundPortType", targetNamespace = "http://j2ee.netbeans.org/wsdl/upperCa/upperBindWSDL", wsdlLocation = "META-INF/wsdl/upperWebServiceFromWSDL/upperBindWSDL.wsdl")
>
> @Stateless
>
> public class upperWebServiceFromWSDL implements FileInboundPortType {
>
>
>
>     @WebServiceRef(wsdlLocation = "http://localhost:8080/upperServiceService/upperService?wsdl")
>
>     private UpperServiceService service;
>
>
>
>     public void poll(java.lang.String part1) {
>
>
>
>         try { // Call Web Service Operation
>
>             upper.UpperService port = service.getUpperServicePort();
>
>             // TODO initialize WS operation arguments here
>
>             java.lang.String parameter = part1;
>
>             // TODO process result here
>
>             java.lang.String result = port.upper(parameter);
>
>             System.out.println("Result = " + result);
>
>         } catch (Exception ex) {
>
>             // TODO handle custom exceptions here
>
>         }
>
>
>
>     }
>
> }
>
>
>
>
> Attachments:
> http://forums.netbeans.org//files/serviceassembly_359.jpg
>
>  

--
Jason Baragry
Lead Architect, SOA / Business Integration.
Sun Microsystems, Central and Northern Europe
Mobile +47 4899 4603
Email Jason.Baragry@...



File Binding component for writing files

by nickd-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jason,

Thanks again for your prompt reply.




> - add it to a composite application. When you build, you should see the

> JavaEE service linked to an outgoing SOAP Binding.




This is the step that does not work. I add it to the Composite Application and see the JavaEE service but it is not linked to an outgoing SOAP binding.



My even more simplified example no longer using file binding and is as follows. It is simply a Web Servive (EJBjbi) calling another Web Service (EJBapp):



Step 1. Create an EJB Project called EJBapp containing a WebService called "StringManipulation" with one operation "toUpper".



Step2. Create an EJB Project called EJBjbi containing a WebService called NewWebService with one operation "passThrough".



Step 3. Within EJBjbi Create a WebService Client from project EJBapp->StringManipulation.



Step 4. Extend the implementation of "passThrough" in EJBjbi to call "toUpper" (by dragging and dropping the toUpper from the Web Service references into the method).



Step 5. Build EJBapp and EJBjbi.



Step 6. Create a Composite App project and drop EJBjbi on the JBI Modules canvas. Build.



Result:

There is no Soap Binding and (therefore?) no link from the JavaEE Service.



Shall I post this to the newsgroup you recommend? - this one seems to give a pretty good response (< 30 minutes!)



Purely out of interest I have repeated the steps 1-6 on NetBeans 6.5 and it worked as expected. I am, however, heading your advice and currently going with OpenESB





File Binding component for writing files

by nickd-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Here the 3 Projects - the naming does not exactly match the steps as described - EJB1 is EJBjbi and EJB2 is EJBapp.




Attachments:
http://forums.netbeans.org//files/jbiproblem_170.zip