Return-Path: Delivered-To: apmail-ws-axis-c-user-archive@www.apache.org Received: (qmail 47396 invoked from network); 6 Aug 2007 06:32:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Aug 2007 06:32:57 -0000 Received: (qmail 56474 invoked by uid 500); 6 Aug 2007 06:32:56 -0000 Delivered-To: apmail-ws-axis-c-user-archive@ws.apache.org Received: (qmail 56456 invoked by uid 500); 6 Aug 2007 06:32:56 -0000 Mailing-List: contact axis-c-user-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Apache AXIS C User List" Reply-To: "Apache AXIS C User List" Delivered-To: mailing list axis-c-user@ws.apache.org Received: (qmail 56445 invoked by uid 99); 6 Aug 2007 06:32:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Aug 2007 23:32:56 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.68.5.17] (HELO relay03.pair.com) (209.68.5.17) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 06 Aug 2007 06:32:47 +0000 Received: (qmail 56328 invoked from network); 6 Aug 2007 06:32:14 -0000 Received: from 123.231.23.58 (HELO ?10.100.1.163?) (123.231.23.58) by relay03.pair.com with SMTP; 6 Aug 2007 06:32:14 -0000 X-pair-Authenticated: 123.231.23.58 Message-ID: <46B6C128.8060104@wso2.com> Date: Mon, 06 Aug 2007 12:05:20 +0530 From: Kaushalye Kapuruge User-Agent: Thunderbird 1.5.0.4 (X11/20060713) MIME-Version: 1.0 To: Apache AXIS C User List Subject: Re: Digest Verification problem References: <46B39B41.4010709@forouher.de> In-Reply-To: <46B39B41.4010709@forouher.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi Dariush, Could you please send us the WSDL that you are using? If the C14N input is different to the actual payload, signature must be=20 failed in the server side. Instead of using the code generation tool, have you tried building the=20 same payload manually? That might help to identify the origin of the problem. Cheers, Kaushalye Dariush Forouher wrote: > Hello, > > I am trying to create a Axis2/C + Rampart/C WS client together with a > Axis2/Java +Rampart/Java service. > > I've managed to get most of the stuff to work, Signing and even > Encryption works fine. > But an odd problem is that Rampart Body signature validation seems to > fail on certain operations. Calling operations which don't have any > parameters on the client side seem to work fine (see attachment > "rampartc.working.soapmessage"), whereas calls to operations which have= > at least one parameter fail when the service tries to validate the > digest (see "rampartc.not.working.soapmessage"): > > This ist the output from the Axis2 webservice: > > > WARNUNG: Verification failed for URI "#SigID-0484f390-41fb-1dc1" > 03.08.2007 21:52:08 org.apache.xml.security.signature.Reference verify > INFO: Verification successful for URI "#SigID-0484f818-41fb-1dc1" > org.apache.ws.security.WSSecurityException: The signature verification > failed > at > org.apache.ws.security.processor.SignatureProcessor.verifyXMLSignature(= SignatureProcessor.java:341) > at > org.apache.ws.security.processor.SignatureProcessor.handleToken(Signatu= reProcessor.java:80) > at > org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurit= yEngine.java:279) > at > org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurit= yEngine.java:201) > at > [...] > > > > Looking at the axis2 client log (see "wsauth.log.bad"), I found it > suspicious that the soap body captured via wireshark doesn't match with= > the one logged: > > This is the output of the canonicalizer, according to the log: > > xmlns:wsu=3D"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-ws= security-utility-1.0.xsd" > wsu:Id=3D"SigID-0484f390-41fb-1dc1"> xmlns:ns1=3D"urn:WSAuth"> > > > Wheras this is the actual body send over the wire: > > xmlns:wsu=3D"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-ws= security-utility-1.0.xsd"> xmlns:ns1=3D"urn:WSAuth">schumi > > > > (Notice the missing ... element) > > I'm using Axis2c und RampartC from SVN. The snapshot was taken on > 2007-07-29. The code has not been modified by me exept a one line chang= e > suggested in the "Generating incorrect digests?" thread on axis2c-dev > ("u" -> "wsu"). > > I generated the client code via WSDL2C tool from the Axis2 Package (som= e > SVN snapshot from July). I changed some lines here and there to > workaround some problems, but I didn't touch the serializer code. > > ciao > Dariush > > =20 > -----------------------------------------------------------------------= - > > POST /axis2/services/WSAuthService HTTP/1.0 > User-Agent: Axis2/C > SOAPAction: "urn:WSAuth" > Content-Length: 2473 > Content-Type: text/xml;charset=3DUTF-8 > > > > 2007-08-03T19:52:08.269Z2007-08-03T19:58:08.269Z =20 >> Y/RfvBEMACnPbPDl8RCbOiVdPKo=3D= bRiadT/dswEBTVb72JDhpjzBgiI=3Dpf8YpZOMnF4NX9G2ihhiAqCJcomxzTcnI8wTSeixbRLuTQB54= ivbjoydqoEqsRskRvfqM5cGLgilybRRwuv3+IJIiUOtaVH31gvIwfVZIlrLzsMvy98i35gufE= okLCfxovlrXAFWZadkQYey5NlgNebz/jJoMa9ozrl9w85IkCw=3D<= ds:KeyInfo> >> =20 > Z7e8jCIpHhdYxkORpvuC5xF3YtY=3D > schumi > > =20 > -----------------------------------------------------------------------= - > > POST /axis2/services/WSAuthService HTTP/1.0 > User-Agent: Axis2/C > Content-Length: 2432 > Content-Type: application/soap+xml;charset=3DUTF-8 > > > > 2007-08-03T19:52:04.449Z2007-08-03T19:58:04.449Z<= /ds:Transform>< > /ds:DigestMethod>rupyg8n0hq/C50ujLDpCH70QFaA=3D<= ds:Transforms>d7= 4CkE89Njh86RT4ScFh7ZF1e/k=3DT5L1PvLgyz5o9l40wmpg03WNSF3HHE6Nq/s+qJbMNdv+BdcP3mx= mxIi3A7gnZdoOesBa0TuZ5NiU16UY49imPoWj4pmCwhNW2yQm097H1Y9li19HTcu26DKjpaWE= 9oZBb8fq9xgbtiz+qEBDVeRXpX28uyQoXjEZS9xF6YFx/+Y=3DZ7 > e8jCIpHhdYxkORpvuC5xF3YtY=3D > = > > =20 > -----------------------------------------------------------------------= - > > [Fri Aug 3 21:52:08 2007] [debug] phase.c(113) axis2_handler_t *reques= t_uri_based_dispatcher added to the index 0 of the phase Transport > [Fri Aug 3 21:52:08 2007] [debug] phase.c(113) axis2_handler_t *addres= sing_based_dispatcher added to the index 1 of the phase Transport > [Fri Aug 3 21:52:08 2007] [debug] phase.c(113) axis2_handler_t *soap_m= essage_body_based_dispatcher added to the index 0 of the phase Dispatch > [Fri Aug 3 21:52:08 2007] [debug] phase.c(113) axis2_handler_t *soap_a= ction_based_dispatcher added to the index 2 of the phase Dispatch > [Fri Aug 3 21:52:08 2007] [debug] phase.c(113) axis2_handler_t *dispat= ch_post_conditions_evaluator added to the index 0 of the phase PostDispat= ch > [Fri Aug 3 21:52:08 2007] [debug] phase.c(113) axis2_handler_t *contex= t_handler added to the index 1 of the phase PostDispatch > [Fri Aug 3 21:52:08 2007] [debug] conf_builder.c(220) no custom dispat= ching order found continue with default dispatching order > [Fri Aug 3 21:52:08 2007] [debug] conf_builder.c(326) module rampart f= ound in axis2.xml > [Fri Aug 3 21:52:08 2007] [debug] class_loader.c(135) Object loaded su= ccessfully > [Fri Aug 3 21:52:08 2007] [debug] class_loader.c(135) Object loaded su= ccessfully > [Fri Aug 3 21:52:08 2007] [debug] dir_handler.c(195) No files in the p= ath /home/dariush/workspace/AxisCtest2/home/services. > [Fri Aug 3 21:52:08 2007] [debug] dep_engine.c(1042) axis2_dep_engine_= load_module_dll: DLL path is : /home/dariush/workspace/AxisCtest2/home/mo= dules/addressing/libaxis2_mod_addr.so > [Fri Aug 3 21:52:08 2007] [debug] class_loader.c(135) Object loaded su= ccessfully > [Fri Aug 3 21:52:08 2007] [debug] dep_engine.c(1042) axis2_dep_engine_= load_module_dll: DLL path is : /home/dariush/workspace/AxisCtest2/home/mo= dules/logging/libaxis2_mod_log.so > [Fri Aug 3 21:52:08 2007] [debug] class_loader.c(135) Object loaded su= ccessfully > [Fri Aug 3 21:52:08 2007] [debug] dep_engine.c(1042) axis2_dep_engine_= load_module_dll: DLL path is : /home/dariush/workspace/AxisCtest2/home/mo= dules/rampart/libmod_rampart.so > [Fri Aug 3 21:52:08 2007] [debug] class_loader.c(135) Object loaded su= ccessfully > [Fri Aug 3 21:52:08 2007] [debug] phase_holder.c(129) Add handler Ramp= artInHandler to phase PreDispatch > [Fri Aug 3 21:52:08 2007] [info] [rampart][mod_rampart] mod_rampart i= nitialized > [Fri Aug 3 21:52:08 2007] [debug] phase_resolver.c(117) Service name i= s : __ANONYMOUS_SERVICE__ > [Fri Aug 3 21:52:08 2007] [debug] phase_resolver.c(231) module name is= :rampart > [Fri Aug 3 21:52:08 2007] [debug] phase_resolver.c(324) This handler i= s trying to added to system pre defined phases , but those handlers are a= lready added to global chain which run irrespective of the service > [Fri Aug 3 21:52:08 2007] [debug] phase_resolver.c(231) module name is= :rampart > [Fri Aug 3 21:52:08 2007] [debug] phase_holder.c(129) Add handler Ramp= artOutHandler to phase MessageOut > [Fri Aug 3 21:52:08 2007] [debug] phase_resolver.c(231) module name is= :rampart > [Fri Aug 3 21:52:08 2007] [debug] phase_resolver.c(231) module name is= :rampart > [Fri Aug 3 21:52:08 2007] [debug] phase_holder.c(129) Add handler Ramp= artOutHandler to phase MessageOut > [Fri Aug 3 21:52:08 2007] [debug] phase_resolver.c(231) module name is= :rampart > [Fri Aug 3 21:52:08 2007] [debug] phase_resolver.c(324) This handler i= s trying to added to system pre defined phases , but those handlers are a= lready added to global chain which run irrespective of the service > [Fri Aug 3 21:52:08 2007] [debug] phase_resolver.c(231) module name is= :rampart > [Fri Aug 3 21:52:08 2007] [debug] phase_holder.c(129) Add handler Ramp= artOutHandler to phase MessageOut > [Fri Aug 3 21:52:08 2007] [debug] phase_resolver.c(231) module name is= :rampart > [Fri Aug 3 21:52:08 2007] [debug] phase_resolver.c(231) module name is= :rampart > [Fri Aug 3 21:52:08 2007] [debug] phase_holder.c(129) Add handler Ramp= artOutHandler to phase MessageOut > [Fri Aug 3 21:52:08 2007] [debug] phase_resolver.c(231) module name is= :rampart > [Fri Aug 3 21:52:08 2007] [debug] phase_resolver.c(324) This handler i= s trying to added to system pre defined phases , but those handlers are a= lready added to global chain which run irrespective of the service > [Fri Aug 3 21:52:08 2007] [debug] phase_resolver.c(231) module name is= :rampart > [Fri Aug 3 21:52:08 2007] [debug] phase_holder.c(129) Add handler Ramp= artOutHandler to phase MessageOut > [Fri Aug 3 21:52:08 2007] [debug] phase_resolver.c(231) module name is= :rampart > [Fri Aug 3 21:52:08 2007] [debug] phase_resolver.c(231) module name is= :rampart > [Fri Aug 3 21:52:08 2007] [debug] phase_holder.c(129) Add handler Ramp= artOutHandler to phase MessageOut > [Fri Aug 3 21:52:08 2007] [debug] engine.c(575) Invoking phase Message= Out > [Fri Aug 3 21:52:08 2007] [debug] phase.c(195) Invoke the handler Ramp= artOutHandler within the phase MessageOut > [Fri Aug 3 21:52:08 2007] [info] [rampart][rampart_handler_utils] (nu= ll) parameter is not set. > [Fri Aug 3 21:52:08 2007] [debug] rampart_util.c(53) [rampart][rampart= _util] Trying to load module =3D /usr/local/axis2c/bin/samples/rampart/ca= llback/libpwcb.so > [Fri Aug 3 21:52:08 2007] [debug] class_loader.c(135) Object loaded su= ccessfully > [Fri Aug 3 21:52:08 2007] [info] [rampart][shb] building Timestamp T= oken > [Fri Aug 3 21:52:08 2007] [info] [rampart][shb] Using default timeTo= Live value 300 > [Fri Aug 3 21:52:08 2007] [info] [rampart][rampart_context] No Signed= parts specified. Using the body. > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Secur= ity for Timestamp > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Times= tamp for Timestamp > [Fri Aug 3 21:52:08 2007] [info] [rampart][rampart_util] Password tak= en from the callback module . SUCCESS > [Fri Aug 3 21:52:08 2007] [info] [rampart][c14n-OutPut] is > > > > > [Fri Aug 3 21:52:08 2007] [info] [rampart][c14n-OutPut] is > > 2007-08-03T19:52:08.269Z2007-= 08-03T19:58:08.269Z > > > [Fri Aug 3 21:52:08 2007] [info] [oxs][xml_sig] C14N (sig)=3D Y/RfvBEMACnPbPDl8RCbOiVdPKo=3DbRiadT/dswEBTVb72JD= hpjzBgiI=3D=20 > [Fri Aug 3 21:52:08 2007] [info] [openssl][sig] Signing content Y/RfvBEMACnPbPDl8RCbOiVdPKo=3DbRiadT/dswEBTVb= 72JDhpjzBgiI=3D > [Fri Aug 3 21:52:08 2007] [info] [rampart][rampart_encryption] No par= ts specified or specified parts can't be found for encryprion. > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Secur= ity for Signature > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Times= tamp for Signature > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Creat= ed for Signature > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Expir= es for Signature > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Signa= ture for Signature > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Secur= ity for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Times= tamp for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Creat= ed for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Expir= es for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Signa= ture for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Signe= dInfo for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Canon= icalizationMethod for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Signa= tureMethod for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Refer= ence for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Trans= forms for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Trans= form for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Diges= tMethod for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Diges= tValue for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Refer= ence for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Trans= forms for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Trans= form for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Diges= tMethod for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Diges= tValue for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Signa= tureValue for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node KeyIn= fo for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node Secur= ityTokenReference for EncryptedKey > [Fri Aug 3 21:52:08 2007] [info] [rampart][axiom] Checking node KeyId= entifier for EncryptedKey > [Fri Aug 3 21:52:08 2007] [debug] http_transport_sender.c(566) OP name= axutil_qname_get_localpart =3D http://www.w3.org/2004/08/wsdl/out-in > [Fri Aug 3 21:52:08 2007] [debug] soap_builder.c(737) Identified soap = version is soap11 > [Fri Aug 3 21:52:08 2007] [debug] engine.c(179) Axis2 engine send succ= essful > [Fri Aug 3 21:52:08 2007] [debug] engine.c(575) Invoking phase Transpo= rt > [Fri Aug 3 21:52:08 2007] [debug] phase.c(195) Invoke the handler requ= est_uri_based_dispatcher within the phase Transport > [Fri Aug 3 21:52:08 2007] [debug] phase.c(195) Invoke the handler addr= essing_based_dispatcher within the phase Transport > [Fri Aug 3 21:52:08 2007] [debug] engine.c(575) Invoking phase PreDisp= atch > [Fri Aug 3 21:52:08 2007] [debug] phase.c(195) Invoke the handler Ramp= artInHandler within the phase PreDispatch > [Fri Aug 3 21:52:08 2007] [info] [rampart][rampart_in_handler] No sec= urity header element. > [Fri Aug 3 21:52:08 2007] [debug] engine.c(292) Axis2 engine receive c= ompleted! > > =20 > -----------------------------------------------------------------------= - > > > /** > * adb_getPosixUserByName.h > * > * This file was auto-generated from WSDL > * by the Apache Axis2/C version: SNAPSHOT Built on : Jul 23, 2= 007 (02:24:43 GMT+00:00) > * > */ > > #include "adb_getPosixUserByName.h" > =20 > /** > * implmentation of the getPosixUserByName|urn:WSAuth ele= ment > */ > =20 > > > struct adb_getPosixUserByName > { > =20 > axutil_qname_t* qname; > =20 > adb_getPosixUserByName_t_t* attrib_getPosix= UserByName; > =20 > }; > > > /************************* Function Implmentations *************= *******************/ > AXIS2_EXTERN adb_getPosixUserByName_t* AXIS2_CALL > adb_getPosixUserByName_create( > const axutil_env_t *env ) > { > adb_getPosixUserByName_t *_getPosixUserByName =3D NULL; > =20 > axutil_qname_t* qname =3D NULL; > =20 > AXIS2_ENV_CHECK(env, NULL); > > _getPosixUserByName =3D (adb_getPosixUserByName_t *) AXIS2_= MALLOC(env-> > allocator, sizeof(adb_getPosixUserByName_t)); > > if(NULL =3D=3D _getPosixUserByName) > { > AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS= 2_FAILURE); > return NULL; > } > > _getPosixUserByName->attrib_getPosixUserByName =3D NULL; > =20 > qname =3D axutil_qname_create (env, > "getPosixUserByName", > "urn:WSAuth", > "ns1"); > > _getPosixUserByName->qname =3D qname; > =20 > > return _getPosixUserByName; > } > > axis2_status_t AXIS2_CALL > adb_getPosixUserByName_free ( > adb_getPosixUserByName_t* _getPosixUserByName, > const axutil_env_t *env) > { > =20 > =20 > > AXIS2_ENV_CHECK(env, AXIS2_FAILURE); > > =20 > if( _getPosixUserByName->attrib_getPosixUserByName !=3D N= ULL) > { > =20 > =20 > adb_getPosixUserByName_t_free( _getPosixUserByNam= e->attrib_getPosixUserByName, env); > _getPosixUserByName->attrib_getPosixUserByName =3D N= ULL; > } > > =20 > if(_getPosixUserByName->qname ) > { > axutil_qname_free (_getPosixUserByName->qname, env); > _getPosixUserByName->qname =3D NULL; > } > =20 > > if(_getPosixUserByName) > { > AXIS2_FREE( env->allocator, _getPosixUserByName); > _getPosixUserByName =3D NULL; > } > return AXIS2_SUCCESS; > } > > =20 > axutil_qname_t* AXIS2_CALL > adb_getPosixUserByName_get_qname ( > adb_getPosixUserByName_t* _getPosixUserByName, > const axutil_env_t *env) > { > AXIS2_ENV_CHECK(env, AXIS2_FAILURE); > > return _getPosixUserByName-> qname; > } > =20 > > axis2_status_t AXIS2_CALL > adb_getPosixUserByName_deserialize( > adb_getPosixUserByName_t* _getPosixUserByName, > const axutil_env_t *env, > axiom_node_t* parent) > { > > axis2_status_t status =3D AXIS2_SUCCESS; > axiom_namespace_t *ns1 =3D NULL; > =20 > void *element =3D NULL; > =20 > axis2_char_t* text_value =3D NULL; > axutil_qname_t *qname =3D NULL; > =20 > =20 > axutil_qname_t *element_qname =3D NULL; > =20 > axiom_node_t *first_node =3D NULL; > =20 > =20 > axiom_node_t *current_node =3D NULL; > axiom_element_t *current_element =3D NULL; > =20 > AXIS2_ENV_CHECK(env, AXIS2_FAILURE); > > ns1 =3D axiom_namespace_create (env, > "urn:WSAuth", > "ns1"); > =20 > if ( NULL =3D=3D parent ) > { > /** This should be checked above */ > AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL elemenet = for getPosixUserByName" > " %d :: %s", env->error->= error_number, > AXIS2_ERROR_GET_MESSAGE(e= nv->error)); > return AXIS2_FAILURE; > } > =20 > current_element =3D axiom_node_get_data_element( pa= rent, env); > qname =3D axiom_element_get_qname( current_element,= env, parent); > if ( axutil_qname_equals( qname, env, _getPosixUser= ByName-> qname ) ) > { > first_node =3D axiom_node_get_first_child( pare= nt, env); > } > else > { > first_node =3D parent; > } > =20 > =20 > =20 > /** > * building getPosixUserByName element > */ > =20 > =20 > =20 > /** > * because elements are not ordered= we should surf all the sibling to pick the right one > */ > for ( current_node =3D first_node; curre= nt_node !=3D NULL; > current_node =3D axiom_nod= e_get_next_sibling( current_node, env)) > { > current_element =3D axiom_node_get_da= ta_element( current_node, env); > qname =3D axiom_element_get_qname( cu= rrent_element, env, current_node); > element_qname =3D axutil_qname_create= ( env, "getPosixUserByName", "urn:WSAuth", "ns1"); > if ( axutil_qname_equals( element_qna= me, env, qname)) > { > /** found the requried element *= / > break; > } > } > =20 > if ( current_node !=3D NULL) > { > =20 > element =3D (void*)adb_getPosixUs= erByName_t_create( env); > status =3D adb_getPosixUserByNam= e_t_deserialize( (=20 > adb_getPosixUserByName_t_t*)element, env, > = axiom_node_get_first_child(current_node, env)=3D=3DNULL?current_nod= e:axiom_node_get_first_child(current_node, env)); > if( AXIS2_FAILURE =3D=3D status)= > { > AXIS2_LOG_ERROR(env->log, AXI= S2_LOG_SI, "failed in building element getPosixUserByName " > " %d :: %= s", env->error->error_number, > AXIS2_ERR= OR_GET_MESSAGE(env->error)); > return AXIS2_FAILURE; > } > status =3D adb_getPosixUserByName= _set_getPosixUserByName( _getPosixUserByName, env, > (=20 > adb_getPosixUserByName_t_t*)element); > =20 > if( AXIS2_FAILURE =3D=3D status) > { > AXIS2_LOG_ERROR(env->log, AXIS2_LO= G_SI, "failed in setting the value for getPosixUserByName " > " %d :: %s", e= nv->error->error_number, > AXIS2_ERROR_GE= T_MESSAGE(env->error)); > return AXIS2_FAILURE; > } > } > =20 > else > { > /** this is not a nillable element*/= > AXIS2_LOG_ERROR(env->log, AXIS2_LOG_= SI, "non nillable or minOuccrs !=3D 0 element getPosixUserByName missing"= > " %d :: %s", e= nv->error->error_number, > AXIS2_ERROR_GE= T_MESSAGE(env->error)); > return AXIS2_FAILURE; > } > =20 > > return status; > } > > axiom_node_t* AXIS2_CALL > adb_getPosixUserByName_serialize( > adb_getPosixUserByName_t* _getPosixUserByName, > const axutil_env_t *env, axiom_node_t* parent, int has_= parent) > { > =20 > axiom_namespace_t *ns1 =3D NULL; > =20 > axis2_char_t text_value_1[64]; > =20 > axiom_node_t *current_node =3D NULL; > axiom_element_t *current_element =3D NULL; > axiom_data_source_t *data_source =3D NULL; > axutil_stream_t *stream =3D NULL; > axis2_char_t *start_input_str =3D NULL; > axis2_char_t *end_input_str =3D NULL; > unsigned int start_input_str_len =3D 0; > unsigned int end_input_str_len =3D 0; > =20 > AXIS2_ENV_CHECK(env, NULL); > > ns1 =3D axiom_namespace_create (env, > "urn:WSAuth", > "ns1"); > =20 > if( parent =3D=3D NULL) > { > current_element =3D axiom_element_create (env, pare= nt, "getPosixUserByName", ns1 , ¤t_node); > axiom_element_set_namespace( current_element, env, = ns1, current_node); > =20 > parent =3D current_node; > } > =20 > if(has_parent) > { > data_source =3D axiom_node_get_data_element(parent,= env); > if (!data_source) > return NULL; > stream =3D axiom_data_source_get_stream(data_source= , env); /* assume parent is of type data source */ > if (!stream) > return NULL; > current_node =3D parent; > } > else > { > data_source =3D axiom_data_source_create(env, paren= t, ¤t_node); > stream =3D axiom_data_source_get_stream(data_source= , env); > } > =20 > =20 > /** > * parsing getPosixUserByName element > */ > =20 > > =20 > =20 > start_input_str =3D "";= > start_input_str_len =3D axutil_strlen(start_inp= ut_str); > end_input_str =3D ""; > end_input_str_len =3D axutil_strlen(end_input_s= tr); > =20 > if(has_parent) > axutil_stream_write(stream, env, start_= input_str, start_input_str_len); > adb_getPosixUserByName_t_serialize( _getPos= ixUserByName->attrib_getPosixUserByName, env, current_node, AXIS2_TRUE); > if(has_parent) > axutil_stream_write(stream, env, end_in= put_str, end_input_str_len); > =20 > return parent; > } > > =20 > > /** > * getter for getPosixUserByName. > */ > =20 > adb_getPosixUserByName_t_t* AXIS2_CALL > adb_getPosixUserByName_get_getPosixUserByName( > adb_getPosixUserByName_t* _getPosixUserByName, > const axutil_env_t *env) > { > AXIS2_ENV_CHECK(env, AXIS2_FAILURE); > > return _getPosixUserByName-> attrib_getPosixUserByName;= > } > > /** > * setter for getPosixUserByName > */ > axis2_status_t AXIS2_CALL > adb_getPosixUserByName_set_getPosixUserByName( > adb_getPosixUserByName_t* _getPosixUserByName, > const axutil_env_t *env, > =20 > adb_getPosixUserByName_t_t* param_getPosixUserByNa= me) > { > =20 > > AXIS2_ENV_CHECK(env, AXIS2_FAILURE); > if(!_getPosixUserByName) > { > return AXIS2_FAILURE; > } > > =20 > if( NULL =3D=3D param_getPosixUserByName ) > { > AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "getPosix= UserByName is NULL, but not a nullable element" > " %d :: %s", env->erro= r->error_number, > AXIS2_ERROR_GET_MESSAG= E(env->error)); > return AXIS2_FAILURE; > } > _getPosixUserByName-> attrib_getPosixUserByName =3D par= am_getPosixUserByName; > return AXIS2_SUCCESS; > } > > =20 > > > =20 > -----------------------------------------------------------------------= - > > > /** > * adb_getPosixUserByName_t.h > * > * This file was auto-generated from WSDL > * by the Apache Axis2/C version: SNAPSHOT Built on : Jul 23, 2= 007 (02:24:43 GMT+00:00) > * > */ > > #include "adb_getPosixUserByName_t.h" > =20 > /** > * This type was generated from the piece of schema that = had > * name =3D getPosixUserByName_t > * Namespace URI =3D urn:WSAuth > * Namespace Prefix =3D ns1 > */ > =20 > > > struct adb_getPosixUserByName_t > { > axis2_char_t* attrib_username; > =20 > }; > > > /************************* Function Implmentations *************= *******************/ > AXIS2_EXTERN adb_getPosixUserByName_t_t* AXIS2_CALL > adb_getPosixUserByName_t_create( > const axutil_env_t *env ) > { > adb_getPosixUserByName_t_t *_getPosixUserByName_t =3D NULL;= > =20 > AXIS2_ENV_CHECK(env, NULL); > > _getPosixUserByName_t =3D (adb_getPosixUserByName_t_t *) AX= IS2_MALLOC(env-> > allocator, sizeof(adb_getPosixUserByName_t_t)); > > if(NULL =3D=3D _getPosixUserByName_t) > { > AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS= 2_FAILURE); > return NULL; > } > > =20 > > return _getPosixUserByName_t; > } > > axis2_status_t AXIS2_CALL > adb_getPosixUserByName_t_free ( > adb_getPosixUserByName_t_t* _getPosixUserByName_t, > const axutil_env_t *env) > { > =20 > =20 > > AXIS2_ENV_CHECK(env, AXIS2_FAILURE); > > =20 > > if(_getPosixUserByName_t) > { > AXIS2_FREE( env->allocator, _getPosixUserByName_t); > _getPosixUserByName_t =3D NULL; > } > return AXIS2_SUCCESS; > } > > =20 > > axis2_status_t AXIS2_CALL > adb_getPosixUserByName_t_deserialize( > adb_getPosixUserByName_t_t* _getPosixUserByName_t, > const axutil_env_t *env, > axiom_node_t* parent) > { > > axis2_status_t status =3D AXIS2_SUCCESS; > axiom_namespace_t *ns1 =3D NULL; > =20 > axis2_char_t* text_value =3D NULL; > axutil_qname_t *qname =3D NULL; > =20 > =20 > axiom_node_t *first_node =3D NULL; > =20 > =20 > axiom_node_t *current_node =3D NULL; > axiom_element_t *current_element =3D NULL; > =20 > AXIS2_ENV_CHECK(env, AXIS2_FAILURE); > > ns1 =3D axiom_namespace_create (env, > "urn:WSAuth", > "ns1"); > =20 > if ( NULL =3D=3D parent ) > { > /** This should be checked above */ > AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL elemenet = for getPosixUserByName_t" > " %d :: %s", env->error->= error_number, > AXIS2_ERROR_GET_MESSAGE(e= nv->error)); > return AXIS2_FAILURE; > } > =20 > first_node =3D parent; > =20 > > =20 > /** > * building username element > */ > =20 > =20 > =20 > current_node =3D first_node; > =20 > if ( current_node !=3D NULL) > { > current_element =3D axiom_node_get_data_e= lement( current_node, env); > text_value =3D axiom_element_get_= text(current_element, env, current_node ); > status =3D adb_getPosixUserByName= _t_set_username( _getPosixUserByName_t, env, > text= _value); > =20 > if( AXIS2_FAILURE =3D=3D status) > { > AXIS2_LOG_ERROR(env->log, AXIS2_LO= G_SI, "failed in setting the value for username " > " %d :: %s", e= nv->error->error_number, > AXIS2_ERROR_GE= T_MESSAGE(env->error)); > return AXIS2_FAILURE; > } > } > =20 > else > { > /** this is not a nillable element*/= > AXIS2_LOG_ERROR(env->log, AXIS2_LOG_= SI, "non nillable or minOuccrs !=3D 0 element username missing" > " %d :: %s", e= nv->error->error_number, > AXIS2_ERROR_GE= T_MESSAGE(env->error)); > return AXIS2_FAILURE; > } > =20 > > return status; > } > > axiom_node_t* AXIS2_CALL > adb_getPosixUserByName_t_serialize( > adb_getPosixUserByName_t_t* _getPosixUserByName_t, > const axutil_env_t *env, axiom_node_t* parent, int has_= parent) > { > =20 > axiom_namespace_t *ns1 =3D NULL; > =20 > axis2_char_t *text_value_1; > =20 > axiom_node_t *current_node =3D NULL; > axiom_element_t *current_element =3D NULL; > axiom_data_source_t *data_source =3D NULL; > axutil_stream_t *stream =3D NULL; > axis2_char_t *start_input_str =3D NULL; > axis2_char_t *end_input_str =3D NULL; > unsigned int start_input_str_len =3D 0; > unsigned int end_input_str_len =3D 0; > =20 > AXIS2_ENV_CHECK(env, NULL); > > ns1 =3D axiom_namespace_create (env, > "urn:WSAuth", > "ns1"); > =20 > if(has_parent) > { > data_source =3D axiom_node_get_data_element(parent,= env); > if (!data_source) > return NULL; > stream =3D axiom_data_source_get_stream(data_source= , env); /* assume parent is of type data source */ > if (!stream) > return NULL; > current_node =3D parent; > } > else > { > data_source =3D axiom_data_source_create(env, paren= t, ¤t_node); > stream =3D axiom_data_source_get_stream(data_source= , env); > } > =20 > =20 > /** > * parsing username element > */ > =20 > > =20 > =20 > start_input_str =3D ""; > start_input_str_len =3D axutil_strlen(start_inp= ut_str); > end_input_str =3D ""; > end_input_str_len =3D axutil_strlen(end_input_s= tr); > =20 > text_value_1 =3D _getPosixUserByName_t->attr= ib_username; > axutil_stream_write(stream, env, start_input= _str, start_input_str_len); > axutil_stream_write(stream, env, text_value_= 1, axutil_strlen(text_value_1)); > axutil_stream_write(stream, env, end_input_s= tr, end_input_str_len); > =20 > return parent; > } > > =20 > > /** > * getter for username. > */ > axis2_char_t* AXIS2_CALL > adb_getPosixUserByName_t_get_username( > adb_getPosixUserByName_t_t* _getPosixUserByName_t, > const axutil_env_t *env) > { > AXIS2_ENV_CHECK(env, AXIS2_FAILURE); > > return _getPosixUserByName_t-> attrib_username; > } > > /** > * setter for username > */ > axis2_status_t AXIS2_CALL > adb_getPosixUserByName_t_set_username( > adb_getPosixUserByName_t_t* _getPosixUserByName_t, > const axutil_env_t *env, > axis2_char_t* param_username) > { > =20 > > AXIS2_ENV_CHECK(env, AXIS2_FAILURE); > if(!_getPosixUserByName_t) > { > return AXIS2_FAILURE; > } > > =20 > if( NULL =3D=3D param_username ) > { > AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "username= is NULL, but not a nullable element" > " %d :: %s", env->erro= r->error_number, > AXIS2_ERROR_GET_MESSAG= E(env->error)); > return AXIS2_FAILURE; > } > _getPosixUserByName_t-> attrib_username =3D param_usern= ame; > return AXIS2_SUCCESS; > } > > =20 > > > =20 > -----------------------------------------------------------------------= - > > > /** > * axis2_stub_WSAuthService.c > * > * This file was auto-generated from WSDL for "WSAuthService|urn:WSAuth= " service > * by the Apache Axis2/C version: SNAPSHOT Built on : Jul 23, 2007 (02= :24:29 GMT+00:00) > */ > > #include "axis2_stub_WSAuthService.h" > > /** > * axis2_stub_WSAuthService C implementation > */ > > axis2_stub_t*axis2_stub_WSAuthService_create(const axutil_env_t *env, > axis2_char_t *client_home, axis2_char_t *endpoint_uri) { > axis2_stub_t *stub=3D NULL; > axis2_endpoint_ref_t *endpoint_ref=3D NULL; > AXIS2_FUNC_PARAM_CHECK ( client_home, env, NULL) > > if (NULL =3D=3D endpoint_uri) { > endpoint_uri > =3D axis2_stub_WSAuthService_get_endpoint_uri_from_wsdl(env ); > } > > endpoint_ref =3D axis2_endpoint_ref_create(env, endpoint_uri); > > stub =3D axis2_stub_create_with_endpoint_ref_and_client_home (env, > endpoint_ref, client_home ); > axis2_stub_WSAuthService_populate_services(stub, env ); > return stub; > } > > void axis2_stub_WSAuthService_populate_services(axis2_stub_t *stub, > const axutil_env_t *env) { > axis2_svc_client_t *svc_client=3D NULL; > axutil_qname_t *svc_qname=3D NULL; > axutil_qname_t *op_qname=3D NULL; > axis2_svc_t *svc=3D NULL; > axis2_op_t *op=3D NULL; > =09 > axis2_phases_info_t *info =3D NULL; > axis2_svc_ctx_t *svc_ctx =3D NULL; > axis2_conf_ctx_t *conf_ctx =3D NULL; > axis2_conf_t *conf =3D NULL; > > > > /* Modifying the Service */ > svc_client =3D axis2_stub_get_svc_client (stub, env ); > svc =3D (axis2_svc_t*)axis2_svc_client_get_svc(svc_client, env ); > > /* Hotfix, from the mailing list */ > svc_ctx =3D axis2_svc_client_get_svc_ctx(svc_client, env); > conf_ctx =3D axis2_svc_ctx_get_conf_ctx(svc_ctx, env); > conf =3D axis2_conf_ctx_get_conf(conf_ctx, env); > info =3D axis2_conf_get_phases_info(conf, env); > =09 > axutil_qname_create(env, "WSAuthService", NULL, NULL); > axis2_svc_set_qname (svc, env, svc_qname); > > /* creating the operations*/ > > /* [...] (other ops) */ > > op_qname =3D axutil_qname_create(env, "getPosixUserByName", "urn:WSAut= h",=20 > NULL); > op =3D axis2_op_create_with_qname(env, op_qname); > > axis2_op_set_msg_exchange_pattern(op, env, AXIS2_MEP_URI_OUT_IN); > > axis2_phases_info_set_op_phases(info, env, op); > > axis2_svc_add_op(svc, env, op); > > /* [...] (other ops) */ > > } > > /** > *return end point picked from wsdl > */ > axis2_char_t*axis2_stub_WSAuthService_get_endpoint_uri_from_wsdl( > const axutil_env_t *env) { > axis2_char_t *endpoint_uri=3D NULL; > /* set the address from here */ > > endpoint_uri =3D "http://localhost:8080/axis2/services/WSAuth"; > > return endpoint_uri; > } > > > /** > * auto generated method signature > * for "getPosixUserByName|urn:WSAuth" operation. > * @param getPosixUserByName > * @return > */ > > adb_PosixUser_t* axis2_stub_WSAuthService_getPosixUserByName( > axis2_stub_t *stub, const axutil_env_t *env, > axis2_char_t *param_username) { > axis2_svc_client_t *svc_client=3D NULL; > axis2_options_t *options=3D NULL; > axiom_node_t *ret_node=3D NULL; > > const axis2_char_t *soap_action=3D NULL; > axutil_qname_t *op_qname=3D NULL; > axiom_node_t *payload=3D NULL; > > const axutil_string_t *soap_act=3D NULL; > > adb_getPosixUserByNameResponse_t* ret_val=3D NULL; > > > /* Wrapping */ > adb_getPosixUserByName_t_t *getPosixUserByName_t =3D adb_getPosixUserB= yName_t_create(env); > adb_getPosixUserByName_t_set_username(getPosixUserByName_t, env, param= _username); > adb_getPosixUserByName_t *getPosixUserByName =3D adb_getPosixUserByNam= e_create(env); > adb_getPosixUserByName_set_getPosixUserByName(getPosixUserByName, env,= getPosixUserByName_t); > > payload =3D adb_getPosixUserByName_serialize(getPosixUserByName, env, = NULL, > AXIS2_FALSE); > > options =3D axis2_stub_get_options(stub, env); > if ( NULL =3D=3D options) { > AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "options is null in stub: Err= or code:" > " %d :: %s", env->error->error_number, > AXIS2_ERROR_GET_MESSAGE(env->error)); > return NULL; > } > svc_client =3D axis2_stub_get_svc_client(stub, env ); > soap_action =3D axis2_options_get_action(options, env ); > if ( NULL =3D=3D soap_action) { > soap_action =3D "urn:WSAuth"; > > soap_act =3D axutil_string_create(env, "urn:WSAuth"); > axis2_options_set_soap_action(options, env, soap_act); > > axis2_options_set_action(options, env, soap_action ); > } > > axis2_options_set_soap_version(options, env, AXIOM_SOAP11 ); > > op_qname =3D axutil_qname_create(env, "getPosixUserByName", "urn:WSAut= h",=20 > NULL); > ret_node =3D axis2_svc_client_send_receive_with_op_qname(svc_client, e= nv, > op_qname, payload); > > if ( NULL =3D=3D ret_node) { > return NULL; > } > ret_val =3D adb_getPosixUserByNameResponse_create(env); > > adb_getPosixUserByNameResponse_deserialize(ret_val, env, ret_node ); > =09 > /* Unwrapping */ > if (ret_val) > { > > adb_getPosixUserByNameResponse_t_t *ret_val_unwrap =3D adb_get= PosixUserByNameResponse_get_getPosixUserByNameResponse(ret_val, env); > > if (ret_val_unwrap)=20 > {=09 > adb_PosixUser_t *user =3D adb_getPosixUserByNameResponse_t_get_us= er(ret_val_unwrap, env); > > return user; > } > } > =09 > return NULL; > > } > > > /* [...] */ > > > =20 > -----------------------------------------------------------------------= - > > --------------------------------------------------------------------- > To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org > For additional commands, e-mail: axis-c-user-help@ws.apache.org --=20 http://kaushalye.blogspot.com/ http://wso2.org/ --------------------------------------------------------------------- To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org For additional commands, e-mail: axis-c-user-help@ws.apache.org