FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Invoking a BPEL-Process from JSP
Goto page 1, 2  Next
 
Post new topic   Reply to topic    NetBeans Forums -> SOA Users
View previous topic :: View next topic  
Author Message
MadmanNero



Joined: 24 Nov 2008
Posts: 7

PostPosted: Mon Nov 24, 2008 4:46 pm    Post subject: Invoking a BPEL-Process from JSP Reply with quote

Hi folks!

I'm having trouble invoking a BPEL-Process from a JSP. The Project compiles just fine and can be delpoyed on the Glassfish Server but running the JSP returns an 'http 500 error'. In the server.log it says the server can't find the 'PythagorasProcess.wsdl' which is the name of the BPEL-Processes WSDL-File.

To invoke the BPEL-Proces from my JSP I followed the same procedure needed to invoke a simple Web Service. I right-clicked on the project and chose new > Web Service Client... . There I provided the location of the WSDL-File of the composite application I created with the BPEL-Process. I'm not really sure about this step in the procedure but chosing the WSDL-File of the BPEL-Process instead of the composite application doesn't work and gives me an error directly after trying to do so telling me that the provided WSDL-File doesn't define a Web Service. Furthermore I had to specify a location from my project folder since I can't seem to find out the url where Glassfish would place a WSDL-File of a BPEL-Process. I know that for Web Services they are under 'Servicename?wsdl'.

Another strange thing is that when Netbeans creates the code to call to the BPEL-Process it gives me strange parameters and a void return. The process should take two floats and return another float. Instead one of the two parameters is of type 'javax.xml.ws.Holder<Float>'.

Thinking of it I'm really not too sure about the WSDL-File provided for the project but it's the only one the IDE would accept. I hope that there are some among you who have an idea about what to do or where to look for errors. Any input is appreciated since I'm just stuck with it and don't see a way to proceed. Sad

Thanks in advance...
Back to top
View user's profile Send private message
MadmanNero



Joined: 24 Nov 2008
Posts: 7

PostPosted: Tue Nov 25, 2008 8:35 am    Post subject: Reply with quote

I found out now that the error concerning the wrong parameter and return types comes from Netbeans giving the first input variable and output variable of the BPEL-Process the same name in the WSDL-File by default. I changed those names and now the code generated by Netbeans for invoking my BPEL-Process is ok concerning types. Nevertheless I'm still getting the "http 500 error". The server.log says it cannot find the processes WSDL-File. Even adding it to the project aside the already provided WSDL-File of the composite application does not change that.

What I think strange there is that the server.log is complaining about the WSDL-File not being in the NetBeansProjects directory which is in my home directory. I do not believe Glassfish should be looking for anything outside the glassfish directory until I miss my guess completely.

Any suggestions?
Back to top
View user's profile Send private message
MadmanNero



Joined: 24 Nov 2008
Posts: 7

PostPosted: Mon Dec 01, 2008 9:10 pm    Post subject: Reply with quote

Solved it at last...
Since there do not seem to be a lot of people around who could answer my question and since I could not find many usefull resources on this subject I decided to put some howtos online in the coming days describing the very basics of how to create web services and stuff on http://www.7circles.de/soa
c ya
Back to top
View user's profile Send private message
azaitsev



Joined: 17 Dec 2008
Posts: 3

PostPosted: Wed Dec 17, 2008 9:50 pm    Post subject: How do you specify WSDL file for the BPEL? Reply with quote

Hello,
could you tell how did you specified a web service client reference for the BPEL process deployed via composite application?
Some documents state that BPEL modules can be used as web services.

But documentation that I have tells how to run test cases from NetBeans IDE.
Particularly, all Netbeans.org tutorials wash their hands after telling how to run those tests. No practical use example so far....


Thank you.
Alex
Back to top
View user's profile Send private message
MadmanNero



Joined: 24 Nov 2008
Posts: 7

PostPosted: Thu Dec 18, 2008 7:15 am    Post subject: Reply with quote

You need to create the BPEL process first. Based on that BPEL Process you create a composite application. Having build and deployed the composite application you create your client project and choose New > Web Service Client. As the source for the wsdl file you provide the wsdl file from the BPEL Process (not from the composite application) by selecting it from its folder. Having finished this you can drag&drop the code into your application just as if you used a simple web service. If I find the time this weekend I'll put a little howto about BPEL Processes online. Hope I was helpful. Good luck. If you still have questions then ask Smile
Back to top
View user's profile Send private message
nb11990



Joined: 04 Jan 2009
Posts: 1

PostPosted: Sun Jan 04, 2009 11:04 am    Post subject: Unable to invoke web service Reply with quote

Hi MadmanNero

I successfully followed your instructions to build a simple (Math) web service. However I am having a problem invoking it from a JSP. Specifically, when I try to build the JSP client project, I get an error on this line in the AdditionService.java file:

return super.getPort(new QName("http://Math/", "AdditionPort"), Addition.class, features);

Your help would be most appreciated
Back to top
View user's profile Send private message
MadmanNero



Joined: 24 Nov 2008
Posts: 7

PostPosted: Wed Jan 07, 2009 9:49 am    Post subject: Reply with quote

Are you able to test your Web Service using the provided Tester? If you followed the steps in the howto you should have no problems. Maybe if you give it a new try things will go smooth... During my work I had to realize that Netbeans and Glassfish is full of Bugs. It produced lots of errors and exceptions for me that did not have anything to do with the provided code and some behaviour was not even reproducable. For me it sometimes seemed harder to cope with netbeans than with the projects' logic itself.

Invoking the Web Service from JSP should be a matter of dragging and dropping it from the Web Service References folder under Project to the place in your code where you want to invoke it. But since you said you followed the howto I guess you did just that.

I'll have a look at my code this evening. If I find something I'll post it here.

Good luck.
Back to top
View user's profile Send private message
anushree



Joined: 14 Apr 2009
Posts: 11

PostPosted: Tue Apr 14, 2009 10:54 am    Post subject: tried to invoke BPEL process from JSP Reply with quote

hi.. i followed the steps given in ur how to...
i could successfully do the first four parts.
however when i try to invoke BPEL process from JSP i get the sum as 0...
my glassfish server log is not showing any error...
any idea why this is happening??
thanks in advance for any help...
Back to top
View user's profile Send private message
anushree



Joined: 14 Apr 2009
Posts: 11

PostPosted: Wed Apr 15, 2009 5:47 am    Post subject: javax.faces.el.EvaluationException: javax.xml.ws.WebServiceException: Unsupported endpoint address: Reply with quote

hii...
i removed the try catch block from the java code in AdditionBPELClient n now i m gettin foll exception:
javax.xml.ws.WebServiceException: Unsupported endpoint address:
javax.faces.el.EvaluationException: javax.xml.ws.WebServiceException: Unsupported endpoint address:
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
at com.sun.rave.web.ui.appbase.faces.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
at javax.faces.component.UICommand.broadcast(UICommand.java:383)
at com.sun.webui.jsf.component.WebuiCommand.broadcast(WebuiCommand.java:160)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:94)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:267)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: javax.xml.ws.WebServiceException: Unsupported endpoint address:
at com.sun.xml.ws.api.pipe.TransportTubeFactory.create(TransportTubeFactory.java:144)
at com.sun.xml.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:112)
Back to top
View user's profile Send private message
anushree



Joined: 14 Apr 2009
Posts: 11

PostPosted: Wed Apr 15, 2009 6:08 am    Post subject: javax.faces.el.EvaluationException: javax.xml.ws.WebServiceException: Unsupported endpoint address: Reply with quote

hii...
i removed the try catch block from the java code in AdditionBPELClient n now i m gettin foll exception:
javax.xml.ws.WebServiceException: Unsupported endpoint address:
javax.faces.el.EvaluationException: javax.xml.ws.WebServiceException: Unsupported endpoint address:
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
at com.sun.rave.web.ui.appbase.faces.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
at javax.faces.component.UICommand.broadcast(UICommand.java:383)
at com.sun.webui.jsf.component.WebuiCommand.broadcast(WebuiCommand.java:160)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:94)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:267)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: javax.xml.ws.WebServiceException: Unsupported endpoint address:
at com.sun.xml.ws.api.pipe.TransportTubeFactory.create(TransportTubeFactory.java:144)
at com.sun.xml.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:112)

any idea why i m gettin it??
thanks in advance for any help..
Back to top
View user's profile Send private message
anushree



Joined: 14 Apr 2009
Posts: 11

PostPosted: Wed Apr 15, 2009 7:53 am    Post subject: javax.faces.el.EvaluationException: javax.xml.ws.WebServiceException: Unsupported endpoint address: Click to flag this post Reply with quote

hi i think i ve identified the exact problem...
it is not able to call the BPELOperation
the exception is coming from this line:
c= port.additionBPELOperation(a,b);

Caused by: com.sun.xml.ws.client.ClientTransportException: HTTP Status-Code 404: Not Found - Not Found
at com.sun.xml.ws.transport.http.client.HttpClientTransport.checkResponseCode(HttpClientTransport.java:219)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:149)
at com.sun.enterprise.webservice.ClientSecurityPipe.processSecureRequest(ClientSecurityPipe.java:176)
at com.sun.enterprise.webservice.ClientSecurityPipe.process(ClientSecurityPipe.java:164)
at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
at com.sun.xml.ws.client.Stub.process(Stub.java:248)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:135)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
at $Proxy121.additionBPELOperation(Unknown Source)
at additionbpelclient1.Page1.button1_action(Page1.java:210)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(AstValue.java:187)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
... 45 more

please help as i m a newbie at OpenESB...
thanks in advance
Back to top
View user's profile Send private message
bastian_knight



Joined: 02 May 2009
Posts: 1

PostPosted: Sat May 02, 2009 2:28 pm    Post subject: Reply with quote

I think that the 404 Error is there because you try to use a wrong port for calling a BPEL engine web service. In my installation the correct port is 9159.

You can find the right port in glassfish log files. Search for something like "sun-http-binding;9159;|WEB0712: Starting Sun-Java-System/Application-Server HTTP/1.1 on 9159".

Next to that message there should be an URL of deployed BPEL web service. In my logs it looks like this: "Prepared inbound endpoint {http://j2ee.netbeans.org/wsdl/RequestorWSDL}RequestorWSDLService,RequestorWSDLPort,inbound mapped to context /RequestorWSDLService/RequestorWSDLPort".

So the correct address for web service in my case is:
Code:
http://localhost:9169/RequestorWSDLService/RequestorWSDLPort

and WSDL can be found at address:
Code:
http://localhost:9169/RequestorWSDLService/RequestorWSDLPort?wsdl
Back to top
View user's profile Send private message
spektrum



Joined: 30 Nov 2008
Posts: 7
Location: Constantine

PostPosted: Tue May 12, 2009 9:35 pm    Post subject: Reply with quote

Hi everybody,
i've followed the tutorial by MadmanNero "http://www.7circles.de/soa" and i would to give you many thanks, but me and my friends have always an exception when trying to call a composite application from a JSP page, so i've found in another forum that the solution is as follow:
in the wsdl file imported from the BPEL module that you've created (i.e in the folder:" webpages/web-inf/wsdl/... to the wsdl file" try to change the string after "localhost:" by the value 9080 and redploy your application as in this example:

[<soap:address location="http://localhost:9080/FindPriceInDesiredCurrencyService/FindPriceInDesiredCurrencyPort"/>]

try it.
Back to top
View user's profile Send private message MSN Messenger
anushree



Joined: 14 Apr 2009
Posts: 11

PostPosted: Wed May 13, 2009 6:49 am    Post subject: Reply with quote

Hi spektrum..
could you please elaborate on how u called the comp application from JSP page??
i couldnt find anythin like that in the http://www.7circles.de/soa...
i m searchin for a way to make jsp call webservice via the bpel..
thanks in advance for any inputs...

spektrum wrote:
Hi everybody,
i've followed the tutorial by MadmanNero "http://www.7circles.de/soa" and i would to give you many thanks, but me and my friends have always an exception when trying to call a composite application from a JSP page, so i've found in another forum that the solution is as follow:
in the wsdl file imported from the BPEL module that you've created (i.e in the folder:" webpages/web-inf/wsdl/... to the wsdl file" try to change the string after "localhost:" by the value 9080 and redploy your application as in this example:

[<soap:address location="http://localhost:9080/FindPriceInDesiredCurrencyService/FindPriceInDesiredCurrencyPort"/>]

try it.
Back to top
View user's profile Send private message
spektrum



Joined: 30 Nov 2008
Posts: 7
Location: Constantine

PostPosted: Wed May 13, 2009 9:52 pm    Post subject: Reply with quote

Hi anushree,
look i've downloaded this tutorial and i'll put it as soon as possible in rapidshare so you'll be able to get it, and follow the steps in it and use my tip so the example will work;
i'll put the link here
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> SOA Users All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB