Thread: [Soaplab-users] Soaplab2, WSDLs and third-party clients
Brought to you by:
marsenger
From: Andrew C. <cl...@bi...> - 2008-06-05 16:02:00
|
Hi everyone, I'm a brand-new Soaplab user so apologies if I've missed something obvious here, but I've looked through the website and Google and haven't found any solutions. I've installed Soaplab2 and gone through the instructions in the first part of "Soaplab 2: Step by Step" successfully. So, I can connect to http://localhost:8080/soaplab2/ and see all the standard services supplied with the system, and get sensible results out. However, what I really need to do is ensure that I can consume Soaplab2 services in other clients. So I got the WSDL files in src/etc/wsdl and edited them to have http://localhost:8080/soaplab2/services instead of REPLACE_WITH_ACTUAL_URL. I then downloaded SoapUI to test them with (http://soapui.org/) and loaded up AnalysisList.wsdl, and it correctly parsed the service definitions and gave me request templates for each of them. However, I can't get anything out except faults. For example, when I try to call getAvailableAnalyses with the following request: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:org="http://org.soaplab.2"> <soapenv:Header/> <soapenv:Body> <org:getAvailableAnalyses/> </soapenv:Body> </soapenv:Envelope> I just get this response: <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <S:Fault xmlns:ns3="http://www.w3.org/2003/05/soap-envelope"> <faultcode>S:Client</faultcode> <faultstring>Cannot find dispatch method for {http://org.soaplab.2}getAvailableAnalyses</faultstring> </S:Fault> </S:Body> </S:Envelope> What am I doing wrong? I know it's not a SoapUI-specific fault because the same thing happens when I try to call methods with the Perl module SOAP::WSDL too. wsdl2perl.pl generates client proxy classes quite happily, with no errors, but I just get the same exceptions about missing dispatch methods. I'd really appreciate any suggestions you can throw my way because Soaplab2 looks like exactly what we need for this project (exposing various analytical processes from the CATH database). Thanks in advance, Dr Andrew Clegg CATH Group Research Dept. of Structural & Molecular Biology University College London http://cathdb.info/ |
From: Mahmut U. <ul...@eb...> - 2008-06-05 16:14:46
|
> However, what I really need to do is ensure that I can consume Soaplab2 > services in other clients. So I got the WSDL files in src/etc/wsdl and edited > them to have > > http://localhost:8080/soaplab2/services > > instead of REPLACE_WITH_ACTUAL_URL. if I look at how jaxws replaces the same string in the dynamic wsdl it generates http://localhost:8080/soaplab2/services/list?wsdl i found it is replaced by "http://localhost:8080/soaplab2/services/list" you may try appending "/list" to your replacement url Regards, Mahmut |
From: Andrew C. <cl...@bi...> - 2008-06-06 13:49:38
|
On Thursday 05 June 2008 17:14, Mahmut Uludag wrote: > > if I look at how jaxws replaces the same string in the dynamic wsdl it > generates > > http://localhost:8080/soaplab2/services/list?wsdl > > i found it is replaced by "http://localhost:8080/soaplab2/services/list" > > you may try appending "/list" to your replacement url Okay, that works for AnalysisList.wsdl, thanks. Not really sure what I'm doing with Analysis.wsdl though, to be honest. If I put the name of a specific service in there (e.g. /soaplab2/services/helloworld) I get "unknown service 'helloworld'". This is despite the fact that I haven't changed any defaults, and my web.xml in Tomcat says: <!-- Soaplab2 all other services --> <servlet-mapping> <servlet-name>soaplab2</servlet-name> <url-pattern>/services/*</url-pattern> </servlet-mapping> which suggests to me that /soaplab2/services/helloworld should work. (These are just calling the describe method, nothing with parameters yet.) Am I missing something? Do I need to do something else to let Tomcat or Soaplab know which URLs relate to which services? Thanks again, Andrew. |
From: Mahmut U. <ul...@eb...> - 2008-06-06 14:05:07
|
> Not really sure what I'm doing > with Analysis.wsdl though, to be honest. > > If I put the name of a specific service in there > (e.g. /soaplab2/services/helloworld) I get "unknown service 'helloworld'". not sure I understood you correctly but if you are looking for the replacement url in the WSDL file of the Analysis service it is "http://localhost:8080/soaplab2/services" in my dynamically generated WSDL file (which I can access using the following url of my local server) http://localhost:8080/soaplab2/services?wsdl Regards, Mahmut |
From: Andrew C. <cl...@bi...> - 2008-06-06 14:23:02
|
On Friday 06 June 2008 15:04, Mahmut Uludag wrote: > > not sure I understood you correctly but if you are looking for the > replacement url in the WSDL file of the Analysis service it is > "http://localhost:8080/soaplab2/services" in my dynamically generated > WSDL file (which I can access using the following url of my local > server) > > http://localhost:8080/soaplab2/services?wsdl Okay -- I didn't realise you could access the WSDL dynamically like that, thanks. But I'm still not clear about how to access *specific* services (e.g. helloworld) via that generic interface definition. If I load up that WSDL in SoapUI, and create a new 'describe' request for example, there's no parameter into which I can put the name of the service I want to describe -- so how does Soaplab know *which* service I want to get the description for? (Or run any other method on...) And if I run 'describe' without any parameters, I still get the same error message as when I loaded the WSDL file locally: <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <S:Fault xmlns:ns3="http://www.w3.org/2003/05/soap-envelope"> <faultcode>S:Server</faultcode> <faultstring>Unknown service 'services'</faultstring> <detail> <ns2:SoaplabException xmlns:ns2="http://org.soaplab.2" xmlns:ns3="http://services.soaplab.org/"> <message>Unknown service 'services'</message> </ns2:SoaplabException> <ns2:exception class="org.soaplab.share.SoaplabException" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false" xmlns:ns2="http://jax-ws.dev.java.net/"> <message>Unknown service 'services'</message> <ns2:stackTrace> <ns2:frame class="org.soaplab.services.metadata.MetadataAccessorXML" file="MetadataAccessorXML.java" line="118" method="<init>"/> <!-- blah blah blah --> <ns2:frame class="java.lang.Thread" file="Thread.java" line="619" method="run"/> </ns2:stackTrace> </ns2:exception> </detail> </S:Fault> </S:Body> </S:Envelope> Just to experiment, I tried changing the WSDL location to: http://localhost:8080/soaplab2/services/helloworld?wsdl and this did indeed give me a valid WSDL. However, calling 'describe' still resulted in the same exception (whether I changed the endpoint to services/helloworld or kept it as just services). Forgive me if I've missed something obvious -- I'm new to webservices in Java, having only done them in C# and (to a lesser extent) Perl before... Thanks for your help, Andrew. |
From: Mahmut U. <ul...@eb...> - 2008-06-06 14:41:30
|
> I'm still not clear about how to access *specific* services > (e.g. helloworld) via that generic interface definition. > > If I load up that WSDL in SoapUI, and create a new 'describe' request for > example, there's no parameter into which I can put the name of the service > I want to describe -- so how does Soaplab know *which* service I want to > get the description for? (Or run any other method on...) Soaplab use the following line of code to find out name of the service called. String serviceName = StringUtils.substringAfterLast (requestURI, "/"); service names should normally include group name as well. for example when using the default helloworld service it should be "classic.helloworld". Regards, Mahmut |
From: Andrew C. <cl...@bi...> - 2008-06-06 14:43:33
|
On Friday 06 June 2008 15:41, Mahmut Uludag wrote: > > Soaplab use the following line of code to find out name of the service > called. > > String serviceName = StringUtils.substringAfterLast (requestURI, "/"); > > service names should normally include group name as well. for example > when using the default helloworld service it should be > "classic.helloworld". Success! Thanks :-) Have a good weekend, Andrew. |
From: Sebastien M. <Seb...@un...> - 2008-06-26 15:24:54
|
>> Soaplab use the following line of code to find out name of the service >> called. >> >> String serviceName = StringUtils.substringAfterLast (requestURI, "/"); >> >> service names should normally include group name as well. for example >> when using the default helloworld service it should be >> "classic.helloworld". > > Success! Thanks :-) > > Have a good weekend, > > Andrew. Hi, I have the same problem than you had but I cannot get success. I can only use AnalysisList because some of its functions do not need arguments. With SoapUI, if I want to run 'getCharacteristics' how do you pass 'classic.helloworld' ? Where should I write 'classic.helloworld' ? It does not work between arg0 tags for me. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:org="http://org.soaplab.2"> <soapenv:Header/> <soapenv:Body> <org:getCharacteristics> <!--Optional:--> <arg0></arg0> </org:getCharacteristics> </soapenv:Body> </soapenv:Envelope> And with perl SOAP::Lite my $client = SOAP::Lite->service('http://localhost:8080/soaplab2/services?wsdl'); $client->getCharacteristics(); How to pass 'classic.helloworld' ? Thanks -- Sébastien Moretti |
From: Mahmut U. <ul...@eb...> - 2008-06-26 15:32:37
|
Hi Sebastian, > my $client = > SOAP::Lite->service('http://localhost:8080/soaplab2/services?wsdl'); > > $client->getCharacteristics(); > > How to pass 'classic.helloworld' ? You should specify the service name within the endpoint you use, similar to the following example http://localhost:8080/soaplab2/services/classic.helloworld?wsdl Regards, Mahmut |
From: Sebastien M. <Seb...@un...> - 2008-06-27 07:07:47
|
> Hi Sebastian, > >> my $client = >> SOAP::Lite->service('http://localhost:8080/soaplab2/services?wsdl'); >> >> $client->getCharacteristics(); >> >> How to pass 'classic.helloworld' ? > > You should specify the service name within the endpoint you use, similar > to the following example > > http://localhost:8080/soaplab2/services/classic.helloworld?wsdl > > Regards, > Mahmut Thanks. It will be easier to reach a specific application. But what should be arguments for 'describe', 'getCharacteristics' or 'run' by example ? It is not clear in my mind as it is for simpler WSDL file (http://prodom.prabi.fr/prodom/current/wsdl/essairunmkdom.wsdl). In a word, how can I get a list of application arguments, and how to run an application ? -- Sébastien Moretti |