- This topic has 13 replies, 6 voices, and was last updated 15 years, 3 months ago by
asifsidd.
-
AuthorPosts
-
klusiMemberHello,
I tried the HelloWorld-WebService example from the MyEclipse-Helppages and I managed to successfully deploy the service to a JBoss-4.0.4 server. I tested the service with the WebServiceExplorer tool and everything works fine.
After testing the service, I tried to generate a HelloWorld client with the “New->WebServiceClient” feature. I specified the WSDL-Url in the wizard and the generation completed successfully.
My problem is that when I try to run the generated HelloWorldServiceClient.java file, I get an exception:
17.02.2007 11:45:22 org.codehaus.xfire.transport.local.LocalChannel getService INFO: Unable to locate 'HelloWorldService' in ServiceRegistry 17.02.2007 11:45:22 org.codehaus.xfire.handler.DefaultFaultHandler invoke INFO: Fault occurred! org.codehaus.xfire.fault.XFireFault: Could not find a service to invoke. at org.codehaus.xfire.handler.LocateBindingHandler.invoke(LocateBindingHandler.java:39) at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131) at org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:64) at org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38) at org.codehaus.xfire.transport.local.LocalChannel.sendViaNewChannel(LocalChannel.java:172) at org.codehaus.xfire.transport.local.LocalChannel.send(LocalChannel.java:99) at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26) at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131) at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75) at org.codehaus.xfire.client.Client.invoke(Client.java:335) at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77) at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57) at $Proxy8.example(Unknown Source) at org.klusi.ws.test.client.HelloWorldServiceClient.main(HelloWorldServiceClient.java:126) 17.02.2007 11:45:22 org.codehaus.xfire.handler.DefaultFaultHandler sendToDeadLetter SCHWERWIEGEND: Could not find service. org.codehaus.xfire.fault.XFireFault: Could not find a service to invoke. at org.codehaus.xfire.handler.LocateBindingHandler.invoke(LocateBindingHandler.java:39) at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131) at org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:64) at org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38) at org.codehaus.xfire.transport.local.LocalChannel.sendViaNewChannel(LocalChannel.java:172) at org.codehaus.xfire.transport.local.LocalChannel.send(LocalChannel.java:99) at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26) at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131) at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75) at org.codehaus.xfire.client.Client.invoke(Client.java:335) at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77) at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57) at $Proxy8.example(Unknown Source) at org.klusi.ws.test.client.HelloWorldServiceClient.main(HelloWorldServiceClient.java:126)
What am I doing wrong here? I assumed that the generated client should run without any problems.
Best regards
Thorsten
February 19, 2007 at 11:55 am #266305
Riyad KallaMemberThorsten,
Strange. You are still running JBoss right? What does your main method look like in the HelloWorldServiceClient.java class?February 20, 2007 at 6:56 am #266358
klusiMemberYes, I had my JBoss running when I started the test client. I can post the source code of the client class when I get home from work later. But it is simply the generated client. I did not make any changes.
February 20, 2007 at 11:31 am #266383
Brian FernandesModeratorThorsten,
Which version of MyEclipse did you use to generate code? Version 5.1GA had a bug because of which it would sometimes generate incorrect code.
For example:Object portType = client.getCommerceServicePortTypeLocalEndpoint();
instead of the following correct code
Object portType = client.getCommerceServicePort();
So watch out for the generation of code which uses the LocalEndpoint instead of the actual service.
Failing that, please post some code here so we may have a better understanding of the situation.
February 21, 2007 at 9:43 am #266410
klusiMemberYes I am using MyEclipse 5.1. I will test your suggestion today and if it fails I will post the code.
February 22, 2007 at 11:06 am #266511
klusiMemberMy client main() method is as follows:
public static void main(String[] args) { HelloWorldServiceClient client = new HelloWorldServiceClient(); //create a default service endpoint HelloWorldServicePortType helloWorldServicePortType = client .getHelloWorldServiceHttpPort(); //PortTypeLocalEndpoint(); String res = helloWorldServicePortType.example("client helloworld"); System.out.println("Result = "+res); System.out.println("test client completed"); System.exit(0); }
As you can see, I had to replace the call of getHelloWorldServicePortTypeLocal to getHelloWorldServiceHttpPort(). It now seems to work.
February 23, 2007 at 2:06 pm #266600
forumansMemberI am new to the Web Services. I have created a client from a WSDL file using wizard New->Web Services Client -> Located WSDL file.
Tool created a package and bunch of .java classes. Which one is client .java class in that list? How to run that file? Help me plz.
Thanks,
ForumansFebruary 27, 2007 at 5:26 am #266675
Brian FernandesModeratorForumans,
What version of MyEclipse are you using?
The client class is the class with the name *Client.java. It is generated in a separate package if you specified a package during client generation.Sorry for the confusion, we’ll try and make the client more obvious in the future.
February 27, 2007 at 5:28 am #266676
Brian FernandesModeratorKlusi,
Thank you for following up with your experience, this bug has been put down already, glad it’s working for you now.
Brian.
March 1, 2007 at 9:41 am #266837
klingmankMember@Support-Brian wrote:
Klusi,
Thank you for following up with your experience, this bug has been put down already, glad it’s working for you now.
Brian.
Is this fixed in 5.5 milestone? I need to get a Client whipped out really quickly. What’s the workaround to modify the broken code, how much code do I have to change?
March 1, 2007 at 9:47 am #266841
Brian FernandesModeratorIt has been fixed in 5.5M1. Otherwise you can stick with 5.1.0 and you need to change just a single line of code as described above.
March 25, 2010 at 2:36 am #306982
asifsiddMember@Support-Brian wrote:
It has been fixed in 5.5M1. Otherwise you can stick with 5.1.0 and you need to change just a single line of code as described above.
Hi,
I generated the WebService Client side stuff using My Exclipse 5.0,
I used a url for my wsdl hosted on local tomcat.
I am getting this error when I try do this and run:public static void main(String[] args) {
HelloWorldServiceClient client = new HelloWorldServiceClient();
//create a default service endpoint
HelloWorldServicePortType helloWorldServicePortType = client.getHelloWorldServiceHttpPort();//TODO: Add custom client code here
//
//helloWorldServicePortType.yourServiceOperationHere();String s = helloWorldServicePortType.example(“A”);
System.out.println(“test client completed” + s );
System.exit(0);Issue: Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/commons/httpclient/methods/RequestEntity
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:108)
at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
at org.codehaus.xfire.client.Client.invoke(Client.java:335)
at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy8.example(Unknown Source)
at test.HelloWorldServiceClient.main(HelloWorldServiceClient.java:125)but I am able to see my Webservice methods using “launch webservice explorer tool of eclipse. Even it allows to access method and returns output to screen.
March 25, 2010 at 2:36 am #306983
asifsiddMember@Support-Brian wrote:
It has been fixed in 5.5M1. Otherwise you can stick with 5.1.0 and you need to change just a single line of code as described above.
Hi,
I generated the WebService Client side stuff using My Exclipse 5.0,
I used a url for my wsdl hosted on local tomcat.
I am getting this error when I try do this and run:public static void main(String[] args) {
HelloWorldServiceClient client = new HelloWorldServiceClient();
//create a default service endpoint
HelloWorldServicePortType helloWorldServicePortType = client.getHelloWorldServiceHttpPort();//TODO: Add custom client code here
//
//helloWorldServicePortType.yourServiceOperationHere();String s = helloWorldServicePortType.example(“A”);
System.out.println(“test client completed” + s );
System.exit(0);Issue: Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/commons/httpclient/methods/RequestEntity
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:108)
at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
at org.codehaus.xfire.client.Client.invoke(Client.java:335)
at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy8.example(Unknown Source)
at test.HelloWorldServiceClient.main(HelloWorldServiceClient.java:125)but I am able to see my Webservice methods using “launch webservice explorer tool of eclipse. Even it allows to access method and returns output to screen.
March 25, 2010 at 2:36 am #306984
asifsiddMember@Support-Brian wrote:
It has been fixed in 5.5M1. Otherwise you can stick with 5.1.0 and you need to change just a single line of code as described above.
Hi,
I generated the WebService Client side stuff using My Exclipse 5.0,
I used a url for my wsdl hosted on local tomcat.
I am getting this error when I try do this and run:public static void main(String[] args) {
HelloWorldServiceClient client = new HelloWorldServiceClient();
//create a default service endpoint
HelloWorldServicePortType helloWorldServicePortType = client.getHelloWorldServiceHttpPort();//TODO: Add custom client code here
//
//helloWorldServicePortType.yourServiceOperationHere();String s = helloWorldServicePortType.example(“A”);
System.out.println(“test client completed” + s );
System.exit(0);Issue: Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/commons/httpclient/methods/RequestEntity
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:108)
at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
at org.codehaus.xfire.client.Client.invoke(Client.java:335)
at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy8.example(Unknown Source)
at test.HelloWorldServiceClient.main(HelloWorldServiceClient.java:125)but I am able to see my Webservice methods using “launch webservice explorer tool of eclipse. Even it allows to access method and returns output to screen.
-
AuthorPosts