Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 41030 invoked from network); 6 Jun 2006 20:32:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Jun 2006 20:32:38 -0000 Received: (qmail 82727 invoked by uid 500); 6 Jun 2006 20:32:36 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 82218 invoked by uid 500); 6 Jun 2006 20:32:34 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 82207 invoked by uid 99); 6 Jun 2006 20:32:34 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jun 2006 13:32:34 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jun 2006 13:32:33 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 981977142C7 for ; Tue, 6 Jun 2006 20:31:32 +0000 (GMT) Message-ID: <13266870.1149625892620.JavaMail.jira@brutus> Date: Tue, 6 Jun 2006 20:31:32 +0000 (GMT+00:00) From: "Bille (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Commented: (AXIS2-801) UserException -> AxisFault is not put in details to the SOAP-response ++ Davanum advised me to open an issue In-Reply-To: <13876058.1149287732011.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/AXIS2-801?page=comments#action_12415036 ] Bille commented on AXIS2-801: ----------------------------- Thanks Eran, I tried again including your changes and it really looks better now. Issues 2) and 3) are still remaining!! The SOAP-response now looks like this: soapenv:Client [my individual error-message] org.apache.axis2.AxisFault: Exception in service-method :: getEONGDSGrous(); nested exception is: javax.naming.NameNotFoundException: [LDAP: error code 32 - NDS error: no such entry (-601)]; remaining name 'ou=users,ou=ruhr,o=eon,c=de' at de.eonis.bd.ws.LDAPQueryService.getEONGDSGroups(LDAPQueryService.java:415) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.axis2.receivers.RawXMLINOutMessageReceiver.invokeBusinessLogic(RawXMLINOutMessageReceiver.java:99) at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:37) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:480) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:284) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:144) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) .... Concerning issue 4): init(ServiceConetxt) is called, but I used init(MessageContext) as described in this article: http://www.developer.com/open/article.php/10930_3589126_3 Thanks again, could you comment on issue 2) and 3) please?! > UserException -> AxisFault is not put in details to the SOAP-response ++ Davanum advised me to open an issue > ------------------------------------------------------------------------------------------------------------ > > Key: AXIS2-801 > URL: http://issues.apache.org/jira/browse/AXIS2-801 > Project: Apache Axis 2.0 (Axis2) > Type: Bug > Components: transports > Versions: 1.0 > Environment: WinXP Prof, JDK 1.4.2_09,Tomcat 5.0.28, > Reporter: Bille > Assignee: Eran Chinthaka > > Service works fine in normal use. I did not use code-generation with WSDL; I created it manually. > When one parameter for the service is not usable, the service should throw a KIDnotFoundException, which then should be transported with all its details as a SOAPFault in the response to the client. > ------------------------- my UserException ----------------- > import java.rmi.RemoteException; > public class KIDnotFoundException extends RemoteException { > public KIDnotFoundException(String message, Throwable ex){ > super(message, ex); > } > } > ------------------------- my service implementation ----------------- > import de.eonis.bd.ws.util.*; > import java.util.*; > import java.util.logging.Logger; > import javax.naming.NamingEnumeration; // JDK > import javax.naming.NamingException; > import javax.naming.directory.*; > import javax.xml.namespace.QName; // aus stax-api-1.0.jar > import org.apache.axiom.om.*; // aus axiom-api-1.0.jar > import org.apache.axiom.soap.*; > import org.apache.axis2.AxisFault; > import org.apache.axis2.context.*; > import org.apache.axis2.context.*; > import org.apache.axis2.wsdl.WSDLConstants; > public class LDAPQueryService { > private LDAPQuery ldapQuery = null; > private MessageContext inMsgCtx = null; > private MessageContext outMsgCtx = null; > > // Konstanten fuer die Market-Units (MU) > public static final String MU_EAG = "eonag"; > public static final String MU_EEA = "eea"; > public static final String MU_ERG = "ruhrgas"; > public static final String MU_NOR = "eno"; > public static final String MU_UK = "eonuk"; > public static final String MU_US = "lgee"; > public static final String MU_ALL = "global"; > // lasse ich init(param in) und setOperationConext drin erhalte ich den Fehler beim Starten des Tomcat > /** > * - Error in schema generating Sorry we don't support methods overloading !!!! > java.lang.Exception: Sorry we don't support methods overloading !!!! > at org.apache.ws.java2wsdl.SchemaGenerator.generateSchema(SchemaGenerator.java:143) > at org.apache.axis2.deployment.util.Utils.fillAxisService(Utils.java:213) > at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:149) > at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:76) > at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:118) > at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:620) > .... > */ > /* > public void init(MessageContext msgCtx){ > System.out.println("setting MessageContext: " + msgCtx.toString()); > this.MsgCtx = msgCtx; > } > /** > public void init(MessageContext inCtx, MessageContext msgCtx){ > System.out.println("setting outgoing MessageContext: " + msgCtx.toString()); > this.msgCtx = msgCtx; > } > > **/ > > /** > * Das geht > * aus : http://marc.theaimsgroup.com/?l=axis-user&m=114715486422557&w=2 > */ > public void setOperationContext(OperationContext opctx) throws AxisFault { > System.out.println("setting in- & outgoing MessageContext: " + opctx.toString()); > this.inMsgCtx = opctx.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE); > this.outMsgCtx = opctx.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE); > } > > > /** > * Liefert die Gruppen eines Users im EONGDS, dh fuer alle moeglichen MUs. > * Die MU des Users kann noch mit uebergeben werden, dann wird auch nur in diesem Container > * nach dem User gesucht. > * > * Das EONGDS ist aktuell noch nicht soweit mit dem GDir synchronisiert, dass darueber > * alle MUs abbildbar waeren. > * Zur Zeit enthalten GDir und EONGDS nicht die gleichen Gruppen. > * > * @param kid String die eindeutige Konzern-ID des Users. > * @param mu String Kuerzel fuer die zu durchsuchende MU > */ > public OMElement getEONGDSGroups(OMElement input) throws AxisFault { > // String kid, String marketUnit > String method = "getEONGDSGroups()"; > // fully qualified Names > QName kidName = new QName(OMHelper.NAMESPACE, "kid"); > String kid = input.getFirstChildWithName(kidName).getText(); > QName muName = new QName(OMHelper.NAMESPACE, "mu"); > String mu = input.getFirstChildWithName(muName).getText(); > System.out.println("Up to search EONGDS-Groups for KID " + kid + " in MU " + mu); > > OMElement result; > if (Utils.isValidKID(kid)){ > try { > System.out.println("up to query directory..."); > ldapQuery = new LDAPQuery(false, LDAPQuery.EONGDS, "o=eon,c=de"); > // nur Groupmembership-Attribut ist relevant > ldapQuery.setReturnAtts(new String []{"groupmembership"}); > String base = "ou=users,ou=" + mu + ",o=eon,c=de"; > String filter = "(&(cn=" + kid + ")(objectClass=person))"; > NamingEnumeration data = ldapQuery.querySubtree(base, filter); > result = OMHelper.getSOAPFromLDAPResult(data); > } > catch (NamingException ne){ > result = null; > System.out.println("getEONGDSGroups throws NamingException: " + ne.getMessage()); > SOAPFactory soapFactory = OMAbstractFactory.getSOAP12Factory(); > SOAPFault soapFault = soapFactory.createSOAPFault(); > SOAPFaultCode faultCode = soapFactory.createSOAPFaultCode(soapFault); > faultCode.declareNamespace("http://someuri.org", "m"); > SOAPFaultValue soapFaultValue = soapFactory.createSOAPFaultValue(faultCode); > soapFaultValue.setText("m:FaultException"); > SOAPFaultReason soapFaultReason = soapFactory.createSOAPFaultReason(soapFault); > SOAPFaultText soapFaultText = soapFactory.createSOAPFaultText(soapFaultReason); > soapFaultText.setText("the reason of the error"); > > // setting the outgoing MessageContext > outMsgCtx.setProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME, faultCode); > outMsgCtx.setProperty(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME, soapFaultReason); > //outMsgCtx.setProperty(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME, faultDetail); > > // throw the AxisFault > throw new AxisFault("Exception in service-method :: getEONGDSGrous()", ne); > } > } > else { > String text = "invalid KID: KID' " + kid + "' not found in MU '" + mu + "'"; > result = handleInvalidData(text, method); > } > > return result; > > } > // ... some more service-methods ... > } > ------------------------- the SOAP response ----------------- > > > > > soapenv:Client > unknown > > > org.apache.axis2.AxisFault > at org.apache.axis2.receivers.RawXMLINOutMessageReceiver.invokeBusinessLogic(RawXMLINOutMessageReceiver.java:102) > at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:37) > at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:454) > at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:284) > at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:136) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) > at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) > at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) > at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) > .... > > > > > > ------------------------- SOAPFault manually built ----------------- > The following is set to the outgoing messageContext in my serviceimplementation - outMsgCtx.setProperty(): > > > m:FaultException > > > the reason of the error > > > ------------------------- issues I wonder about ----------------- > 1) My details aren't reaching the client. The following I found out while debugging the service: > In class RawXMLINOutMessageReceiver::invokeBusinessLogic() my service-method is called and throws an exception as expected. The exception is of type > InvocationTargetException and has as a member variable called "target" an object of type AxisFault, with the detailvariable set to the originally thrown exception and the detailmessage set to my individuel errormessage. > The invokeBusinessLogic() catches this exception and throws an AxisFault using mentioned InvocationTargetException, like this: > throw new AxisFault(e.getMessage()); > The message member of the InvocationTargetException is null !! so all my user definitions are gone. > 2) The above depicted response looks like SOAP 1.1 and not 1.2. I thought Axis2 would work with SOAP 1.2 per default ? > 3) In addition the faultCode says CLIENT !!! > 4) I could access the messageContext only by setOperationContext(). I formerly tried the init(param1); if so I get a serious error while starting the server: > - Error in schema generating Sorry we don't support methods overloading !!!! > java.lang.Exception: Sorry we don't support methods overloading !!!! > at org.apache.ws.java2wsdl.SchemaGenerator.generateSchema(SchemaGenerator.java:143) > at org.apache.axis2.deployment.util.Utils.fillAxisService(Utils.java:213) > at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:149) > at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:76) > at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:118) > at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:620) > Maybe I'm missing something; unfortunately I could not find any sample for using UserExeptions the right way. > Could someone clear these issues please - Thanks a lot -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-dev-help@ws.apache.org