Best Practice for multi-server web service ?
Hi, I have a web service which must be deployed on multiple servers. It's the same web service, except for a few differences in the services.xml file (configuration information, such as database connection string, etc...). I'm coding this web service in Eclipse, and so what I do is I set up services.xml for the first server, build the service, and then use Axis2's admin module on the first server to deploy it; I modify services.xml for the second server, build, then deploy that one; and so on for the other servers. There must be a better way ? For example, is there a way for an Axis2 service to get its configuration from a file outside the .aar, so that it doesn't need to be deployed every time ? Or, is there a way in Eclipse I can automate the creation of the different versions of the service ? What's the best practice on this ? Thanks. -- View this message in context: http://www.nabble.com/Best-Practice-for-multi-server-web-service---tp23501160p23501160.html Sent from the Axis - User mailing list archive at Nabble.com.
Re: WSDL2JAVA created uncompilable Stub
Hi Pricilla, I'll answer you to the best of my knowledge, which is limited to how I've used Axis so far. The file with the word Skeleton in it is the only file that you should have to modify. The java class that you created in the first steps (to come up with the WSDL file) probably only contained the signatures of your web service methods. The Skeleton file is pretty much the equivalent of your .java file, e.g. it only contains method signatures, but it uses SOAP object types instead of the types that you used. Look for your method names in the skeleton file. There should be a comment for each of them telling you that you need to implement them (along with a thrown exception). In other words, for each of your methods, remove everything between the opening and closing braces, and start coding. The WSDL2Java process should have also created a build.xml file. Once your Skeleton is coded, you can right-click this build file, and choose Run as..., and then Ant Build. This will compile your classes (skeleton included), and create the .class files and a .aar file in the build sub-directory of your project (which it will create). The .aar file is the archive that you need to deploy to a container. Personnally, I use Tomcat, and so that's what I'll talk to you about. First, you need to download and install Tomcat. Once tomcat is installed, you need to download and install the Axis2 War Archive FOR THE SAME VERSION OF AXIS2 THAT YOU USED TO CREATE YOUR WEB SERVICE. To install the .war file, you have two options : copy it to the TOMCAT_HOME/webapps directory (and restart tomcat just to make sure), or use the Tomcat Manager application that comes with Tomcat. I'll let you search a bit for that... Once Axis2 is installed, you can access it by going to http://server:8080/axis2. Three options will be offered there : Services, Validate, and Admin. You can validate your Axis2 installation with the Validate option. To deploy your service, again, you have two options. 1- drop your .aar file in the TOMCAT_HOME/webapps/axis2/WEB-INF/services directory, or use the deployment tool in the Admin section of axis2 (user/pass is admin/axis2). The deployment tool is the first option in the Admin section. For development, I also recommend editing the TOMCAT_HOME/webapps/axis2/WEB-INF/conf/axis2.xml configuration file. The line to edit is has hotupdate in it, you should set this parameter to true. This will make Axis re-deploy your web service every time you overwrite the .aar file with a new one. As for the stub, don't touch it. It was created by WSDL2Java to match the method signatures of your web service. What you need to do in your client is instantiate it, and call its methods. It will take care of communicating with your web service and returning you the result. Here's a sample of my code that uses my stub. This is the more complex asynchronous call, for which you need to create a callback object. The more direct synchronous call is more intuitive... : Dispatch request = new Dispatch(); DispatcherStub stub = new DispatcherStub(http://; + dispatcherHost + :8080/axis2/services/Dispatcher); Callback callback = new Callback(); callback.setId(obj.getId()); request.setId(obj.getId()); stub.startdispatch(request, callback); I'm sure I forgot a detail or two, but that's the essence of it. pricilla p wrote: Hi Jacques, I am new to axis. I have to develop an web service I have followed the steps you mentioned and created a wsdl, skeleton and stubs. Could you pls tell me what changes i need to make it in skeleton and stub files Also pls tell me how to deploy this web service. Thanks, Pricilla. -- View this message in context: http://www.nabble.com/WSDL2JAVA-created-uncompilable-Stub-tp17775033p22927751.html Sent from the Axis - User mailing list archive at Nabble.com.
Re: WSDL2JAVA created uncompilable Stub
Just putting in my 2 cents, because a week ago I knew nothing about Axis, and I had to overcome some of the hurdles that have been encountered by other posters in the past... I hope I can avoid other people the same wasted time that I experienced... My environment is Eclipse 3.2.2, with the Codegen Wizard plugin. I have used the wizard in both directions (wsdl2java and java2wsdl) in versions 1.3 and 1.4.1 of Axis2. About the wizard : when you go to the Axis website, you can download the Codegen Wizard plugin for any version of Axis. What's misleading is that when you unzip each version (1.3 and 1.4.1), they both are contained in the Axis2_Codegen_Wizard_1.3.0 directory. Having successfully created my stubs with version 1.3 of the wizard and Axis libraries, I now wanted to compile them with Axis2 1.4.1. My first reaction when I downloaded the 1.4.1 wizard was to say hmmm... seems the wizard hasn't changed since version 1.3, because it's in the same directory name. WRONG ! Upon further inspection, I clearly saw that the libraries in the /lib directory of the plugin were indeed different. So, here are the steps I would recommend for a successful compile : - If you're in Eclipse, EXIT ! - If you have not done so yet, download the Axis2 standard distribution binary for the version you want, unzip it to some directory, and then create an environment variable AXIS2_HOME that points to that directory. - Download the Codegen Wizard for the Axis version you're shooting for (the same version as the standard distribution). Unzip it into your Eclipse's plugins directory. Note that if you had a previous version of the plugin there, you're gonna have to overwrite it with this new one if they both have the same name. - Copy the geronimo-stax-api_1.0_spec-1.0.1.jar and backport-util-concurrent-3.1.jar from the AXIS2_HOME/lib directory to the Wizard's /lib directory. - Edit the plugin.xml file of the Wizard. You'll see in there a bunch of library nodes, add 2 nodes pointing to the jars you just copied. - Start Eclipse - Create a new project - In that project, import the jars from the AXIS2_HOME/lib directory (import them in a new folder you'll call lib) - Refresh the project - Project properties : Add all the jars to the build path - Create some java class that will have the methods you want your web service to have. Save it. - Right-click on the project, New-, Other... - Select Axis2 Wizards - Axis2 Code Generator, Next. - Select Java2WSDL - Type the fully qualified class name, and then add the path for the class file. For example, if you class is com.xyz.TheClass, and your java source is in SomeDir/src/com/xyz/TheClass.java, and the corresponding class file is in SomeDir/bin/com/xyz/TheClass.class, then you'd enter SomeDir/bin. - Click Test Class Loading... If it doesn't work, review previous step. - Click Next, and you can change the options if you want, and then click next again. - Select to send the output to a project in the workspace, and browse to that project. Then give your wsdl a name, and click Finish. - Hopefully, all went well, and if you refresh your project, you'll see the WSDL. Now, if you want to create client and server code for this new WSDL: - Go in the codegen wizard again, this time select WSDL2Java, click Next. - Select the WSDL file you've just created. Next. - In Codegen Option, select Custom. Check Generate both... (last checkbox). Next. - Browse to the project location, and Click Finish. You should have the client and server code generated, along with a nice ant build file. The class you'll want to modify is ClassNameSkeleton.java for the server-side. For a client to use that service, you'd instantiate ClassNameStub.java. I really hope this helps someone in the future. It's been a frustrating week. Jacques. -- View this message in context: http://www.nabble.com/WSDL2JAVA-created-uncompilable-Stub-tp17775033p22872262.html Sent from the Axis - User mailing list archive at Nabble.com.
Re: [Axis2] WSDL2Java generate code for only one method in the service
This is only a guess, but I'm pretty sure that you could delete all the methods you don't want from the WSDL file itself, and then use WSDL2Java on the resulting file... Of course, I'm again guessing that you couldn't remove methods or types that are referred by other parts of the WSDL file... My understanding is that the WSDL file is simply a descriptor of the methods (and objects used by those methods) of an application. Remove method descriptors from the file, and WSDL2Java should generate an application without those methods. But I'm new to this whole WSDL thing, so don't take my answer too seriously... Oh, also note that there are 2 ways to generate the result : very few BIG files, of a lot of small files... I think the param to use is '-u' to get the smaller files... AQureshi wrote: Hi All, I have a WSDL file with around 15 different methods but I want to use only one of those in my application. I tried the WSDL2Java tool which worked great except that the generated code is thousands of lines. Is there a way I can limit the tool to generate only a subset or do I just have to open the generated file and delete the unwanted code? It is fairly easy to do that but it is just not automate-able. Thanks a lot. Affan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Just-a-small-client-sample-would-really-be-great-%21-tp16532618p16685278.html Sent from the Axis - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Just a small client sample would really be great !
At last, success ! I tweeked your build.properties file, build.xml file, installed junit, launched ant, and it came back with exceptions. I decided to install the 1.5 jdk from Sun instead (I don't know what Fedora was using), and the exceptions went away. So I think my last problems from the last 2 days had to do with the wrong JDK. Just thought I'd post that fact, maybe it'll help someone along the way. Thanks Alberto. You were very helpful. Jacques alpatino2 wrote: On Fri, Apr 11, 2008 at 10:39 AM, Jacques46 [EMAIL PROTECTED] wrote: By the way, I was wondering on which platform you generated the Java files ? Linux, is there another operating system? ;-) I'm asking because I was using Windows, but decided to try Linux (Fedora), with the same Snapshot distribution, and I got a bunch of warnings and exceptions... Nice decision, I uploaded my project here: http://www.4shared.com/file/43790367/3e3548a7/betdaqtar.html It would be fine if you can understand the structure of the project and use the build.xml for future projects. Also you can import the same project to eclipse: Please read the README file inside the sample, the build.xml is not tested but you can give you an idea to customize it to your needs. -- View this message in context: http://www.nabble.com/Just-a-small-client-sample-would-really-be-great-%21-tp16532618p16648697.html Sent from the Axis - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Just a small client sample would really be great !
By the way, I was wondering on which platform you generated the Java files ? I'm asking because I was using Windows, but decided to try Linux (Fedora), with the same Snapshot distribution, and I got a bunch of warnings and exceptions... Here's the log with the -u option : ./wsdl2java.sh -or -u -uri http://api.betdaq.com/v2.0/API.wsdl Using AXIS2_HOME: /home/jacques/axis2-SNAPSHOT Using JAVA_HOME: /usr/lib/jvm/java-1.5.0-gcj-1.5.0.0 Retrieving document at 'http://api.betdaq.com/v2.0/API.wsdl'. [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}ChangeHeartbeatRegistrationRequest missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}ListBootstrapOrdersResponse missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}ListAccountPostingsResponseItem missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}GetPricesResponse missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}PulseResponse missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}ListMarketWithdrawalHistoryResponseItem missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}ListMarketWithdrawalHistoryResponse missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}UpdateOrdersNoReceiptResponseItem missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}PlaceOrdersNoReceiptResponseItem missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}ListSelectionsChangedSinceResponseItem missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}ListTopLevelEventsRequest missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}CancelAllOrdersOnMarketRequest missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}RegisterHeartbeatRequest missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}CancelOrdersResponse missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}GetMarketInformationRequest missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}PlaceOrdersWithReceiptRequestItem missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}PlaceOrdersWithReceiptRequest missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}ListOrdersChangedSinceResponse missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}CancelAllOrdersResponseItem missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}SuspendOrdersRequest missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}UnsuspendFromTradingResponse missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}GetCurrentSelectionSequenceNumberRequest missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}SuspendAllOrdersOnMarketResponse missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}GetEventSubTreeWithSelectionsResponse missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}SuspendAllOrdersOnMarketRequest missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}ListTopLevelEventsResponse missing! [WARN] Type {http://www.GlobalBettingExchange.com/ExternalAPI/}ListSelectionsChangedSinceRequest missing! Exception in thread main org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:271) at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35) at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24) Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:53) at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224) ...2 more Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(libgcj.so.8rh) at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:50) ...3 more Caused by: org.apache.axis2.schema.SchemaCompilationException: java.lang.NullPointerException at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:289) at org.apache.axis2.schema.ExtensionUtility.invoke(ExtensionUtility.java:103) at java.lang.reflect.Method.invoke(libgcj.so.8rh) ...4 more Caused by: java.lang.NullPointerException at org.apache.axis2.schema.SchemaCompiler.writeElement(SchemaCompiler.java:522) at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:381) at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:280) ...6 more And here's the log without the -u option: Using AXIS2_HOME: /home/jacques/axis2-SNAPSHOT Using JAVA_HOME: /usr/lib/jvm/java-1.5.0-gcj-1.5.0.0 Retrieving document at 'http://api.betdaq.com/v2.0/API.wsdl'. [WARN]
Re: Just a small client sample would really be great !
This is getting really frustrating... -( I downloaded the snapshot distribution from here (by the way it was the april 10 version): http://people.apache.org/dist/axis2/nightly/distribution-SNAPSHOT-bin.zip http://people.apache.org/dist/axis2/nightly/distribution-SNAPSHOT-bin.zip I dropped it to a folder on my drive. I updated my AXIS2_HOME environment variable to point to that folder. Opened a DOS prompt, went to the folder's bin sub-folder, and typed : wsdl2java -u -uri http://api.betdaq.com/v2.0/API.wsdl This created a src sub-tree. In \src\com\globalbettingexchange\www\externalapi, I found all the generated classes. I copied the \com folder to my Eclipse project. I then copied all the jars from the \lib sub-folder of the distribution to my project's lib directory, and updated the build path in the project properties to include those jars. Tried compiling : came up with a bunch of errors. The first one says : [javac] ...\com\globalbettingexchange\www\externalapi\ReadOnlyServiceStub.java:413: cannot find symbol [javac] symbol : method receiveResultGetPrices(com.globalbettingexchange.www.externalapi.GetPricesResponseE) [javac] location: class com.globalbettingexchange.www.externalapi.ReadOnlyServiceCallbackHandler [javac] callback.receiveResultGetPrices( Sure enough, this receiveResultGetPrices method is nowhere to be found in any of the source files generated by wsdl2java. Could it be that the snapshot of April 10th has a bug ? alpatino2 wrote: I noticed a different behavior using axis2-SNAPSHOT, let me show you a wireshark tcpdump, you can download it here: http://www.4shared.com/file/43614007/1e675e4b/soaprequest.html As you can see the soap body is empty but the info is inside de SOAP Header, could you try to run the program with the SANPSHOT version? Also please update your source code with the right class names, because you know the newest axis2 version uses a new naming schema. Here is the sample code I tried: http://www.4shared.com/file/43614271/bbc1b9d7/BetdaqClient.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Just-a-small-client-sample-would-really-be-great-%21-tp16532618p16608590.html Sent from the Axis - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Just a small client sample would really be great !
By the way, if you have the time Alberto, maybe you could subscribe to nabble.com, I find the mailing list to be slow, whereas posts to the list through Nabble can be seen instantaneously on the web site... Here's this thread's url: http://www.nabble.com/Just-a-small-client-sample-would-really-be-great-%21-tt16532618.html#a16532618 http://www.nabble.com/Just-a-small-client-sample-would-really-be-great-%21-tt16532618.html#a16532618 -- View this message in context: http://www.nabble.com/Just-a-small-client-sample-would-really-be-great-%21-tp16532618p16609469.html Sent from the Axis - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Just a small client sample would really be great !
I tried generating the code again with the wsdl2java utility. With the -u option, the receiveResultGetPrices (and, I'm sure other methods as well) is missing from the ReadOnlyServiceCallbackHandler.java file. If I remove the -u option, then the method is there, but of course, instead of getting hundreds of java files, I only get 4, 2 of them being huge... small annoyance, the important thing is I can now talk to Betdaq. Thank you very much for your help Alberto. Hoping it helps someone else along the way. alpatino2 wrote: I downloaded the yesterday snapshot as you and I only had to update the client code modifying the BaseResponseSequence3 class to BaseResponseSequence6 and its working... Clean all your project and start from the beginning -- View this message in context: http://www.nabble.com/Just-a-small-client-sample-would-really-be-great-%21-tp16532618p16623910.html Sent from the Axis - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Just a small client sample would really be great !
Turns out I was missing a couple of jars in the classpath. I'm now at the point where I know that I'm actually sending requests to the Betdaq server and receiving responses... The exception I'm getting now is: org.apache.axis2.databinding.ADBException: Unexpected subelement ListTopLevelEventsResult If I turn on HTTP traffic logging, I can now see that I'm getting an IncorrectVersionNumber error back from Betdaq. Looking at the original code that you gave me, I saw that you were setting theVersion to 1. I tried setting it to 2, but it didn't help. Looking at the logs, it seems that all the header attributes that the code is supposedly setting is not used at all in the SOAP message. Here's my log : 2008/04/08 10:57:29:499 EDT [DEBUG] HttpConnection - Open connection to api.betdaq.com:80 2008/04/08 10:57:29:639 EDT [DEBUG] header - POST /v2.0/ReadOnlyService.asmx HTTP/1.1[\r][\n] 2008/04/08 10:57:29:655 EDT [DEBUG] HttpMethodBase - Adding Host request header 2008/04/08 10:57:29:671 EDT [DEBUG] header - Content-Type: text/xml; charset=UTF-8[\r][\n] 2008/04/08 10:57:29:671 EDT [DEBUG] header - SOAPAction: http://www.GlobalBettingExchange.com/ExternalAPI/ListTopLevelEvents[\r][\n]; 2008/04/08 10:57:29:671 EDT [DEBUG] header - User-Agent: Axis2[\r][\n] 2008/04/08 10:57:29:671 EDT [DEBUG] header - Host: api.betdaq.com[\r][\n] 2008/04/08 10:57:29:671 EDT [DEBUG] header - Transfer-Encoding: chunked[\r][\n] 2008/04/08 10:57:29:671 EDT [DEBUG] header - [\r][\n] 2008/04/08 10:57:29:702 EDT [DEBUG] content - 18d[\r][\n] 2008/04/08 10:57:29:702 EDT [DEBUG] content - ?xml version='1.0' encoding='UTF-8'?soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;soapenv:Headerns1:ExternalApiHeader xmlns:ns1=http://www.GlobalBettingExchange.com/ExternalAPI/; soapenv:mustUnderstand=0 //soapenv:Headersoapenv:Bodyns1:ListTopLevelEvents xmlns:ns1=http://www.GlobalBettingExchange.com/ExternalAPI/; //soapenv:Body/soapenv:Envelope 2008/04/08 10:57:29:702 EDT [DEBUG] content - [\r][\n] 2008/04/08 10:57:29:702 EDT [DEBUG] content - 0 2008/04/08 10:57:29:702 EDT [DEBUG] content - [\r][\n] 2008/04/08 10:57:29:702 EDT [DEBUG] content - [\r][\n] 2008/04/08 10:57:29:702 EDT [DEBUG] EntityEnclosingMethod - Request body sent 2008/04/08 10:57:29:827 EDT [DEBUG] header - HTTP/1.1 100 Continue[\r][\n] 2008/04/08 10:57:29:827 EDT [INFO] HttpMethodBase - Discarding unexpected response: HTTP/1.1 100 Continue 2008/04/08 10:57:29:827 EDT [DEBUG] header - HTTP/1.1 200 OK[\r][\n] 2008/04/08 10:57:29:827 EDT [DEBUG] header - Date: Tue, 08 Apr 2008 14:57:29 GMT[\r][\n] 2008/04/08 10:57:29:827 EDT [DEBUG] header - Server: Microsoft-IIS/6.0[\r][\n] 2008/04/08 10:57:29:842 EDT [DEBUG] header - X-Powered-By: ASP.NET[\r][\n] 2008/04/08 10:57:29:842 EDT [DEBUG] header - X-AspNet-Version: 2.0.50727[\r][\n] 2008/04/08 10:57:29:842 EDT [DEBUG] header - Cache-Control: private, max-age=0[\r][\n] 2008/04/08 10:57:29:842 EDT [DEBUG] header - Content-Type: text/xml; charset=utf-8[\r][\n] 2008/04/08 10:57:29:842 EDT [DEBUG] header - Content-Length: 1394[\r][\n] 2008/04/08 10:57:29:842 EDT [DEBUG] content - ?xm 2008/04/08 10:57:29:858 EDT [DEBUG] content - l version=1.0 encoding=utf-8?soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:wsa=http://schemas.xmlsoap.org/ws/2004/03/addressing; xmlns:wsse=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd; xmlns:wsu=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd;soap:Headerwsa:Actionhttp://www.GlobalBettingExchange.com/ExternalAPI/ListTopLevelEventsResponse/wsa:Actionwsa:MessageIDuuid:0daeb813-d09f-4e2b-a8ae-83f37b971bfb/wsa:MessageIDwsa:RelatesTouuid:813f4579-17fe-460b-a47e-1c18dca0e5b6/wsa:RelatesTowsa:Tohttp://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous/wsa:Towsse:Securitywsu:Timestamp wsu:Id=Timestamp-ea4eed52-4bef-411d-9971-559f3e572e19wsu:Created2008-04-08T14:57:29Z/wsu:Createdwsu:Expires2008-04-08T15:02:29Z/wsu:Expires/wsu:Timestamp/wsse:Security/soap:Headersoap:BodyListTopLevelEventsResponse xmlns=http://www.GlobalBettingExchange.com/ExternalAPI/;ListTopLevelEventsResultReturnStatus Code=308 Description=IncorrectVersionNumber CallId=c9fe82ee-1cb4-4f68-a52c-0b9863758e29 /Timestamp2008-04-08T15:57:29.6608494+01:00/Timestamp/ListTopLevelEventsResult/ListTopLevelEventsResponse/soap:Body/soap:Envelope -- View this message in context: http://www.nabble.com/Just-a-small-client-sample-would-really-be-great-%21-tp16532618p16559668.html Sent from the Axis - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Just a small client sample would really be great !
Thanks for still being here Alberto :-) Even though you provided fictitious data for the sample code, that fictitious data should be included in the resulting SOAP request, but it is not, and I can't figure out why (and am hoping you can point me in the right direction). Here's the SOAP request I end up with : ?xml version='1.0' encoding='UTF-8'? soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; soapenv:Header ns1:ExternalApiHeader xmlns:ns1=http://www.GlobalBettingExchange.com/ExternalAPI/; soapenv:mustUnderstand=0 / /soapenv:Header soapenv:Body ns1:ListTopLevelEvents xmlns:ns1=http://www.GlobalBettingExchange.com/ExternalAPI/; ns1:listTopLevelEventsRequest / /ns1:ListTopLevelEvents /soapenv:Body /soapenv:Envelope The specs say that all requests should be accompanied by the header, which includes the version number (which is 2 by the way), and that explains why I get the IncorrectVersionNumber error, which triggers my exception... alpatino2 wrote: It's good you could fix your problem Now, garbage in garbage out... the values I set in the source code were ficticius, I don't know what values should be send to the web service On Tue, Apr 8, 2008 at 10:03 AM, Jacques46 [EMAIL PROTECTED] wrote: ... -- View this message in context: http://www.nabble.com/Just-a-small-client-sample-would-really-be-great-%21-tp16532618p16570577.html Sent from the Axis - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Just a small client sample would really be great !
alpatino2 wrote: /** * */ package com.sample.betdaq; import java.math.BigDecimal; import java.rmi.RemoteException; import org.apache.axis2.AxisFault; import com.globalbettingexchange.www.externalapi.BaseResponseSequence3; import com.globalbettingexchange.www.externalapi.EventClassifierType; import com.globalbettingexchange.www.externalapi.ExternalApiHeader; import com.globalbettingexchange.www.externalapi.ExternalApiHeaderE; import com.globalbettingexchange.www.externalapi.ListTopLevelEvents; import com.globalbettingexchange.www.externalapi.ListTopLevelEventsRequest; import com.globalbettingexchange.www.externalapi.ListTopLevelEventsResponse; import com.globalbettingexchange.www.externalapi.ListTopLevelEventsResponseE; ... Forget my last comment about pretty printing errors, I've solved it with the -u option to wsdl2java... The output of wsdl2java was 197 classes. Good stuff. The only thing that doesn't work now is the fact that these two classes were NOT generated by wsdl2java, and thus cannot be imported in the test file : import com.globalbettingexchange.www.externalapi.ExternalApiHeaderE; import com.globalbettingexchange.www.externalapi.ListTopLevelEventsResponseE; I'm sure this is an easy problem to fix ? -- View this message in context: http://www.nabble.com/Just-a-small-client-sample-would-really-be-great-%21-tp16532618p16537516.html Sent from the Axis - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Just a small client sample would really be great !
I set the epr to http://api.betdaq.com/v2.0/ReadOnlyService.asmx;. I also changed all of the xxxE classes to the numbered class that had been created by wsdl2java. I get a full compile now, but an exception at runtime. So, my next 2 questions are : 1- can you point me to a page on the web that will explain what those numbered classes are for ? This is very confusing to a newbie like me... 2- do you understand why I get this exception : Exception in thread main java.lang.ExceptionInInitializerError at org.apache.axis2.util.XMLUtils.toOM(XMLUtils.java:564) at org.apache.axis2.deployment.DescriptionBuilder.buildOM(DescriptionBuilder.java:96) at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:79) at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:615) at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:115) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:180) at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:146) at org.apache.axis2.client.ServiceClient.init(ServiceClient.java:139) at com.globalbettingexchange.www.externalapi.ReadOnlyServiceStub.init(ReadOnlyServiceStub.java:44) at com.globalbettingexchange.www.externalapi.ReadOnlyServiceStub.init(ReadOnlyServiceStub.java:29) at com.globalbettingexchange.www.externalapi.ReadOnlyServiceStub.init(ReadOnlyServiceStub.java:77) at ca.jpti.scraper.book.Betdaq.main(Betdaq.java:207) Caused by: java.lang.IllegalStateException: No valid ObjectCreator found. at org.apache.axiom.om.util.StAXUtils$Pool.init(StAXUtils.java:64) at org.apache.axiom.om.util.StAXUtils.clinit(StAXUtils.java:88) ... 13 more alpatino2 wrote: I used Axis2-Snapshot newer release instead of axis2 1-3 I noticed this new axis2 release changed the naming convention of the generated code. If you look in the classes generated you will see the name of the class with a numeric suffix, for example you need lok for something like ExternalApiHeade99 instead of ExternalApiHeaderE . Also fix in the sample the path to the endpoint reference (epr) -- View this message in context: http://www.nabble.com/Just-a-small-client-sample-would-really-be-great-%21-tp16532618p16545847.html Sent from the Axis - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]