simple webservice
Hello I want to build a simple Webservice which returns a custom Object. Object is very simple: public class Luc { public String name; public String nachname; public int alter; public Luc(String name, String nachname, int alter) { this.name = name; this.nachname = nachname; this.alter = alter; } } services.xml is like (only relevant lines) operation name=getObject messageReceiver class=org.apache.axis2.rpc.receivers.RPCMessageReceiver / /operation Public relevant line of Webservice is like: public Luc getObject() throws Exception { return new Luc(luc, Fischer, 23); } WSDL: I can see that there is a namespace ns1:Luc. As a client I use C# (VisualStudio). The client produces a class called Luc but of course without any attributes, because they are not provided/specified in the wsdl! How can I solve that? Do I need to write my own axis2-Receiver? Where is the problem? btw. The client works fine if the webservice just offers a simple String, vgl. getVersion-sample! But with an object ... wsdl:definitions xmlns:ns1=http://org.apache.axis2/xsd; xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:tns=http://org.apache.axis2/; targetNamespace=http://org.apache.axis2/;wsdl:typesxs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:ns1=http://org.apache.axis2/xsd; targetNamespace=http://org.apache.axis2/xsd; elementFormDefault=unqualified attributeFormDefault=unqualified xs:element type=ns1:Luc name=Luc / xs:complexType name=Luc xs:sequence / /xs:complexType xs:element name=getObjectRequest xs:complexType / /xs:element xs:element name=getObjectResponse xs:complexType xs:sequence xs:element type=ns1:Luc name=return / /xs:sequence /xs:complexType /xs:element xs:element name=getVersionRequest xs:complexType / /xs:element xs:element name=getVersionResponse xs:complexType xs:sequence xs:element type=xs:string name=return / /xs:sequence /xs:complexType /xs:element /xs:schema/wsdl:typeswsdl:message name=getVersionResponseMessagewsdl:part name=part1 element=ns1:getVersionResponse //wsdl:messagewsdl:message name=getObjectResponseMessagewsdl:part name=part1 element=ns1:getObjectResponse //wsdl:messagewsdl:message name=getVersionRequestMessagewsdl:part name=part1 element=ns1:getVersionRequest //wsdl:messagewsdl:message name=getObjectRequestMessagewsdl:part name=part1 element=ns1:getObjectRequest //wsdl:messagewsdl:portType name=versionPortwsdl:operation name=getObjectwsdl:input message=tns:getObjectRequestMessage /wsdl:output message=tns:getObjectResponseMessage //wsdl:operationwsdl:operation name=getVersionwsdl:input message=tns:getVersionRequestMessage /wsdl:output message=tns:getVersionResponseMessage //wsdl:operation/wsdl:portTypewsdl:binding name=versionBinding type=tns:versionPortsoap:binding transport=http://schemas.xmlsoap.org/soap/http; style=document /wsdl:operation name=getObjectsoap:operation soapAction=getObject style=document /wsdl:inputsoap:body use=literal namespace=http://www.org.apache.axis2; //wsdl:inputwsdl:outputsoap:body use=literal namespace=http://www.org.apache.axis2; //wsdl:output/wsdl:operationwsdl:operation name=getVersionsoap:operation soapAction=getVersion style=document /wsdl:inputsoap:body use=literal namespace=http://www.org.apache.axis2; //wsdl:inputwsdl:outputsoap:body use=literal namespace=http://www.org.apache.axis2; //wsdl:output/wsdl:operation/wsdl:bindingwsdl:service name=versionwsdl:port name=versionPortType0 binding=tns:versionBindingsoap:address location=http://localhost:8080/axis2/services/version; //wsdl:port/wsdl:service/wsdl:definitions Thank you in advance for any help. Greets luc
RE: (OT) Making WSDL pretty?
Here's a thought, how about writing an XSL stylesheet that transforms your WSDL elements into HTML xsl:fo to generate a PDF, providing the layout you want. Corneil du Plessis Software Architect Standard Bank IT Development (w) +27 11 636-2210 (f) +27 11 636-5266 (m) +27 82 530-9259 -Original Message- From: Hernan Bay Area Guy [mailto:[EMAIL PROTECTED] Sent: 05 April 2006 21:42 To: axis-user@ws.apache.org Subject: RE: (OT) Making WSDL pretty? Jay, Thanks for the links, I'll take a look at them. Actually, I was looking for something that formats the WSDL so the datatype definition section resembles more a classical datatype definition. The graphical view of the Eclipse WSDL editor is a good example (a little tree view with pretty-looking boxes and arrows). Unfortunately it doesn't have a print option, or an export to PDF option. ... that I know of, of course! :-) Thanks, Hernan --- Jay Glanville [EMAIL PROTECTED] wrote: If you want to change the indenting of the WSDL to make it easier to read, use something like HTML Tidy (http://tidy.sf.net). It can handle XML as input and output formats. If you want something to extract the annotationdocumentation values out of your WSDL and generate a set of HTML pages for human-readable consumption, do a Google on wsdldoc. I think IBM had such a tool in it's emerging tool kit. I believe that bluetetra also has one (http://www.bluetetra.com/). JDG -Original Message- From: Hernan Bay Area Guy [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 05, 2006 12:37 PM To: axis-user@ws.apache.org Subject: (OT) Making WSDL pretty? Hello, (Apologies for the semi-offtopic post...) Does anybody know of a tool that one can use to generate a human-readable version of a WSDL file? I am working on a little SOAP service to wrap around a number-crunching engine (written in Perl and C). The programmer of the engine is even less experienced on WSDL than I am, so it would be useful to be able to have a nicely formatted version of the service's WSDL file so we can discuss the signatures of the operations, for example. So far the options I found were: - Print Screen's of the Eclipse WSDL editor - A little ad-hoc XML parser that I wrote from some code samples from the 'Net (so far it generates Twiki-fied text that I can cutpaste to our Twiki) Obviously none of these options is too elegant, and Google is not being much help here either :-( Is there an official tool for this type of job? Thanks in advance, Hernan __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __ Standard Bank Disclaimer and Confidentiality Note This e-mail, its attachments and any rights attaching hereto are, unless the context clearly indicates otherwise, the property of Standard Bank Group Limited and/or its subsidiaries (the Group). It is confidential, private and intended for the addressee only. Should you not be the addressee and receive this e-mail by mistake, kindly notify the sender, and delete this e-mail, immediately and do not disclose or use same in any manner whatsoever. Views and opinions expressed in this e-mail are those of the sender unless clearly stated as those of the Group. The Group accepts no liability whatsoever for any loss or damages whatsoever and howsoever incurred, or suffered, resulting, or arising, from the use of this email or its attachments. The Group does not warrant the integrity of this e-mail nor that it is free of errors, viruses, interception or interference. Licensed divisions of the Standard Bank Group are authorised financial services providers in terms of the Financial Advisory and Intermediary Services Act, No 37 of 2002 (FAIS). For information about the Standard Bank Group Limited visit our website http://www.standardbank.co.za ___
[Axis2] Client side configuration parameters
When testing the Axis2 0.94 security module, I have some questions regarding client side configuration. I raised the following question after reading the webpage http://ws.apache.org/axis2/0_94/security-module.html. 1. The page mentions that client side configuration parameters can be set in the axis2.xml of the client's Axis2 repository. My question is is this referring to the directory \axis2-std-0.94-bin\repository\services ? It is initially empty. What will be the root element in the client respository axis2.xml? Could you help me to get some sample client side configuration? 2. If a developer only downloaded WAR distribution and put the war inside the Tomcat webapps folder. Can he/she still configure the client side? How? 3. The page mentioned per service level security configuration. Could you also provided some details? My understanding is that the security configuration (security policy and security information) will be read by the WSDoAllHandler inside the security.module. I checked both WSDoAllSender and WSDoAllReceiver, but could not figure out where how can WSDoAllHandler find out the security configuration file. 4. As for the PasswordCallbackClass, is it possible to use the same PasswordCallbackClass for both client and server if I combine the client and server into the Axis2 installation in Tomcat? 5. Does Axis2 security module allow plain username and password for authentication? Can I specify the username and password inside the configuration? Regards, Xinjun
Re: simple webservice
h; As I can see please make sure Luc to be a java bean , currently it is not a bean; it should as follwos then you wont have any problem. public class Luc { public String name; public String nachname; public int alter; public Luc(String name, String nachname, int alter) { this.name = name; this.nachname = nachname; this.alter = alter; } public void setName(String name){ this.name = name; } public String getName(){ return this.name; } public void setNachname(String nachname){ this.nachname= nachname; } public String getNachname(){ return this.nachname; } public void setAlter(int alter){ this.alter= alter; } public int getAlter(){ return this.alter; } } Lukas Fischer / HTA wrote: Hello I want to build a simple Webservice which returns a custom Object. Object is very simple: public class Luc { public String name; public String nachname; public int alter; public Luc(String name, String nachname, int alter) { this.name = name; this.nachname = nachname; this.alter = alter; } } services.xml is like (only relevant lines) operation name=getObject messageReceiver class=org.apache.axis2.rpc.receivers.RPCMessageReceiver / /operation Public relevant line of Webservice is like: public Luc getObject() throws Exception { return new Luc(luc, Fischer, 23); } WSDL: I can see that there is a namespace ns1:Luc. As a client I use C# (VisualStudio). The client produces a class called Luc but of course without any attributes, because they are not provided/specified in the wsdl! How can I solve that? Do I need to write my own axis2-Receiver? Where is the problem? btw. The client works fine if the webservice just offers a simple String, vgl. getVersion-sample! But with an object ... wsdl:definitions xmlns:ns1=http://org.apache.axis2/xsd; xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:tns=http://org.apache.axis2/; targetNamespace=http://org.apache.axis2/;wsdl:typesxs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; xmlns:ns1=http://org.apache.axis2/xsd; targetNamespace=http://org.apache.axis2/xsd; elementFormDefault=unqualified attributeFormDefault=unqualified xs:element type=ns1:Luc name=Luc / xs:complexType name=Luc xs:sequence / /xs:complexType xs:element name=getObjectRequest xs:complexType / /xs:element xs:element name=getObjectResponse xs:complexType xs:sequence xs:element type=ns1:Luc name=return / /xs:sequence /xs:complexType /xs:element xs:element name=getVersionRequest xs:complexType / /xs:element xs:element name=getVersionResponse xs:complexType xs:sequence xs:element type=xs:string name=return / /xs:sequence /xs:complexType /xs:element /xs:schema/wsdl:typeswsdl:message name=getVersionResponseMessagewsdl:part name=part1 element=ns1:getVersionResponse //wsdl:messagewsdl:message name=getObjectResponseMessagewsdl:part name=part1 element=ns1:getObjectResponse //wsdl:messagewsdl:message name=getVersionRequestMessagewsdl:part name=part1 element=ns1:getVersionRequest //wsdl:messagewsdl:message name=getObjectRequestMessagewsdl:part name=part1 element=ns1:getObjectRequest //wsdl:messagewsdl:portType name=versionPortwsdl:operation name=getObjectwsdl:input message=tns:getObjectRequestMessage /wsdl:output message=tns:getObjectResponseMessage //wsdl:operationwsdl:operation name=getVersionwsdl:input message=tns:getVersionRequestMessage /wsdl:output message=tns:getVersionResponseMessage //wsdl:operation/wsdl:portTypewsdl:binding name=versionBinding type=tns:versionPortsoap:binding transport=http://schemas.xmlsoap.org/soap/http; style=document /wsdl:operation name=getObjectsoap:operation soapAction=getObject style=document /wsdl:inputsoap:body use=literal namespace=http://www.org.apache.axis2; //wsdl:inputwsdl:outputsoap:body use=literal namespace=http://www.org.apache.axis2; //wsdl:output/wsdl:operationwsdl:operation name=getVersionsoap:operation soapAction=getVersion style=document /wsdl:inputsoap:body use=literal namespace=http://www.org.apache.axis2; //wsdl:inputwsdl:outputsoap:body use=literal namespace=http://www.org.apache.axis2; //wsdl:output/wsdl:operation/wsdl:bindingwsdl:service name=versionwsdl:port name=versionPortType0 binding=tns:versionBindingsoap:address location=http://localhost:8080/axis2/services/version; //wsdl:port/wsdl:service/wsdl:definitions Thank you in advance for any help. Greets luc -- Thanks, Deepal ~Future is Open~
[Axis 1.3] wsdl with import vs. without import
Hello all, I think this post might be related to my last post titled: [Axis 1.3] Namespace issues, element with "" namespace I've been trying to include a schema to a wsdl document, generate code for axis and use the generated classes as a web service but when I include the schema doc, I find that (I think) because of the "" namespace being applied to an element higher up the doc multiple namespaces are being injected into the response (ns2 through ns15+) all of which have the exact same namespace (including the 'wrapper' element). I attached a .zip file (rename to .zip from _zip) with the two wsdls, the schemas, and the TCPMonitor capture of each... Any thoughts? I appreciate anyone taking the time to look at this... -cwd axis_zip Description: axis_zip
Re: [SPAM] - Re: [SPAM] - Re: Problems getting user exceptions to work - Found word(s) check out in the Text body - Found word(s) check out in the subject
Right. We use the WSDL to build java from, not the other way round. The problem is a bug in axis. We're going to write it up when we get the chance. In the meantime, you will need to decide whether or not to modify the WSDL. I will bet that if you look at the XML coming from the server, it is correct. The problem lies in the de-serialization of the fault. This is a work-around for that problem. Veprinsky, Michael wrote: Hello! I decided to piggy-back on this thread... I am having similar problems. Thom, What did you mean? I suppose recommend changing WSDL definition but a) my WSDL is auto-published so I can't really change it and b) even if I do, it does not change the XML that server generates and that is totally language-specific which kinda violates the purpose. Or did you mean something else? I am using Axis 1.3. I have following questions: 1) Is there a way to set server to use SOAP 1.2 (RTFMs are welcome, just tell where)? 2) Is there a way to specify custom values for faultcode/faultstring? Best I could get was my exception being serialized into XML under details but then I have to process it as XML :-\ 3) Overall, I need to publish a web service that is going to be used from different platforms. Is my best bet to just give up faults altogether and use some custom base result structure with generic error passing engine? Any recommendations (again, RTFMs are welcome) I do not expect much success since the envelope XSD itself is pretty limiting (http://schemas.xmlsoap.org/soap/envelope, toward the end), it's just those two fields and freeform XML details. SOAP 1.2 looks a little better but without documentation it did not help much either. Any recommendations/insights are welcome. Thank you, -Michael ___ Tell a man there are 300 billion stars in the universe and he'll believe Tell him a bench has wet paint on it and he'll have to touch to be sure -- /usr/bin/fortune -Original Message- From: Thom Hehl [mailto:[EMAIL PROTECTED] Sent: Thursday, March 30, 2006 1:47 PM To: axis-user@ws.apache.org Subject: Re: [SPAM] - Re: [SPAM] - Re: Problems getting user exceptions to work - Found word(s) check out in the Text body - Found word(s) check out in the subject Have a look at this: Give him This: _original type def from imported xsd___ complexType name=InvalidDateException sequence/ /complexType _also needed in wsdl file___ wsdl:message name=InvalidDateExceptionFault wsdl:part name=InvalidDateExceptionType type=ns:InvalidDateException/ /wsdl:message *(in the portType operation definition for a method throwing a fault)* wsdl:fault name=InvalidDateExceptionFault message=ns:InvalidDateExceptionFault/ *(in the binding operation definintion for a method throwing a fault)* wsdl:fault name=InvalidDateExceptionFault soap:fault use=literal name=InvalidDateExceptionFault/ /wsdl:fault Jack Lund wrote: See, I'm not really sure. The JAX/RPC spec is kinda hazy on how exceptions are handled, and how the soap fault maps to an exception. Here's what I'm seeing come back from the server: ?xml version=1.0 encoding=UTF-8? soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; soapenv:Body soapenv:Fault faultcodesoapenv:Server.userException/faultcode faultstringcom.foobar.ecommerce.beans.InvalidDateException: A valid date must be specified in the form of MM/DD/./faultstring detail com.foobar.ecommerce.beans.InvalidDateException xsi:type=ns1:InvalidDateException xmlns:ns1=urn:ClaimsData/ ns2:hostname xmlns:ns2=http://xml.apache.org/axis/;staportal01.stratarc.net/ns2:ho stname /detail /soapenv:Fault /soapenv:Body /soapenv:Envelope And here's what the corresponding part of the WSDL looks like: wsdl:types schema targetNamespace=urn:ClaimsData xmlns=http://www.w3.org/2001/XMLSchema; import namespace=http://hib.ecommerce.foobar.com/ import namespace=http://portal01.foobar.com:8080/axis/services/ClaimsData/ import namespace=http://dao.ecommerce.foobar.com/ import namespace=http://beans.ecommerce.foobar.com/ import namespace=http://schemas.xmlsoap.org/soap/encoding// complexType name=Claim sequence element name=amount type=xsd:double/ element name=claimDate nillable=true type=xsd:dateTime/ element name=claimDesc nillable=true type=xsd:string/ element name=claimID type=xsd:long/ element name=claimNumber nillable=true type=xsd:string/ element name=claimStatus nillable=true type=xsd:string/ element name=claimStatusName nillable=true type=xsd:string/ element name=formattedDate nillable=true type=xsd:string/ element name=policy nillable=true type=xsd:anyType/ element name=policyHolder nillable=true
Re: [Axis2] Client side configuration parameters
Hi Ruchith, I am really very very grateful to your enlighting explanation and clarification. I will go ahead with it. I just tried the security sample with the attached error message. I have already followed the steps in the ReadMe file in security sample folder. The following is the snippet of the error message. The full error message is attached. I will try Axis2 0.95 security at meanwhile. The original exception is BadPaddingException. Did i missed something? As mentioned, I have followed the instruction in the read me file. F:\download\axis2\axis2-std-0.94-bin\samples\security\srcjava sample.security.C lient ..\client_repo 8080 org.apache.axis2.AxisFault: org.apache.axis2.AxisFault: WSDoAllReceiver: securit y processing failed; nested exception is: org.apache.ws.security.WSSecurityException: Cannot encrypt/decrypt data; nested exception is: org.apache.xml.security.encryption.XMLEncryptionException: pad block cor rupted Original Exception was javax.crypto.BadPaddingException: pad block corrupted at org.apache.axis2.security.WSDoAllReceiver.invoke(WSDoAllReceiver.java :165) at org.apache.axis2.engine.Phase.invoke(Phase.java:376) Regards, Xinjun On 4/6/06, Ruchith Fernando [EMAIL PROTECTED] wrote: Hi Xinjun, Please see my inline comments: On 4/6/06, Xinjun Chen [EMAIL PROTECTED] wrote: When testing the Axis2 0.94 security module, I have some questions regarding client side configuration. I raised the following question after reading the webpage http://ws.apache.org/axis2/0_94/security-module.html. I recommend you to use the 0.95 security.mar and please note that the Axis2 repository structure is different in 0.95. 1. The page mentions that client side configuration parameters can be set in the axis2.xml of the client's Axis2 repository. My question is is this referring to the directory \axis2-std-0.94-bin\repository\services ? It is initially empty. What will be the root element in the client respository axis2.xml? Could you help me to get some sample client side configuration? When you have to engage a client side module you will have to use an Axis2 repository. This repository just have to be a specific directory structure. Following is the Axis2 repository structure for a client if you are using 0.95 or the current SVN snapshot. repo_dir - This is the repo directory name and can be anything and can be |anywhere in your dick where you have permission :-). | +--conf | | | +-- axis2.xml | +--modules - This directory contains .mar files | +-- security.mar Now when you create a ServiceClient you can supply the configuration context created using the configured using the repo dir. If you have a look at the souce of the security sample's client [1] you can see how this is done. (lines: 48, 49) Now the you will have to have following XML entries in the axis2.xml that is in the client's repo's conf dir !--Enagege the security module -- module ref=security / !-- Configure the security module to include a username token in the msg -- parameter name=OutflowSecurity action itemsUsernameToken/items useryour_user_name/user passwordCallbackClasscallback.hancler.Class/passwordCallbackClass passwordTypePasswordText/passwordType /action /parameter The above parameter will include a username token in the security header in the request message. The username will be your_user_name and the password will be picked up using the callback.hancler.Class. You will have to write this class which is an impl of the java.auth.Callback interface. And you will have to set the password into the WSPasswordCallback objects that is given into the handle() method. Example: [2] Now you have your client side configured properly :-) 2. If a developer only downloaded WAR distribution and put the war inside the Tomcat webapps folder. Can he/she still configure the client side? How? YES The client side it independent from the services and there's no need for anyone to use the same repository that is available inside tomcat when the war is expanded. One can configure the services' security by configuring the axis2.xml available in the WEB-INF/con dir in the war to include the module ref=security / entry AND by including the configuration parameters in each service's services.xml file. 3. The page mentioned per service level security configuration. Could you also provided some details? My understanding is that the security configuration (security policy and security information) will be read by the WSDoAllHandler inside the security.module. I checked both WSDoAllSender and WSDoAllReceiver, but could not figure out where how can WSDoAllHandler find out the security configuration file. We do not processes WS-securityPolicy yet. And we use two parameters to configure the security
Re: [Axis2] Client side configuration parameters
Hi Xinjun, Unfortunately the security sample in 0.94 is broken :-( Please try the security sample provided in Axis2 0.95 http://ws.apache.org/axis2/download.cgi AND please make sure you use the security sample provided separately in the distribution. BTW looking at your exception trace I think you are using JDK 1.5 and if so 1.) please follow the instructions in General - #3 in the Axis2 faq [1]. 2.) you will need to have xalan-2.6.jar in the client's classpath and in the axis2/WEB-INF/li dir as well. Thanks, Ruchith [1] http://ws.apache.org/axis2/download.cgi On 4/6/06, Xinjun Chen [EMAIL PROTECTED] wrote: Hi Ruchith, I am really very very grateful to your enlighting explanation and clarification. I will go ahead with it. I just tried the security sample with the attached error message. I have already followed the steps in the ReadMe file in security sample folder. The following is the snippet of the error message. The full error message is attached. I will try Axis2 0.95 security at meanwhile. The original exception is BadPaddingException. Did i missed something? As mentioned, I have followed the instruction in the read me file. F:\download\axis2\axis2-std-0.94-bin\samples\security\srcjava sample.security.C lient ..\client_repo 8080 org.apache.axis2.AxisFault: org.apache.axis2.AxisFault: WSDoAllReceiver: securit y processing failed; nested exception is: org.apache.ws.security.WSSecurityException: Cannot encrypt/decrypt data; nested exception is: org.apache.xml.security.encryption.XMLEncryptionException: pad block cor rupted Original Exception was javax.crypto.BadPaddingException: pad block corrupted at org.apache.axis2.security.WSDoAllReceiver.invoke(WSDoAllReceiver.java :165) at org.apache.axis2.engine.Phase.invoke(Phase.java:376) Regards, Xinjun On 4/6/06, Ruchith Fernando [EMAIL PROTECTED] wrote: Hi Xinjun, Please see my inline comments: On 4/6/06, Xinjun Chen [EMAIL PROTECTED] wrote: When testing the Axis2 0.94 security module, I have some questions regarding client side configuration. I raised the following question after reading the webpage http://ws.apache.org/axis2/0_94/security-module.html. I recommend you to use the 0.95 security.mar and please note that the Axis2 repository structure is different in 0.95. 1. The page mentions that client side configuration parameters can be set in the axis2.xml of the client's Axis2 repository. My question is is this referring to the directory \axis2-std-0.94-bin\repository\services ? It is initially empty. What will be the root element in the client respository axis2.xml? Could you help me to get some sample client side configuration? When you have to engage a client side module you will have to use an Axis2 repository. This repository just have to be a specific directory structure. Following is the Axis2 repository structure for a client if you are using 0.95 or the current SVN snapshot. repo_dir - This is the repo directory name and can be anything and can be |anywhere in your dick where you have permission :-). | +--conf | | | +-- axis2.xml | +--modules - This directory contains .mar files | +-- security.mar Now when you create a ServiceClient you can supply the configuration context created using the configured using the repo dir. If you have a look at the souce of the security sample's client [1] you can see how this is done. (lines: 48, 49) Now the you will have to have following XML entries in the axis2.xml that is in the client's repo's conf dir !--Enagege the security module -- module ref=security / !-- Configure the security module to include a username token in the msg -- parameter name=OutflowSecurity action itemsUsernameToken/items useryour_user_name/user passwordCallbackClasscallback.hancler.Class/passwordCallbackClass passwordTypePasswordText/passwordType /action /parameter The above parameter will include a username token in the security header in the request message. The username will be your_user_name and the password will be picked up using the callback.hancler.Class. You will have to write this class which is an impl of the java.auth.Callback interface. And you will have to set the password into the WSPasswordCallback objects that is given into the handle() method. Example: [2] Now you have your client side configured properly :-) 2. If a developer only downloaded WAR distribution and put the war inside the Tomcat webapps folder. Can he/she still configure the client side? How? YES The client side it independent from the services and there's no need for anyone to use the same repository that is available inside tomcat when the war is expanded. One can configure
Making operations with no output type synchronous
Hello. I've been trying to run a single JUnit method that calls an Axis web service operation. The operation receives one input parameter but there's no output defined. The JUnit test case uses the classes generated by wsdl2java to lookup the service and call the operation like so: MyClass_ServiceLocator locator = new MyClass_ServiceLocator(); MyClass_PortType service = locator.getMyClass(new URL(SERVICE_URL)); MyOperationRequest request = new MyOperationRequest(Some data...); service.myOperation(request); For some reason this didn't work and I got no error out on the screen. I later found out that this was because the JUnit test case called the myOperation asynchronously and managed to finish and kill the JVM before the stuff behind it (the stuff Axis generates) managed to actually even send out a request. So my question is: Can I define a void operation in WSDL without Axis generating code that calls it asynchronously? Kind regards, Stefan Freyr. p.s. I'm using Axis 1.2.1 pgphtqKhDguxP.pgp Description: PGP signature
[Axis2 0.95]Stub problem.
Hi, Ive deployed a skeleton service with an xmlbeans data binding which handles five types of operation: login,format, search,metadata and page. I know the service is working because Ive accessed it from .NET and it returns correct responses. However, when I try to use the generated Stub class in the following way: PAFStub stub = new PAFStub(null, http://localhost:8080/axis2/services/PAF); LoginRequestDocument ld = LoginRequestDocument.Factory.newInstance(); ld.addNewLoginRequest(); // Populate the request ld.getLoginRequest().setUserID(test); ld.getLoginRequest().setPassword(test); LoginResponseDocument loginResponse = stub.login(ld); it throws an AxisFault telling me that there is a data binding error; The nested XmlException says: document is not a [EMAIL PROTECTED]://www.edp.co.uk/ws/PAF/: document element local name mismatch expected FormatRequest got LoginRequest This has me very puzzled bearing in mind that a login request works fine when using a .NET web reference to the service. As far as I can work out problems arise in MessageReceiverInOut fromOM(OMElement param, Class type) method. Any ideas? Regards, Ken
Re: Making operations with no output type synchronous
Define the WSDL operation with both input and output messages. Define the output message as being empty with no parts: message name=MyOutputMessage / - Junaid Stefan Freyr Stefansson [EMAIL PROTECTED] To is axis-user@ws.apache.org cc 04/06/2006 09:30 AMSubject Making operations with no output type synchronous Please respond to [EMAIL PROTECTED] he.org Hello. I've been trying to run a single JUnit method that calls an Axis web service operation. The operation receives one input parameter but there's no output defined. The JUnit test case uses the classes generated by wsdl2java to lookup the service and call the operation like so: MyClass_ServiceLocator locator = new MyClass_ServiceLocator(); MyClass_PortType service = locator.getMyClass(new URL(SERVICE_URL)); MyOperationRequest request = new MyOperationRequest(Some data...); service.myOperation(request); For some reason this didn't work and I got no error out on the screen. I later found out that this was because the JUnit test case called the myOperation asynchronously and managed to finish and kill the JVM before the stuff behind it (the stuff Axis generates) managed to actually even send out a request. So my question is: Can I define a void operation in WSDL without Axis generating code that calls it asynchronously? Kind regards, Stefan Freyr. p.s. I'm using Axis 1.2.1 (See attached file: att26p98.dat) att26p98.dat Description: Binary data
[Axis2] Generation of Keystores
Hello everybody. I successfully can use the security example. Within this example there is the keystore which ist used. I start with the example and try to generate my own keystore but I have no luck. Can somebody give me the lines to write down the console to get a keystore simmilar to the sec.jks in the secUtil.jar of the security example. By the way I got a question on the security example: The keystore listing shows that there are two private/public keys in the keystore and two signed and accepted certificates. Am I right? Keystore-Typ: jks Keystore-Provider: SUN Ihr Keystore enthõlt 4 Eintrõge. alice, 04.06.2005, keyEntry, Zertifikatsfingerabdruck (MD5): 57:CE:81:F1:03:C4:2C:F7:5B:1A:DE:AC:43:64:0A:84 root, 04.06.2005, trustedCertEntry, Zertifikatsfingerabdruck (MD5): 0C:0D:00:27:BF:4B:32:63:40:A8:B2:03:96:4B:58:14 ca, 04.06.2005, trustedCertEntry, Zertifikatsfingerabdruck (MD5): CA:0A:6D:E3:A4:9F:E8:55:98:0A:F8:10:66:35:40:C6 bob, 04.06.2005, keyEntry, Zertifikatsfingerabdruck (MD5): 89:3E:86:D2:4F:9C:E7:39:B6:71:8A:EF:00:C5:89:DC The security example uses this keystore for both the client and the server. My question now is how to produce two different keystores for alice and bob each containing the private/public key and the certificate (including the public key) of the other. something like this: Keystore for Alice: - Private/Public Key of Alice - Certificate of Bob Keystore for Bob: - Private/Public Key of Bob - Certificate of Alice Does Axis2 works this such a scenario? Thank you, Siamak Haschemi
Profound Apologies re last message.
Hi All, Sincerest apologies for that last message. I installed outlook 2003 last week and neglected to switch message to plain text. I humbly beg everyone's pardon for the appalling waste of bandwidth. I'll go and stand in the corner for the rest of the afternoon. Regards, Ken
Re: [Axis2] Generation of Keystores
Hi Siamak, Please see my inline comments: On 4/6/06, Siamak Haschemi [EMAIL PROTECTED] wrote: Hello everybody. I successfully can use the security example. Within this example there is the keystore which ist used. I start with the example and try to generate my own keystore but I have no luck. Can somebody give me the lines to write down the console to get a keystore simmilar to the sec.jks in the secUtil.jar of the security example. You can use openssl and the java keytool to do this. Please see the following shell scripts: https://svn.apache.org/repos/asf/webservices/wss4j/trunk/keys/genCAKey.sh https://svn.apache.org/repos/asf/webservices/wss4j/trunk/keys/genKeystore.sh https://svn.apache.org/repos/asf/webservices/wss4j/trunk/keys/genCertRequest.sh https://svn.apache.org/repos/asf/webservices/wss4j/trunk/keys/signConvertImportCert.sh By the way I got a question on the security example: The keystore listing shows that there are two private/public keys in the keystore and two signed and accepted certificates. Am I right? Yes Keystore-Typ: jks Keystore-Provider: SUN Ihr Keystore enthõlt 4 Eintrõge. alice, 04.06.2005, keyEntry, Zertifikatsfingerabdruck (MD5): 57:CE:81:F1:03:C4:2C:F7:5B:1A:DE:AC:43:64:0A:84 root, 04.06.2005, trustedCertEntry, Zertifikatsfingerabdruck (MD5): 0C:0D:00:27:BF:4B:32:63:40:A8:B2:03:96:4B:58:14 ca, 04.06.2005, trustedCertEntry, Zertifikatsfingerabdruck (MD5): CA:0A:6D:E3:A4:9F:E8:55:98:0A:F8:10:66:35:40:C6 bob, 04.06.2005, keyEntry, Zertifikatsfingerabdruck (MD5): 89:3E:86:D2:4F:9C:E7:39:B6:71:8A:EF:00:C5:89:DC The security example uses this keystore for both the client and the server. My question now is how to produce two different keystores for alice and bob each containing the private/public key and the certificate (including the public key) of the other. something like this: These are the steps to create the keystores you want: 1.) generate two separate keystores with self signed keys $ keytool -genkey ... 2.) Export the certs of both private keys in the two keystores $ keytool -export 3.) Import the cert of one private key to the other keystore $ keytool -import Keystore for Alice: - Private/Public Key of Alice - Certificate of Bob Keystore for Bob: - Private/Public Key of Bob - Certificate of Alice Does Axis2 works this such a scenario? Yes !! Thanks, Ruchith
Apache SOAP - Apache AXIS communication isuue.
Hi All,Is there anty way to deploy a Web-service on apache SOAP using org.apache.axis.encoding.ser.BeanDeserializerFactory for Serialization and Deserialization.I deployed the service on Apache SOAP (2.3.1) -- The service therefore uses org.apache.soap.encoding.soapenc.BeanSerializer for Serialization DeSerialization.I then used Java2WSDL and WSDL2Java to generate Client side code and stubs. -- The client therefore uses org.apache.axis.encoding.ser.BeanDeserializerFactory for Serialization DeSerializationThe client got ready - compiled and all. Now the issue is that, SOAP uses org.apache.soap.encoding.soapenc.BeanSerializer for handling Marshalling and unmrshalling. The client can DeSerialize the Serialized data sent by the Apache SOAP server, but Apache SOAP can not DeSerialize the data Serialized by the Client.Can anyone suggest a method using which I can make Apache SOAP(v2.3.1) service and AXIS(v1.3) client talk ??Thank and regards,Amit Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.
Apache SOAP - Apache AXIS communication isuue.
Hi All,Is there anty way to deploy a Web-service on apache SOAP using org.apache.axis.encoding.ser.BeanDeserializerFactory for Serialization and Deserialization.I deployed the service on Apache SOAP (2.3.1) -- The service therefore uses org.apache.soap.encoding.soapenc.BeanSerializer for Serialization DeSerialization.I then used Java2WSDL and WSDL2Java to generate Client side code and stubs. -- The client therefore uses org.apache.axis.encoding.ser.BeanDeserializerFactory for Serialization DeSerializationThe client got ready - compiled and all. Now the issue is that, SOAP uses org.apache.soap.encoding.soapenc.BeanSerializer for handling Marshalling and unmrshalling. The client can DeSerialize the Serialized data sent by the Apache SOAP server, but Apache SOAP can not DeSerialize the data Serialized by the Client.Can anyone suggest a method using which I can make Apache SOAP(v2.3.1) service and AXIS(v1.3) client talk ??Thank and regards,Amit Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.
Re: [Axis2] Generation of Keystores
Hello Ruchith. I follow you instructions. I create a script for generating the keystore. But now I got into trubble with a error: WSHandler: Signature: error during message procesingorg.apache.ws.security.WSSecurityException: General security error (Unexpected number of X509Data: for Signature) ... If I use the original sec.jks from the security sample (and changing the axis2.xml user and encryptionUser param) it works. So I think there's still something wrong with my Keystore. Here is the script I use to generate the keystore. - @echo off set CLIENT_KEYPASS=keyPassClient set CLIENT_STOREPASS=storePassClient set SERVER_KEYPASS=keyPassServer set SERVER_STOREPASS=storePassServer keytool -genkey -keyalg RSA -alias client -keystore client.jks -dname cn=Client -keypass %CLIENT_KEYPASS% -storepass %CLIENT_STOREPASS% keytool -genkey -keyalg RSA -alias server -keystore server.jks -dname cn=Server -keypass %SERVER_KEYPASS% -storepass %SERVER_STOREPASS% keytool -selfcert -alias client -keystore client.jks -keypass %CLIENT_KEYPASS% -storepass %CLIENT_STOREPASS% keytool -selfcert -alias server -keystore server.jks -keypass %SERVER_KEYPASS% -storepass %SERVER_STOREPASS% keytool -export -keystore client.jks -alias client -storepass %CLIENT_STOREPASS% -file client.cert keytool -export -keystore server.jks -alias server -storepass %SERVER_STOREPASS% -file server.cert keytool -import -noprompt -alias server -file server.cert -keystore client.jks -storepass %CLIENT_STOREPASS% keytool -import -noprompt -alias client -file client.cert -keystore server.jks -storepass %SERVER_STOREPASS% del client.cert del server.cert keytool -list -keystore client.jks -storepass %CLIENT_STOREPASS% keytool -list -keystore server.jks -storepass %SERVER_STOREPASS% pause - The resulting keystores look now like this: - Keystore-Typ: jks Keystore-Provider: SUN Ihr Keystore enthõlt 2 Eintrõge. client, 06.04.2006, keyEntry, Zertifikatsfingerabdruck (MD5): EA:30:9C:AF:FF:05:CE:91:10:6E:E8:C4:5F:B8:B5:7C server, 06.04.2006, trustedCertEntry, Zertifikatsfingerabdruck (MD5): 77:D3:A0:AB:BF:70:05:6D:38:AD:E5:23:BB:8C:1E:04 - Keystore-Typ: jks Keystore-Provider: SUN Ihr Keystore enthõlt 2 Eintrõge. client, 06.04.2006, trustedCertEntry, Zertifikatsfingerabdruck (MD5): EA:30:9C:AF:FF:05:CE:91:10:6E:E8:C4:5F:B8:B5:7C server, 06.04.2006, keyEntry, Zertifikatsfingerabdruck (MD5): 77:D3:A0:AB:BF:70:05:6D:38:AD:E5:23:BB:8C:1E:04 - Thank you very much for your help! Siamak Ruchith Fernando schrieb: Hi Siamak, Please see my inline comments: On 4/6/06, Siamak Haschemi [EMAIL PROTECTED] wrote: Hello everybody. I successfully can use the security example. Within this example there is the keystore which ist used. I start with the example and try to generate my own keystore but I have no luck. Can somebody give me the lines to write down the console to get a keystore simmilar to the sec.jks in the secUtil.jar of the security example. You can use openssl and the java keytool to do this. Please see the following shell scripts: https://svn.apache.org/repos/asf/webservices/wss4j/trunk/keys/genCAKey.sh https://svn.apache.org/repos/asf/webservices/wss4j/trunk/keys/genKeystore.sh https://svn.apache.org/repos/asf/webservices/wss4j/trunk/keys/genCertRequest.sh https://svn.apache.org/repos/asf/webservices/wss4j/trunk/keys/signConvertImportCert.sh By the way I got a question on the security example: The keystore listing shows that there are two private/public keys in the keystore and two signed and accepted certificates. Am I right? Yes Keystore-Typ: jks Keystore-Provider: SUN Ihr Keystore enthõlt 4 Eintrõge. alice, 04.06.2005, keyEntry, Zertifikatsfingerabdruck (MD5): 57:CE:81:F1:03:C4:2C:F7:5B:1A:DE:AC:43:64:0A:84 root, 04.06.2005, trustedCertEntry, Zertifikatsfingerabdruck (MD5): 0C:0D:00:27:BF:4B:32:63:40:A8:B2:03:96:4B:58:14 ca, 04.06.2005, trustedCertEntry, Zertifikatsfingerabdruck (MD5): CA:0A:6D:E3:A4:9F:E8:55:98:0A:F8:10:66:35:40:C6 bob, 04.06.2005, keyEntry, Zertifikatsfingerabdruck (MD5): 89:3E:86:D2:4F:9C:E7:39:B6:71:8A:EF:00:C5:89:DC The security example uses this keystore for both the client and the server. My question now is how to produce two different keystores for alice and bob each containing the private/public key and the certificate (including the public key) of the other. something like this: These are the steps to create the keystores you want: 1.) generate two separate keystores with self signed keys $ keytool -genkey ... 2.) Export the certs of both private keys in the two keystores $ keytool -export 3.) Import the cert of one private key to the other keystore $ keytool -import Keystore for Alice: - Private/Public Key of Alice - Certificate of Bob Keystore for Bob: - Private/Public Key of Bob - Certificate of
RE: [SPAM] - Re: [SPAM] - Re: Problems getting user exceptions to work - Found word(s) check out in the Text body - Found word(s) check out in the subject
Well, I guess the question would be what do you mean by correct. I get XML very similar to what Jack got, namely: ?xml version=1.0 encoding=utf-8? soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; soapenv:Body soapenv:Fault faultcodesoapenv:Server.userException/faultcode faultstringsubprod.dis.fault.MVException: Hello world my .../faultstring detail subprod.dis.fault.MVException xsi:type=ns1:MVFault xmlns:ns1=urn:Faults codes soapenc:arrayType=xsd:anyType[3] xsi:type=soapenc:Array xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; codes xsi:type=soapenc:stringBAD_DAY/codes codes xsi:type=soapenc:stringRAIN/codes codes xsi:type=soapenc:stringWS_SUCK/codes /codes /subprod.dis.fault.MVException ns2:hostname xmlns:ns2=http://xml.apache.org/axis/; myhost/ns2:hostname /detail /soapenv:Fault /soapenv:Body /soapenv:Envelope It obviously is not formated this way, I made it more readable (tried at least). Basically what I did was I extended Exception with my own class and added a list of error codes (just a list of Strings called codes, list is not typed) As you can see, I get this fault and I can deserialize it (and I can probably even get into details). It is possible that if I generate a client with WSDL2Java (for now I just use Call class) I will even get this exception (not sure, would need to test). However as I mentioned before the service is supposed to be cross-platform so I would very much like to control faultcode and faultstring so that C++ or Python would be able to process it. I can probably get them to process custom XML but you must agree this kinda violates the purpose of using SOAP in the first place. I was able to set both values I need through making my exception extend AxisFault, which is an option, but I wanted to see if there are other options too (namely custom serialization of standard exceptions). Another question - I think SOAP allows to have multiple Faults in one response. Is this correct and if it is, is there a way to have multiple faults with Axis? Thank you, -Michael ___ Tell a man there are 300 billion stars in the universe and he'll believe Tell him a bench has wet paint on it and he'll have to touch to be sure -- /usr/bin/fortune -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Thom Hehl Sent: Thursday, April 06, 2006 5:10 AM To: axis-user@ws.apache.org Subject: Re: [SPAM] - Re: [SPAM] - Re: Problems getting user exceptions to work - Found word(s) check out in the Text body - Found word(s) check out in the subject Right. We use the WSDL to build java from, not the other way round. The problem is a bug in axis. We're going to write it up when we get the chance. In the meantime, you will need to decide whether or not to modify the WSDL. I will bet that if you look at the XML coming from the server, it is correct. The problem lies in the de-serialization of the fault. This is a work-around for that problem. Veprinsky, Michael wrote: Hello! I decided to piggy-back on this thread... I am having similar problems. Thom, What did you mean? I suppose recommend changing WSDL definition but a) my WSDL is auto-published so I can't really change it and b) even if I do, it does not change the XML that server generates and that is totally language-specific which kinda violates the purpose. Or did you mean something else? I am using Axis 1.3. I have following questions: 1) Is there a way to set server to use SOAP 1.2 (RTFMs are welcome, just tell where)? 2) Is there a way to specify custom values for faultcode/faultstring? Best I could get was my exception being serialized into XML under details but then I have to process it as XML :-\ 3) Overall, I need to publish a web service that is going to be used from different platforms. Is my best bet to just give up faults altogether and use some custom base result structure with generic error passing engine? Any recommendations (again, RTFMs are welcome) I do not expect much success since the envelope XSD itself is pretty limiting (http://schemas.xmlsoap.org/soap/envelope, toward the end), it's just those two fields and freeform XML details. SOAP 1.2 looks a little better but without documentation it did not help much either. Any recommendations/insights are welcome. Thank you, -Michael ___ Tell a man there are 300 billion stars in the universe and he'll believe Tell him a bench has wet paint on it and he'll have to touch to be sure -- /usr/bin/fortune -Original Message- From:
Plugging in the WSDL2Java
Hey, New user to axis. Ive been unable to find any in depth documentation or discussion of the code generation engine. Im digging through the codegen module trying to figure out how to plug into the code generation to add stuff specific to our project. In this project the WSDL is going to be dynamic for some time. My current plan is to use a simple name matching pattern that would be easy to dynamically generate code for. The idea is to create one class per service (Class name = Service name) and one method per action in the service (method name = action name). In those external classes I would implement the necessary business functionality. Which, though volatile, we wish to manage it through standard source control mechanisms. So the ideal body of a generated function would look like this: public class DocumentServicePortTypeSkeleton { import mypackage.DocumentService; public OMElement getDocument () throws Exception { return DocumentService.getDocument(); } } Ive found the SkeletonTemplate.xsl file. Obviously I could pull this out and modify it to suit my needs, rejar and run with it. However, my impression is that youve designed to allow me to point the CodeGenerator at other instances of something like SkeletonTemplate.xsl. Is there a solution of the second type? (write my own .xsl and register it somehow with codegen) If so, is there any documentation on this method of interaction? (Mailing list posts, design documents, tutorial) Thanks, P.S. Im also wanting to do something similar to the build.xml file generated for Ant, to include our class files in the generated aar. If there is an alternative location within the exploded axis2 webapp for dumping a jar-file for access by a specific aar, that would meet our purposes as well. But I havent done all of the research yet on this issue. - Deliver Higher Quality, Easier to Maintain Code with TAU/Logiscope - www.telelogic.com - David S. Boyer Sr. S/W Developer Telelogic North America Business: +1 (703) 944-9289 Mobile: +1 (703) 944-9289 mailto:[EMAIL PROTECTED] - Telelogic - Requirements Driven Innovation Telelogic Lifecycle Solutions:Helping You Define, Design Deliver Advanced Systems SoftwareLearn More at www.telelogic.com David Boyer Sr. Software DeveloperTelelogic North America Inc. 11911 Freedom Drive, Suite 1180RestonVA 20190United StatesPhone: +1 (703) 944-9289Fax: Mobile phone: +1 (703) 944-9289 [EMAIL PROTECTED]http://www.telelogic.com Telelogic - Requirements-Driven Innovation! - The information contained in this e-mail, including any attachment or enclosure, is intended only for the person or entity to which it is addressed and may contain confidential material. Any unauthorized use, review, retransmissions, dissemination, copying or other use of this information by persons or entities other than the intended recipient is prohibited.
[Axis2] 0.95 WS-Addressing client-side: module not found
I renamed addressing-0.95.mar to addressing-0.95.jar and add it to the project libraires in Eclipse. EchoNonBlockingDualClient arises this: org.apache.axis2.AxisFault: Module not found at org.apache.axis2.description.AxisService.engageModule(AxisService.java:311) at org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java:273) at client.Client.invoke(Client.java:66) at client.Client.init(Client.java:28) at client.Client.main(Client.java:109) Chinthaka wrote: Michele Mazzucco wrote: Hi Eran, I'm sorry, but I cannot find the options.engageModule() call. Do you mean options.setAction() (I'm just trying to guess since the APIs don't explain what that method actually do)? I'm sorry its ServiceClient.engageModule(addressing).
Re: Order of SOAPHeader and SOAPBody
Hi Xinjun,Thanks.I've just realized that u're using Axis2. I am using Axis 1.3 yet.Can I use wss4j with Axis 1.3?Where are u from?Thanks againDaniel - Brasil On 4/5/06, Xinjun Chen [EMAIL PROTECTED] wrote: Hi Daniel,I take advantage of WSS4J to add UsernameToken to the SOAPEnvelope.Some sample codes:Document domDoc = Axis2Util.getDocumentFromSOAPEnvelope(envelope);// Add the UserNameToken.WSSAddUsernameToken builder = new WSSAddUsernameToken(, false); if (token.isDigested()) {builder.setPasswordType(WSConstants.PASSWORD_DIGEST);} else {builder.setPasswordType(WSConstants.PASSWORD_TEXT);}builder.build(domDoc, token.getUsername (), token.getPassword());Element header = (Element)(domDoc.getElementsByTagName(SOAP-ENV:Header).item(0));//SOAPHeader header = Axis2Util.getSOAPFactory(envelope);//SOAPFactory factory = Axis2Util.getSOAPFactory (envelope);OMElement headerElm = (OMElement) (Axis2Util.toOM(header));envelope.getBody().insertSiblingBefore(headerElm);These are only some experimental codes.I assume the SOAPEnvelope has been constructed. What these code snippet is more of a handler. There may be other ways to do it. AsRuchith said, you can also take advantage of Axis2 security module.Regards,XinjunOn 4/6/06, Daniel Destro [EMAIL PROTECTED] wrote: Hi Xinjun, As I can see you are trying to add some Security to your Web Services, right? Are you doing a User Authentication / Authorization using this UsernameToken? I need to do that! How do add UsernameToken into to the SOAP request and how do u read / validate UsernameToken from the SOAP request (server-side) ??? Thanks Daniel
Re: [Axis2] 0.95 WS-Addressing client-side: module not found
ohhh , that is not going to be work ! you have to have the .mar extension otherwise system will not figure that out as an AxisModule. Roman Weidlich wrote: I renamed addressing-0.95.mar to addressing-0.95.jar and add it to the project libraires in Eclipse. EchoNonBlockingDualClient arises this: org.apache.axis2.AxisFault: Module not found at org.apache.axis2.description.AxisService.engageModule(AxisService.java:311) at org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java:273) at client.Client.invoke(Client.java:66) at client.Client.init(Client.java:28) at client.Client.main(Client.java:109) Chinthaka wrote: Michele Mazzucco wrote: Hi Eran, I'm sorry, but I cannot find the options.engageModule() call. Do you mean options.setAction() (I'm just trying to guess since the APIs don't explain what that method actually do)? I'm sorry its ServiceClient.engageModule(addressing). -- Thanks, Deepal ~Future is Open~
Re: [Axis2] Generation of Keystores
Hi, Please note that you will have to provide the configuration information according to set the new keystores. Simply replacing the keystores in the security sample will not help. - You will have to set the user value in the outflowConfiguration parameter to the alias of the private key in the appropriate keystore. - You will have to provide a .properties file with the correct keystore information - You will have to make sure the PasswordCallbackhandler class (impl of java.auth.Callbackhandler) returns the proper passwords for the required identifiers. - You will have to make sure you have all the above available in the classpath of both service and client appropriately (The secUtil.jar in the security sample packages all of these). HTH Thanks, Ruchith On 4/6/06, Siamak Haschemi [EMAIL PROTECTED] wrote: Hello Ruchith. I follow you instructions. I create a script for generating the keystore. But now I got into trubble with a error: WSHandler: Signature: error during message procesingorg.apache.ws.security.WSSecurityException: General security error (Unexpected number of X509Data: for Signature) ... If I use the original sec.jks from the security sample (and changing the axis2.xml user and encryptionUser param) it works. So I think there's still something wrong with my Keystore. Here is the script I use to generate the keystore. - @echo off set CLIENT_KEYPASS=keyPassClient set CLIENT_STOREPASS=storePassClient set SERVER_KEYPASS=keyPassServer set SERVER_STOREPASS=storePassServer keytool -genkey -keyalg RSA -alias client -keystore client.jks -dname cn=Client -keypass %CLIENT_KEYPASS% -storepass %CLIENT_STOREPASS% keytool -genkey -keyalg RSA -alias server -keystore server.jks -dname cn=Server -keypass %SERVER_KEYPASS% -storepass %SERVER_STOREPASS% keytool -selfcert -alias client -keystore client.jks -keypass %CLIENT_KEYPASS% -storepass %CLIENT_STOREPASS% keytool -selfcert -alias server -keystore server.jks -keypass %SERVER_KEYPASS% -storepass %SERVER_STOREPASS% keytool -export -keystore client.jks -alias client -storepass %CLIENT_STOREPASS% -file client.cert keytool -export -keystore server.jks -alias server -storepass %SERVER_STOREPASS% -file server.cert keytool -import -noprompt -alias server -file server.cert -keystore client.jks -storepass %CLIENT_STOREPASS% keytool -import -noprompt -alias client -file client.cert -keystore server.jks -storepass %SERVER_STOREPASS% del client.cert del server.cert keytool -list -keystore client.jks -storepass %CLIENT_STOREPASS% keytool -list -keystore server.jks -storepass %SERVER_STOREPASS% pause - The resulting keystores look now like this: - Keystore-Typ: jks Keystore-Provider: SUN Ihr Keystore enthõlt 2 Eintrõge. client, 06.04.2006, keyEntry, Zertifikatsfingerabdruck (MD5): EA:30:9C:AF:FF:05:CE:91:10:6E:E8:C4:5F:B8:B5:7C server, 06.04.2006, trustedCertEntry, Zertifikatsfingerabdruck (MD5): 77:D3:A0:AB:BF:70:05:6D:38:AD:E5:23:BB:8C:1E:04 - Keystore-Typ: jks Keystore-Provider: SUN Ihr Keystore enthõlt 2 Eintrõge. client, 06.04.2006, trustedCertEntry, Zertifikatsfingerabdruck (MD5): EA:30:9C:AF:FF:05:CE:91:10:6E:E8:C4:5F:B8:B5:7C server, 06.04.2006, keyEntry, Zertifikatsfingerabdruck (MD5): 77:D3:A0:AB:BF:70:05:6D:38:AD:E5:23:BB:8C:1E:04 - Thank you very much for your help! Siamak Ruchith Fernando schrieb: Hi Siamak, Please see my inline comments: On 4/6/06, Siamak Haschemi [EMAIL PROTECTED] wrote: Hello everybody. I successfully can use the security example. Within this example there is the keystore which ist used. I start with the example and try to generate my own keystore but I have no luck. Can somebody give me the lines to write down the console to get a keystore simmilar to the sec.jks in the secUtil.jar of the security example. You can use openssl and the java keytool to do this. Please see the following shell scripts: https://svn.apache.org/repos/asf/webservices/wss4j/trunk/keys/genCAKey.sh https://svn.apache.org/repos/asf/webservices/wss4j/trunk/keys/genKeystore.sh https://svn.apache.org/repos/asf/webservices/wss4j/trunk/keys/genCertRequest.sh https://svn.apache.org/repos/asf/webservices/wss4j/trunk/keys/signConvertImportCert.sh By the way I got a question on the security example: The keystore listing shows that there are two private/public keys in the keystore and two signed and accepted certificates. Am I right? Yes Keystore-Typ: jks Keystore-Provider: SUN Ihr Keystore enthõlt 4 Eintrõge. alice, 04.06.2005, keyEntry, Zertifikatsfingerabdruck (MD5): 57:CE:81:F1:03:C4:2C:F7:5B:1A:DE:AC:43:64:0A:84 root, 04.06.2005, trustedCertEntry, Zertifikatsfingerabdruck (MD5): 0C:0D:00:27:BF:4B:32:63:40:A8:B2:03:96:4B:58:14 ca, 04.06.2005,
Re: [Axis2] Generation of Keystores
Hello Ruchith, I think that was a misunderstanding. I already made this changes. I think that the problem lies in de keystore. Did you look at the script? Is the generation of the Keystore correct? Or am I missing some extra paramaters? I would be very thankful If you could send me a litte projekt including the generation of self-signing Certificates. Thank you very much, Siamak Haschemi Ruchith Fernando schrieb: Hi, Please note that you will have to provide the configuration information according to set the new keystores. Simply replacing the keystores in the security sample will not help. - You will have to set the user value in the outflowConfiguration parameter to the alias of the private key in the appropriate keystore. - You will have to provide a .properties file with the correct keystore information - You will have to make sure the PasswordCallbackhandler class (impl of java.auth.Callbackhandler) returns the proper passwords for the required identifiers. - You will have to make sure you have all the above available in the classpath of both service and client appropriately (The secUtil.jar in the security sample packages all of these). HTH Thanks, Ruchith On 4/6/06, Siamak Haschemi [EMAIL PROTECTED] wrote: Hello Ruchith. I follow you instructions. I create a script for generating the keystore. But now I got into trubble with a error: WSHandler: Signature: error during message procesingorg.apache.ws.security.WSSecurityException: General security error (Unexpected number of X509Data: for Signature) ... If I use the original sec.jks from the security sample (and changing the axis2.xml user and encryptionUser param) it works. So I think there's still something wrong with my Keystore. Here is the script I use to generate the keystore. - @echo off set CLIENT_KEYPASS=keyPassClient set CLIENT_STOREPASS=storePassClient set SERVER_KEYPASS=keyPassServer set SERVER_STOREPASS=storePassServer keytool -genkey -keyalg RSA -alias client -keystore client.jks -dname cn=Client -keypass %CLIENT_KEYPASS% -storepass %CLIENT_STOREPASS% keytool -genkey -keyalg RSA -alias server -keystore server.jks -dname cn=Server -keypass %SERVER_KEYPASS% -storepass %SERVER_STOREPASS% keytool -selfcert -alias client -keystore client.jks -keypass %CLIENT_KEYPASS% -storepass %CLIENT_STOREPASS% keytool -selfcert -alias server -keystore server.jks -keypass %SERVER_KEYPASS% -storepass %SERVER_STOREPASS% keytool -export -keystore client.jks -alias client -storepass %CLIENT_STOREPASS% -file client.cert keytool -export -keystore server.jks -alias server -storepass %SERVER_STOREPASS% -file server.cert keytool -import -noprompt -alias server -file server.cert -keystore client.jks -storepass %CLIENT_STOREPASS% keytool -import -noprompt -alias client -file client.cert -keystore server.jks -storepass %SERVER_STOREPASS% del client.cert del server.cert keytool -list -keystore client.jks -storepass %CLIENT_STOREPASS% keytool -list -keystore server.jks -storepass %SERVER_STOREPASS% pause - The resulting keystores look now like this: - Keystore-Typ: jks Keystore-Provider: SUN Ihr Keystore enthõlt 2 Eintrõge. client, 06.04.2006, keyEntry, Zertifikatsfingerabdruck (MD5): EA:30:9C:AF:FF:05:CE:91:10:6E:E8:C4:5F:B8:B5:7C server, 06.04.2006, trustedCertEntry, Zertifikatsfingerabdruck (MD5): 77:D3:A0:AB:BF:70:05:6D:38:AD:E5:23:BB:8C:1E:04 - Keystore-Typ: jks Keystore-Provider: SUN Ihr Keystore enthõlt 2 Eintrõge. client, 06.04.2006, trustedCertEntry, Zertifikatsfingerabdruck (MD5): EA:30:9C:AF:FF:05:CE:91:10:6E:E8:C4:5F:B8:B5:7C server, 06.04.2006, keyEntry, Zertifikatsfingerabdruck (MD5): 77:D3:A0:AB:BF:70:05:6D:38:AD:E5:23:BB:8C:1E:04 - Thank you very much for your help! Siamak Ruchith Fernando schrieb: Hi Siamak, Please see my inline comments: On 4/6/06, Siamak Haschemi [EMAIL PROTECTED] wrote: Hello everybody. I successfully can use the security example. Within this example there is the keystore which ist used. I start with the example and try to generate my own keystore but I have no luck. Can somebody give me the lines to write down the console to get a keystore simmilar to the sec.jks in the secUtil.jar of the security example. You can use openssl and the java keytool to do this. Please see the following shell scripts: https://svn.apache.org/repos/asf/webservices/wss4j/trunk/keys/genCAKey.sh https://svn.apache.org/repos/asf/webservices/wss4j/trunk/keys/genKeystore.sh https://svn.apache.org/repos/asf/webservices/wss4j/trunk/keys/genCertRequest.sh https://svn.apache.org/repos/asf/webservices/wss4j/trunk/keys/signConvertImportCert.sh By the way I got a question on the security example: The keystore listing shows that there are two private/public keys in the keystore and two signed and accepted certificates. Am I right?
Re: [Axis2] Generation of Keystores
Hi Siamak, I will try to get you a step by step project over the week end :-) But please note that the exception that you mentioned: WSHandler: Signature: error during message procesingorg.apache.ws.security.WSSecurityException: General security error (Unexpected number of X509Data: for Signature) ... occurs when you have NOT specified the correct alias of the private key in the keystore to use as the value of the user element in the outflowConfiguration, also the callback handler class must supply the correct password of the private key when asked for password of that particular alias. Thanks, Ruchith On 4/6/06, Siamak Haschemi [EMAIL PROTECTED] wrote: Hello Ruchith, I think that was a misunderstanding. I already made this changes. I think that the problem lies in de keystore. Did you look at the script? Is the generation of the Keystore correct? Or am I missing some extra paramaters? I would be very thankful If you could send me a litte projekt including the generation of self-signing Certificates. Thank you very much, Siamak Haschemi Ruchith Fernando schrieb: Hi, Please note that you will have to provide the configuration information according to set the new keystores. Simply replacing the keystores in the security sample will not help. - You will have to set the user value in the outflowConfiguration parameter to the alias of the private key in the appropriate keystore. - You will have to provide a .properties file with the correct keystore information - You will have to make sure the PasswordCallbackhandler class (impl of java.auth.Callbackhandler) returns the proper passwords for the required identifiers. - You will have to make sure you have all the above available in the classpath of both service and client appropriately (The secUtil.jar in the security sample packages all of these). HTH Thanks, Ruchith On 4/6/06, Siamak Haschemi [EMAIL PROTECTED] wrote: Hello Ruchith. I follow you instructions. I create a script for generating the keystore. But now I got into trubble with a error: WSHandler: Signature: error during message procesingorg.apache.ws.security.WSSecurityException: General security error (Unexpected number of X509Data: for Signature) ... If I use the original sec.jks from the security sample (and changing the axis2.xml user and encryptionUser param) it works. So I think there's still something wrong with my Keystore. Here is the script I use to generate the keystore. - @echo off set CLIENT_KEYPASS=keyPassClient set CLIENT_STOREPASS=storePassClient set SERVER_KEYPASS=keyPassServer set SERVER_STOREPASS=storePassServer keytool -genkey -keyalg RSA -alias client -keystore client.jks -dname cn=Client -keypass %CLIENT_KEYPASS% -storepass %CLIENT_STOREPASS% keytool -genkey -keyalg RSA -alias server -keystore server.jks -dname cn=Server -keypass %SERVER_KEYPASS% -storepass %SERVER_STOREPASS% keytool -selfcert -alias client -keystore client.jks -keypass %CLIENT_KEYPASS% -storepass %CLIENT_STOREPASS% keytool -selfcert -alias server -keystore server.jks -keypass %SERVER_KEYPASS% -storepass %SERVER_STOREPASS% keytool -export -keystore client.jks -alias client -storepass %CLIENT_STOREPASS% -file client.cert keytool -export -keystore server.jks -alias server -storepass %SERVER_STOREPASS% -file server.cert keytool -import -noprompt -alias server -file server.cert -keystore client.jks -storepass %CLIENT_STOREPASS% keytool -import -noprompt -alias client -file client.cert -keystore server.jks -storepass %SERVER_STOREPASS% del client.cert del server.cert keytool -list -keystore client.jks -storepass %CLIENT_STOREPASS% keytool -list -keystore server.jks -storepass %SERVER_STOREPASS% pause - The resulting keystores look now like this: - Keystore-Typ: jks Keystore-Provider: SUN Ihr Keystore enthõlt 2 Eintrõge. client, 06.04.2006, keyEntry, Zertifikatsfingerabdruck (MD5): EA:30:9C:AF:FF:05:CE:91:10:6E:E8:C4:5F:B8:B5:7C server, 06.04.2006, trustedCertEntry, Zertifikatsfingerabdruck (MD5): 77:D3:A0:AB:BF:70:05:6D:38:AD:E5:23:BB:8C:1E:04 - Keystore-Typ: jks Keystore-Provider: SUN Ihr Keystore enthõlt 2 Eintrõge. client, 06.04.2006, trustedCertEntry, Zertifikatsfingerabdruck (MD5): EA:30:9C:AF:FF:05:CE:91:10:6E:E8:C4:5F:B8:B5:7C server, 06.04.2006, keyEntry, Zertifikatsfingerabdruck (MD5): 77:D3:A0:AB:BF:70:05:6D:38:AD:E5:23:BB:8C:1E:04 - Thank you very much for your help! Siamak Ruchith Fernando schrieb: Hi Siamak, Please see my inline comments: On 4/6/06, Siamak Haschemi [EMAIL PROTECTED] wrote: Hello everybody. I successfully can use the security example. Within this example there is
Re: [Axis2] Generation of Keystores
Hello Ruchith. Thank you very much for that fantastic support. It is not naturally that people are so patient :-) I will try to follow your hint, but I already did everything I could imagine. Thank you very much, Siamak Haschemi Ruchith Fernando schrieb: Hi Siamak, I will try to get you a step by step project over the week end :-) But please note that the exception that you mentioned: WSHandler: Signature: error during message procesingorg.apache.ws.security.WSSecurityException: General security error (Unexpected number of X509Data: for Signature) ... occurs when you have NOT specified the correct alias of the private key in the keystore to use as the value of the user element in the outflowConfiguration, also the callback handler class must supply the correct password of the private key when asked for password of that particular alias. Thanks, Ruchith On 4/6/06, Siamak Haschemi [EMAIL PROTECTED] wrote: Hello Ruchith, I think that was a misunderstanding. I already made this changes. I think that the problem lies in de keystore. Did you look at the script? Is the generation of the Keystore correct? Or am I missing some extra paramaters? I would be very thankful If you could send me a litte projekt including the generation of self-signing Certificates. Thank you very much, Siamak Haschemi Ruchith Fernando schrieb: Hi, Please note that you will have to provide the configuration information according to set the new keystores. Simply replacing the keystores in the security sample will not help. - You will have to set the user value in the outflowConfiguration parameter to the alias of the private key in the appropriate keystore. - You will have to provide a .properties file with the correct keystore information - You will have to make sure the PasswordCallbackhandler class (impl of java.auth.Callbackhandler) returns the proper passwords for the required identifiers. - You will have to make sure you have all the above available in the classpath of both service and client appropriately (The secUtil.jar in the security sample packages all of these). HTH Thanks, Ruchith On 4/6/06, Siamak Haschemi [EMAIL PROTECTED] wrote: Hello Ruchith. I follow you instructions. I create a script for generating the keystore. But now I got into trubble with a error: WSHandler: Signature: error during message procesingorg.apache.ws.security.WSSecurityException: General security error (Unexpected number of X509Data: for Signature) ... If I use the original sec.jks from the security sample (and changing the axis2.xml user and encryptionUser param) it works. So I think there's still something wrong with my Keystore. Here is the script I use to generate the keystore. - @echo off set CLIENT_KEYPASS=keyPassClient set CLIENT_STOREPASS=storePassClient set SERVER_KEYPASS=keyPassServer set SERVER_STOREPASS=storePassServer keytool -genkey -keyalg RSA -alias client -keystore client.jks -dname cn=Client -keypass %CLIENT_KEYPASS% -storepass %CLIENT_STOREPASS% keytool -genkey -keyalg RSA -alias server -keystore server.jks -dname cn=Server -keypass %SERVER_KEYPASS% -storepass %SERVER_STOREPASS% keytool -selfcert -alias client -keystore client.jks -keypass %CLIENT_KEYPASS% -storepass %CLIENT_STOREPASS% keytool -selfcert -alias server -keystore server.jks -keypass %SERVER_KEYPASS% -storepass %SERVER_STOREPASS% keytool -export -keystore client.jks -alias client -storepass %CLIENT_STOREPASS% -file client.cert keytool -export -keystore server.jks -alias server -storepass %SERVER_STOREPASS% -file server.cert keytool -import -noprompt -alias server -file server.cert -keystore client.jks -storepass %CLIENT_STOREPASS% keytool -import -noprompt -alias client -file client.cert -keystore server.jks -storepass %SERVER_STOREPASS% del client.cert del server.cert keytool -list -keystore client.jks -storepass %CLIENT_STOREPASS% keytool -list -keystore server.jks -storepass %SERVER_STOREPASS% pause - The resulting keystores look now like this: - Keystore-Typ: jks Keystore-Provider: SUN Ihr Keystore enthõlt 2 Eintrõge. client, 06.04.2006, keyEntry, Zertifikatsfingerabdruck (MD5): EA:30:9C:AF:FF:05:CE:91:10:6E:E8:C4:5F:B8:B5:7C server, 06.04.2006, trustedCertEntry, Zertifikatsfingerabdruck (MD5): 77:D3:A0:AB:BF:70:05:6D:38:AD:E5:23:BB:8C:1E:04 - Keystore-Typ: jks Keystore-Provider: SUN Ihr Keystore enthõlt 2 Eintrõge. client, 06.04.2006, trustedCertEntry, Zertifikatsfingerabdruck (MD5): EA:30:9C:AF:FF:05:CE:91:10:6E:E8:C4:5F:B8:B5:7C server, 06.04.2006, keyEntry, Zertifikatsfingerabdruck (MD5): 77:D3:A0:AB:BF:70:05:6D:38:AD:E5:23:BB:8C:1E:04 - Thank you very much for your help! Siamak Ruchith Fernando schrieb: Hi Siamak, Please see my inline comments: On 4/6/06, Siamak Haschemi [EMAIL PROTECTED] wrote: Hello
[Axis-1_3] I get an error while trying to run CalcClient example
I try to run example no 2 (Calculator) from Axis samples/userguide. I type: java -cp %AXISCLASSPATH% CalcClient and i get the same error all the time: Exception in thread main java.lang.NoClassDefFoundError: CalcClient I dont know what is wrong, because my AXISCLASSPATH seems to be correct: %AXIS_LIB%\axis.jar;%AXIS_LIB%\axis-ant.jar;%AXIS_LIB%\axis-schema.jar;%AXIS_LIB%\commons-discovery-0.2.jar;%AXIS_LIB%\commons-logging-1.0.4.jar;%AXIS_LIB%\jaxrpc.jar;%AXIS_LIB%\log4j-1.2.8.jar;%AXIS_LIB%\saaj.jar;%AXIS_LIB%\wsdl4j-1.5.1.jar;%AXIS_LIB%\activation.jar where AXIS_LIB is: %AXIS_HOME%\lib and AXIS_HOME is: C:\axis-1 .jars at AXISCLASSPATH match exactly those in lib folder of Axis. What could be wrong? Please help me. I'm desperate!! -- View this message in context: http://www.nabble.com/-Axis-1_3-I-get-an-error-while-trying-to-run-CalcClient-example-t1407439.html#a3789819 Sent from the Axis - User forum at Nabble.com.
[axis2] wrong number of arguments fault
Folks, I am using axis2 (build 95) to create a client for an existing web service. I am getting the following error, but I do not know why the generated client is passing the wrong number of arguments. Anyone have any suggestions about what the problem might be or how to work around it? Thanks! Here are the details. Here is the exception that I am getting: Exception in thread main org.apache.axis2.AxisFault: Illegal argument invoking 'gov.nih.nci.lmp.gominer.webservice.GOMinerWS.getReport([Ljava.lang.String;, [Ljava.lang.String;, java.lang.String, java.lang.String, java.lang.String, boolean, boolean, boolean)': wrong number of arguments at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:291) at org.apache.axis2.GOMinerWSPortTypeStub.getReport(GOMinerWSPortTypeStub.java:114) at Demo.main(Demo.java:29) The WSDL for the service: http://discover.nci.nih.gov/gominer/xfire/GMService?wsdl My Demonstration program that can create the error: import java.io.*; import java.util.*; import org.w3c.dom.*; import org.apache.axis2.*; public class Demo { public static void main(String[] args) throws Exception { GOMinerWSPortTypeStub goMinerStub = new GOMinerWSPortTypeStub(); final String[] totals = new String[]{BAD, TP53}; final String[] changed = new String[]{BAD, TP53}; final String organism = 9606;10090; final String dataSource = all; final String evidence = all; final GOMinerWSPortTypeStub.GetReport requestParams = new GOMinerWSPortTypeStub.GetReport(); final GOMinerWSPortTypeStub.ArrayOfString ta = new GOMinerWSPortTypeStub.ArrayOfString(); ta.setString(totals); final GOMinerWSPortTypeStub.ArrayOfString ca = new GOMinerWSPortTypeStub.ArrayOfString(); ca.setString(changed); requestParams.setIn0(ta); requestParams.setIn1(ca); requestParams.setIn2(organism); requestParams.setIn3(dataSource); requestParams.setIn4(evidence); requestParams.setIn5(true); requestParams.setIn6(true); requestParams.setIn7(true); GOMinerWSPortTypeStub.GetReportResponse data = ""> System.out.println(data.getOut()); } } Command used to generate the client: ../devEnv/axis2-std-0/bin/WSDL2Java.sh -o . -t false -uri http://discover.nci.nih.gov/gominer/xfire/GMService?wsdl tcpmon log from a second run: Sent: POST /gominer/xfire/GMService HTTP/1.1 User-Agent: Axis/2.0 SOAPAction: Host: discover.nci.nih.gov:8081 Transfer-Encoding: chunked Content-Type: text/xml; charset=UTF-8 120 ?xml version='1.0' encoding='UTF-8'?soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/soapenv:Header /soapenv:Bodyns1:getReport xmlns:ns1=http://webservice.gominer.lmp.nci.nih.govns1:in7true/ns1:in7/ns1:getReport/soapenv:Body/soapenv:Envelope 0 Received: HTTP/1.1 500 Internal Server Error Date: Thu, 06 Apr 2006 18:30:02 GMT Server: Apache Content-Type: text/xml;charset=UTF-8 Connection: close Transfer-Encoding: chunked 22f ?xml version=1.0 encoding=UTF-8?soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/ xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns:xsi=http://www.w3.org/2001/XMLSchema-instancesoap:Bodysoap:FaultfaultcodeServer/faultcodefaultstringIllegal argument invoking 'gov.nih.nci.lmp.gominer.webservice.GOMinerWS.getReport([Ljava.lang.String;, [Ljava.lang.String;, java.lang.String, java.lang.String, java.lang.String, boolean, boolean, boolean)': wrong number of arguments/faultstring/soap:Fault/soap:Body/soap:Envelope 0 Command used to invoke the demo code: dkane$ java -cp
RE: Can't compile web service with exception
Hello Philippe, I was following another thread on this topic too. It seems that the discussion on that thread, as well as what you said, indicate that one has to __manually__ edit the wsdl file generated by Java2WSDL. Could you confirm the following: 1. Run Java2WSDL to generate WSDL file. 2. Edit the WDSL file to add the fault information like the following: In portType statement: wsdl:operation name=testException wsdl:input message=tns:testExceptionRequest/ wsdl:output message=tns:testExceptionResult/ wsdl:fault name=myFault message=tns:Exception/ /wsdl:operation In portBinding statement: wsdl:binding fault name=soapapiFault soap:fault name='myFault' use='literal' / /fault /wsdl:binding 3. Run WSDL2Java to generate the stubs. 4. Compile my implementation class along with the generated files. So I would have to do this hand edit of the WSDL each time I modified my interface? I think someone in the other thread mentioned that this was caused by a bug in AXIS? Is this true? Is there no work-around for this (other than the hand editing)? Many thanks. V --- philippe ventrillon [EMAIL PROTECTED] wrote: Hi I think if you are going from wsdl file you are supposed to Declare a message for the fault put somehting like that in your porttype operation name='getCurrentLanguageCursorPage' input message='tns:getCurrentLanguageCursorPageIn'/ output message='tns:getCurrentLanguageCursorPageOut'/ fault name='soapapiFault' message='tns:soapapiFault'/ /operation Put something like that in the portBinding fault name=soapapiFault soap:fault name='soapapiFault' use='literal' / /fault I imagine that when you invoke wsdl2Java it regenerates the service (with no throws clause) but not the impl class --- Philippe __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: [Axis2] 0.95 WS-Addressing client-side: module not found
trying addressing-0.95.mar in the classpath doesn't change anything... Deepal Jayasinghe wrote: ohhh , that is not going to be work ! you have to have the .mar extension otherwise system will not figure that out as an AxisModule. Roman Weidlich wrote: I renamed addressing-0.95.mar to addressing-0.95.jar and add it to the project libraires in Eclipse. EchoNonBlockingDualClient arises this: org.apache.axis2.AxisFault: Module not found at org.apache.axis2.description.AxisService.engageModule(AxisService.java:311) at org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java:273) at client.Client.invoke(Client.java:66) at client.Client.init(Client.java:28) at client.Client.main(Client.java:109) Chinthaka wrote: Michele Mazzucco wrote: Hi Eran, I'm sorry, but I cannot find the options.engageModule() call. Do you mean options.setAction() (I'm just trying to guess since the APIs don't explain what that method actually do)? I'm sorry its ServiceClient.engageModule(addressing).
Re: [Axis2] 0.95 WS-Addressing client-side: module not found
every try of this: serviceClient.engageModule(new QName(Constants.MODULE_ADDRESSING)); results in this: org.apache.axis2.AxisFault: Module not found but in the administration for the webservice is displayed: Service Status : Active Engaged modules for the service * addressing-0.95 Roman Weidlich wrote: trying addressing-0.95.mar in the classpath doesn't change anything... Deepal Jayasinghe wrote: ohhh , that is not going to be work ! you have to have the .mar extension otherwise system will not figure that out as an AxisModule. Roman Weidlich wrote: I renamed addressing-0.95.mar to addressing-0.95.jar and add it to the project libraires in Eclipse. EchoNonBlockingDualClient arises this: org.apache.axis2.AxisFault: Module not found at org.apache.axis2.description.AxisService.engageModule(AxisService.java:311) at org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java:273) at client.Client.invoke(Client.java:66) at client.Client.init(Client.java:28) at client.Client.main(Client.java:109) Chinthaka wrote: Michele Mazzucco wrote: Hi Eran, I'm sorry, but I cannot find the options.engageModule() call. Do you mean options.setAction() (I'm just trying to guess since the APIs don't explain what that method actually do)? I'm sorry its ServiceClient.engageModule(addressing).
RE: Can't compile web service with exception
Philippe, One other question... What's the difference between using soap:fault and wsdl:fault ? Also, I forgot to say... yes you are correct. My implementation class is not touched by the WSDL2Java command. Each time I change my interface (my portType), for example to add a new method or change a method prototype, I have to make the corresponding change in my implementation class by hand. v --- philippe ventrillon [EMAIL PROTECTED] wrote: Hi I think if you are going from wsdl file you are supposed to Declare a message for the fault put somehting like that in your porttype operation name='getCurrentLanguageCursorPage' input message='tns:getCurrentLanguageCursorPageIn'/ output message='tns:getCurrentLanguageCursorPageOut'/ fault name='soapapiFault' message='tns:soapapiFault'/ /operation Put something like that in the portBinding fault name=soapapiFault soap:fault name='soapapiFault' use='literal' / /fault I imagine that when you invoke wsdl2Java it regenerates the service (with no throws clause) but not the impl class --- Philippe -Original Message- From: Rhimbo [mailto:[EMAIL PROTECTED] Sent: jeudi 6 avril 2006 02:49 To: Axis users Subject: Can't compile web service with exception Hi all, I too am having trouble with exceptions. I can't even get past compilation now. I added a simple method to my interface definition: Family.java: public void testException() throws Exception; Here's the implementation: FamilyImpl.java: public void testException() throws Exception { throw new Exception(Well take that!); } I did: $ java org.apache.axis.wsdl.Java2WSDL -o family.wsdl \ --implClass disney.dis.family.FamilyImpl \ -lhttp://localhost:8080/axis/services/familyAccounts; \ -pdisney.dis.family urn:familyAccounts \ disney.dis.family.Family to generate the family.wsdl file. Then I did: $ java org.apache.axis.wsdl.WSDL2Java -o . -d Session -s \ -p disney.dis.family family.wsdl When I compile, I get these errors: FamilyAccountsSoapBindingImpl.java:123: testException() in disney.dis.family.FamilyAccountsSoapBindingImpl cannot implement testException() in disney.dis.family.Family; overridden method does not throw java.lang.Exception public void testException() throws java.lang.Exception ^ FamilyImpl.java:1105: testException() in disney.dis.family.FamilyImpl cannot implement testException() in disney.dis.family.Family; overridden method does not throw java.lang.Exception public void testException() throws Exception Apparently the compiler thinks that my method prototype in the Family.java interface definition doesn't throw Exception. But it does (above). More strangely, here is the prototype from the _generated_ Family.java file: public void testException() throws java.rmi.RemoteException; WSDL2Java added throws java.rmi.RemoteException but not throws Exception. Why is WSDL2Java not adding the throws Exception to the method prototype in the generated Family.java interface file? I followed a few threads the past several days about tweaking the wsdl file to get exception handling correct. I admit I didn't quite follow. Is there something I need to do after generating the wsdl file, before running the WSDL2Java command, to get exceptions to work? Here is excerpt from the generated WSDL below: wsdl:message name=testExceptionResponse /wsdl:message wsdl:message name=testExceptionRequest /wsdl:message wsdl:operation name=testException wsdl:input message=impl:testExceptionRequest name=testExceptionRequest/ wsdl:output message=impl:testExceptionResponse name=testExceptionResponse/ /wsdl:operation wsdl:operation name=testException wsdlsoap:operation soapAction=/ wsdl:input name=testExceptionRequest wsdlsoap:body encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; namespace=urn:familyAccounts use=encoded/ /wsdl:input wsdl:output name=testExceptionResponse wsdlsoap:body encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; namespace=urn:familyAccounts use=encoded/ /wsdl:output /wsdl:operation Thanks, Vartan __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: [Axis2] Generation of Keystores
Hi Siamak,I highly recommend you to give Portecle (http://portecle.sourceforge.net/) a try. Thus, you will be able to manage keystores easily. It's superb and open-source. Please pass it English localeproperties before running:java -Duser.language=en -jar portecle.jarAlthough I don't know the theory behind it, followingsworked for me. You might also give a try to it: axis2 security sample's sec.jks -- - Examine sec.jks with Portecle and see signature algorithm of bob private key as "SHA1withRSA" - Notice signatureKeyIdentifier found in InflowSecurity and OutflowSecurity is set as SKIKeyIdentifier: signatureKeyIdentifierSKIKeyIdentifier/signatureKeyIdentifierkeytool generated client.jks and server.jks - Examine client.jks with Portecle and see signature algorithm of client private key as "MD5withRSA"- Replace SKIKeyIdentifier with DirectReference: signatureKeyIdentifierDirectReference/signatureKeyIdentifierHope this works.Ali Sadik KumlaliSiamak Haschemi [EMAIL PROTECTED] wrote: Hello Ruchith.Thank you very much for that fantastic support. It is not naturally that people are so patient :-)I will try to follow your hint, but I already did everything I could imagine.Thank you very much,Siamak HaschemiRuchith Fernando schrieb: Hi Siamak, I will try to get you a step by step project over the week end :-) But please note that the exception that you mentioned: "WSHandler: Signature: error during message procesingorg.apache.ws.security.WSSecurityException: General security error (Unexpected number of X509Data: for Signature) ..." occurs when you have NOT specified the correct alias of the private key in the keystore to use as the value of the element in the outflowConfiguration, also the callback handler class must supply the correct password of the private key when asked for password of that particular alias. Thanks, Ruchith On 4/6/06, Siamak Haschemi wrote:Hello Ruchith, I think that was a misunderstanding. I already made this changes. I think that the problem lies in de keystore. Did you look at the script? Is the generation of the Keystore correct? Or am I missing some extra paramaters? I would be very thankful If you could send me a litte projekt including the generation of self-signing Certificates. Thank you very much, Siamak Haschemi Ruchith Fernando schrieb: Hi, Please note that you will have to provide the configuration information according to set the new keystores. Simply replacing the keystores in the security sample will not help. - You will have to set the value in the outflowConfiguration parameter to the alias of the private key in the appropriate keystore. - You will have to provide a .properties file with the correct keystore information - You will have to make sure the PasswordCallbackhandler class (impl of java.auth.Callbackhandler) returns the proper passwords for the required identifiers. - You will have to make sure you have all the above available in the classpath of both service and client appropriately (The secUtil.jar in the security sample packages all of these). HTH Thanks, Ruchith On 4/6/06, Siamak Haschemi wrote:Hello Ruchith. I follow you instructions. I create a script for generating the keystore. But now I got into trubble with a error: "WSHandler: Signature: error during message procesingorg.apache.ws.security.WSSecurityException: General security error (Unexpected number of X509Data: for Signature) ..." If I use the original "sec.jks" from the security sample (and changing the axis2.xml user and encryptionUser param) it works. So I think there's still something wrong with my Keystore. Here is the script I use to generate the keystore. - @echo off set CLIENT_KEYPASS=keyPassClient set CLIENT_STOREPASS=storePassClient set SERVER_KEYPASS=keyPassServer set SERVER_STOREPASS=storePassServer keytool -genkey -keyalg RSA -alias client -keystore client.jks -dname "cn=Client" -keypass %CLIENT_KEYPASS% -storepass %CLIENT_STOREPASS% keytool -genkey -keyalg RSA -alias server -keystore server.jks -dname "cn=Server" -keypass %SERVER_KEYPASS% -storepass %SERVER_STOREPASS% keytool -selfcert -alias client -keystore client.jks -keypass %CLIENT_KEYPASS% -storepass %CLIENT_STOREPASS% keytool -selfcert -alias server -keystore server.jks -keypass %SERVER_KEYPASS% -storepass %SERVER_STOREPASS% keytool -export -keystore client.jks -alias client -storepass %CLIENT_STOREPASS% -file client.cert keytool -export -keystore server.jks -alias server -storepass %SERVER_STOREPASS% -file server.cert keytool -import -noprompt -alias server -file server.cert -keystore client.jks -storepass %CLIENT_STOREPASS% keytool -import -noprompt -alias client -file client.cert -keystore server.jks -storepass %SERVER_STOREPASS% del client.cert del server.cert keytool -list -keystore client.jks -storepass %CLIENT_STOREPASS% keytool -list -keystore
Comparison Axis vs. JWSDP
Hi, as a newbie only a short question: Can anybody please explain the difference (pros / contras) between these two projects? Thanx Michael
Using Axis without Servlets, Containers and other stuff
Hi, a second question from a newbie ;) All documents I've read so far describe the use of Axis in JBoss, Tomcat and so on ... Anybody knows a document (I couldn't find one), which explains, how I can use Axis in an own simple TCP-Server without Beans? I do some communication over TCP-port (ASCII and binary) with some hardware devices and want to add in a simple way an additional interface for queries / remote control from other servers. Hope somebody can help. Regards Michael
Re: Using Axis without Servlets, Containers and other stuff
Try looking in the user guide for Axis standalone server. In the API, look for org.apache.axis.server.AxisServer and org.apache.axis.transport.http.SimpleAxis{Server,Worker} Jeff Michael Bauroth wrote: Hi, a second question from a newbie ;) All documents I've read so far describe the use of Axis in JBoss, Tomcat and so on ... Anybody knows a document (I couldn't find one), which explains, how I can use Axis in an own simple TCP-Server without Beans? I do some communication over TCP-port (ASCII and binary) with some hardware devices and want to add in a simple way an additional interface for queries / remote control from other servers. Hope somebody can help. Regards Michael
Re: Using Axis without Servlets, Containers and other stuff
Thanx! Michael Jeff Greif wrote: Try looking in the user guide for Axis standalone server. In the API, look for org.apache.axis.server.AxisServer and org.apache.axis.transport.http.SimpleAxis{Server,Worker} Jeff Michael Bauroth wrote: Hi, a second question from a newbie ;) All documents I've read so far describe the use of Axis in JBoss, Tomcat and so on ... Anybody knows a document (I couldn't find one), which explains, how I can use Axis in an own simple TCP-Server without Beans? I do some communication over TCP-port (ASCII and binary) with some hardware devices and want to add in a simple way an additional interface for queries / remote control from other servers. Hope somebody can help. Regards Michael -- _ FALCOM GmbH __ Dipl.-Ing. Michael Bauroth Manager Software Department Phone: +49 3677 8042 332 Fax: +49 3677 8042 215 E-mail: [EMAIL PROTECTED] Address: Gewerbering 6, 98704 Langewiesen, Germany __ www.falcom.de ___ This e-mail and any files transmitted are the property of FALCOM and/or its affiliates, are confidential, and are intended solely for the use of the individual or entity to whom this e-mail is addressed. If you are not one of the named recipients or otherwise have reason to believe that you have received this e-mail in error, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing or copying of this e-mail is strictly prohibited.
RE: Can't compile web service with exception
Folks, I'm trying to create the wsdl:fault element in my wsdl file. Can anyone tell me what value I should use for the message parameter? What namespace should I use? I tried using the impl: prefix that I see throught my wsdl file. But I still get the exception shown below: I want to indicate that my method throws java.lang.Exception. How do I specify this? It appears that the string I put in the message parameter ends up appended to the throws clause on my method in the interface file that AXIS auto-generates. But I can't get a clean WSDL2Java run when I put the exception class name. Here is the wsdl:fault ... element I added to my wsdl: wsdl:operation name=testException wsdl:input message=impl:testExceptionRequest name=testExceptionRequest/ wsdl:output message=impl:testExceptionResponse name=testExceptionResponse/ wsdl:fault name=myException message=impl:Exception / /wsdl:operation But I get the following AXIS exceptions when I run $ java org.apache.axis.wsdl.WSDL2Java -o . -d Session -s -p foo foo.wsdl java.io.IOException: input .., output .. or fault .. in portType with undefined message found. message name is '{urn:foo}Exception' at org.apache.axis.wsdl.symbolTable.SymbolTable.ensureOperationMessageValid(SymbolTable.java:1504) ... ... Thanks all. V --- Rhimbo [EMAIL PROTECTED] wrote: Philippe, One other question... What's the difference between using soap:fault and wsdl:fault ? Also, I forgot to say... yes you are correct. My implementation class is not touched by the WSDL2Java command. Each time I change my interface (my portType), for example to add a new method or change a method prototype, I have to make the corresponding change in my implementation class by hand. v --- philippe ventrillon [EMAIL PROTECTED] wrote: Hi I think if you are going from wsdl file you are supposed to Declare a message for the fault put somehting like that in your porttype operation name='getCurrentLanguageCursorPage' input message='tns:getCurrentLanguageCursorPageIn'/ output message='tns:getCurrentLanguageCursorPageOut'/ fault name='soapapiFault' message='tns:soapapiFault'/ /operation Put something like that in the portBinding fault name=soapapiFault soap:fault name='soapapiFault' use='literal' / /fault I imagine that when you invoke wsdl2Java it regenerates the service (with no throws clause) but not the impl class --- Philippe -Original Message- From: Rhimbo [mailto:[EMAIL PROTECTED] Sent: jeudi 6 avril 2006 02:49 To: Axis users Subject: Can't compile web service with exception Hi all, I too am having trouble with exceptions. I can't even get past compilation now. I added a simple method to my interface definition: Family.java: public void testException() throws Exception; Here's the implementation: FamilyImpl.java: public void testException() throws Exception { throw new Exception(Well take that!); } I did: $ java org.apache.axis.wsdl.Java2WSDL -o family.wsdl \ --implClass disney.dis.family.FamilyImpl \ -lhttp://localhost:8080/axis/services/familyAccounts; \ -pdisney.dis.family urn:familyAccounts \ disney.dis.family.Family to generate the family.wsdl file. Then I did: $ java org.apache.axis.wsdl.WSDL2Java -o . -d Session -s \ -p disney.dis.family family.wsdl When I compile, I get these errors: FamilyAccountsSoapBindingImpl.java:123: testException() in disney.dis.family.FamilyAccountsSoapBindingImpl cannot implement testException() in disney.dis.family.Family; overridden method does not throw java.lang.Exception public void testException() throws java.lang.Exception ^ FamilyImpl.java:1105: testException() in disney.dis.family.FamilyImpl cannot implement testException() in disney.dis.family.Family; overridden method does not throw java.lang.Exception public void testException() throws Exception Apparently the compiler thinks that my method prototype in the Family.java interface definition doesn't throw Exception. But it does (above). More strangely, here is the prototype from the _generated_ Family.java file: public void testException() throws java.rmi.RemoteException; WSDL2Java added throws java.rmi.RemoteException but not throws Exception. Why is WSDL2Java not adding the throws Exception to the method prototype in the generated Family.java interface file? I followed a few threads the past several days about tweaking the wsdl file to get exception handling correct. I admit I didn't quite follow. Is there something I need to do after generating the wsdl file,
Re: Order of SOAPHeader and SOAPBody
Hi Daniel, Yes, you can use wss4j with Axis 1.3. I tried that before. Regards, Xinjun On 4/7/06, Daniel Destro [EMAIL PROTECTED] wrote: Hi Xinjun, Thanks. I've just realized that u're using Axis2. I am using Axis 1.3 yet. Can I use wss4j with Axis 1.3? Where are u from? Thanks again Daniel - Brasil On 4/5/06, Xinjun Chen [EMAIL PROTECTED] wrote: Hi Daniel, I take advantage of WSS4J to add UsernameToken to the SOAPEnvelope. Some sample codes: Document domDoc = Axis2Util.getDocumentFromSOAPEnvelope(envelope); // Add the UserNameToken. WSSAddUsernameToken builder = new WSSAddUsernameToken(, false); if (token.isDigested()) { builder.setPasswordType(WSConstants.PASSWORD_DIGEST); } else { builder.setPasswordType(WSConstants.PASSWORD_TEXT); } builder.build(domDoc, token.getUsername (), token.getPassword()); Element header = (Element) (domDoc.getElementsByTagName(SOAP-ENV:Header).item(0)); //SOAPHeader header = Axis2Util.getSOAPFactory(envelope); //SOAPFactory factory = Axis2Util.getSOAPFactory (envelope); OMElement headerElm = (OMElement) (Axis2Util.toOM(header)); envelope.getBody().insertSiblingBefore(headerElm); These are only some experimental codes. I assume the SOAPEnvelope has been constructed. What these code snippet is more of a handler. There may be other ways to do it. As Ruchith said, you can also take advantage of Axis2 security module. Regards, Xinjun On 4/6/06, Daniel Destro [EMAIL PROTECTED] wrote: Hi Xinjun, As I can see you are trying to add some Security to your Web Services, right? Are you doing a User Authentication / Authorization using this UsernameToken? I need to do that! How do add UsernameToken into to the SOAP request and how do u read / validate UsernameToken from the SOAP request (server-side) ??? Thanks Daniel
Re: Order of SOAPHeader and SOAPBody
Hi Daniel, To be specific, I tried wss4j using the Axis 1.3 library. The following article may be useful to you. http://www.devx.com/Java/Article/28816/0/page/1 The author uses Axis 1.x library. Regards, Xinjun On 4/7/06, Xinjun Chen [EMAIL PROTECTED] wrote: Hi Daniel, Yes, you can use wss4j with Axis 1.3. I tried that before. Regards, Xinjun On 4/7/06, Daniel Destro [EMAIL PROTECTED] wrote: Hi Xinjun, Thanks. I've just realized that u're using Axis2. I am using Axis 1.3 yet. Can I use wss4j with Axis 1.3? Where are u from? Thanks again Daniel - Brasil On 4/5/06, Xinjun Chen [EMAIL PROTECTED] wrote: Hi Daniel, I take advantage of WSS4J to add UsernameToken to the SOAPEnvelope. Some sample codes: Document domDoc = Axis2Util.getDocumentFromSOAPEnvelope(envelope); // Add the UserNameToken. WSSAddUsernameToken builder = new WSSAddUsernameToken(, false); if (token.isDigested()) { builder.setPasswordType(WSConstants.PASSWORD_DIGEST); } else { builder.setPasswordType(WSConstants.PASSWORD_TEXT); } builder.build(domDoc, token.getUsername (), token.getPassword()); Element header = (Element) (domDoc.getElementsByTagName(SOAP-ENV:Header).item(0)); //SOAPHeader header = Axis2Util.getSOAPFactory(envelope); //SOAPFactory factory = Axis2Util.getSOAPFactory (envelope); OMElement headerElm = (OMElement) (Axis2Util.toOM(header)); envelope.getBody().insertSiblingBefore(headerElm); These are only some experimental codes. I assume the SOAPEnvelope has been constructed. What these code snippet is more of a handler. There may be other ways to do it. As Ruchith said, you can also take advantage of Axis2 security module. Regards, Xinjun On 4/6/06, Daniel Destro [EMAIL PROTECTED] wrote: Hi Xinjun, As I can see you are trying to add some Security to your Web Services, right? Are you doing a User Authentication / Authorization using this UsernameToken? I need to do that! How do add UsernameToken into to the SOAP request and how do u read / validate UsernameToken from the SOAP request (server-side) ??? Thanks Daniel
RE: [AXIS2] Classloader problem
Hi Deepal, Thanks for your answer. This is what I thought too about the classloader mechanism. However in my case I really have a class conflict and axis2 is using the classes loaded in /web-inf/lib. My problem comes from the geronimo-javamail that doesn't implement all the specification and thus I receive UnsupportedOperationException whereas the sun distribution is located under myService |_lib I am deploying axis2 under Tomcat. Thanks, Arnaud -Original Message- From: Deepal Jayasinghe [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 05, 2006 6:21 AM To: axis-user@ws.apache.org Subject: Re: [AXIS2] Classloader problem Hi ; Axis2 service classloaders work in child first scenario by default , what that mean is it load classes from child class loader before loading from parent class loader, so according to ur picture , if there is some class in foo.jar inside myService.aar then for the service it will use class in myService.aar/lib/foo.jar not from web-inf/lib/foo.jar. So you dont need to do anything to get this is done , by default Axis2 does the class loading as you require. Arnaud Blandin wrote: Hi, I am sure you have been discussing about this problem in the past but I couldn't find the relevant thread. I apologize in advance if I am describing a known problem. I am currently building a service on top of AXIS2. This service is using classes that are conflicting with the classes distributed with the Axis2 web app. The service is deployed as an aar file in the service directory of the axis2 web application. My question is simple: how can I ensure that the ClassLoader tries to load first the classes packaged in my lib directory from the aar instead of looking at the 'lib' directory of the axis2 webapp. |_WEB-INF |_lib |_foo.jar |_services |_myService.aar |_lib |_foo.jar I want to ensure that my service looks first for the myService.aar/lib/foo.jar As a workaround I tried to set the following with no luck before invoking the Skeleton: ClassLoader previous = Thread.currentThread().getContextClassLoader(); ClassLoader loader = msgContext.getAxisService().getClassLoader(); Thread.currentThread().setContextClassLoader(loader); Thanks, Arnaud -- Thanks, Deepal ~Future is Open~