Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 57306 invoked from network); 17 May 2007 09:13:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 May 2007 09:13:19 -0000 Received: (qmail 42046 invoked by uid 500); 17 May 2007 09:13:13 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 42025 invoked by uid 500); 17 May 2007 09:13:13 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 42013 invoked by uid 99); 17 May 2007 09:13:13 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2007 02:13:12 -0700 X-ASF-Spam-Status: No, hits=0.9 required=10.0 tests=URI_SCHEME_MIXED_CASE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [213.183.109.5] (HELO internal.tvs.tomsk.ru) (213.183.109.5) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2007 02:13:00 -0700 Received: by internal.tvs.tomsk.ru (Postfix, from userid 65534) id F243AAF54E; Thu, 17 May 2007 16:13:11 +0700 (NOVST) X-Spam-Checker-Version: SpamAssassin 3.1.3-gr0 (2006-06-01) on internal.tvs.tomsk.ru X-Spam-Level: Received: from [83.172.10.71] (unknown [83.172.10.71]) by internal.tvs.tomsk.ru (Postfix) with ESMTP id 37BF2386B3 for ; Thu, 17 May 2007 16:13:11 +0700 (NOVST) Message-ID: <464C1E32.8090904@tvsystem.ru> Date: Thu, 17 May 2007 16:19:46 +0700 From: Mikhail Maroukhine User-Agent: Thunderbird 1.5.0.9 (X11/20070109) MIME-Version: 1.0 To: axis-user@ws.apache.org Subject: Re: Axis2 + rampart + other web service platform References: <464A6FA3.1070503@tvsystem.ru> <88f5d710705152245o5dde1e70m4436becabdec7079@mail.gmail.com> <464ABB66.9060708@tvsystem.ru> <88f5d710705170020t24185b06xb51fc2b69df2f022@mail.gmail.com> In-Reply-To: <88f5d710705170020t24185b06xb51fc2b69df2f022@mail.gmail.com> Content-Type: multipart/mixed; boundary="------------010205010801030205020804" X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-99.1 required=5.0 tests=URI_SCHEME_MIXED_CASE, USER_IN_WHITELIST autolearn=no version=3.1.3-gr0 --------------010205010801030205020804 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello Paul, I still could not do this :) I got an error showed below. I suppose that something wrong with policy files... but I could not realize what is exactly wrong because I'm new in this area. I attached policy files and client and it will be good if you look there. PolicyCache.xml - policy file from workable .net client rampart.policy - contains configuration for the rampart Client.java - test code for the web service Error: [mikolg@localhost classes]$ /home/mikolg/job/axis2/axis2-1.1/bin/axis2.sh org.tempuri.Client Using AXIS2_HOME: /home/mikolg/job/axis2/axis2-1.1 Using JAVA_HOME: /etc/alternatives/java_sdk_1.5.0 17.05.2007 16:03:25 org.apache.axis2.deployment.DeploymentEngine doDeploy INFO: Deploying module : soapmonitor-1.1 17.05.2007 16:03:25 org.apache.axis2.deployment.DeploymentEngine doDeploy INFO: Deploying module : addressing-1.1 17.05.2007 16:03:26 org.apache.axis2.deployment.DeploymentEngine doDeploy INFO: Deploying module : rahas-1.1 17.05.2007 16:03:27 org.apache.axis2.deployment.DeploymentEngine doDeploy INFO: Deploying module : rampart-1.1 17.05.2007 16:03:27 org.apache.axis2.deployment.DeploymentEngine doDeploy INFO: Deploying Web service version.aar Unknown top level PED found: org.apache.neethi.builders.xml.XmlPrimtiveAssertion Unknown top level PED found: org.apache.neethi.builders.xml.XmlPrimtiveAssertion Unknown top level PED found: org.apache.neethi.builders.xml.XmlPrimtiveAssertion Unknown top level PED found: org.apache.neethi.builders.xml.XmlPrimtiveAssertion Exception in thread "main" java.lang.NullPointerException at org.apache.rampart.util.RampartUtil.addWsuIdToElement(RampartUtil.java:463) at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:277) at org.apache.rampart.builder.AsymmetricBindingBuilder.build(AsymmetricBindingBuilder.java:85) at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:129) at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:59) at org.apache.axis2.engine.Phase.invoke(Phase.java:381) at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:518) at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:651) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:365) at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:295) at org.tempuri.JobStub.ListJobAreas(JobStub.java:185) at org.tempuri.Client.main(Client.java:44) Paul Fremantle wrote: > Let me know if it works. > > Paul > > On 5/16/07, Mikhail Maroukhine wrote: >> Thanks Paul >> >> I'll try to do it in this way... >> >> Paul Fremantle wrote: >> > Mikhail >> > >> > Yes I have experience of doing this. The latest Axis2 1.2 release will >> > embed the policy into the code-generated stub and attempt to engage >> > Rampart with that policy. >> > >> > Alternatively you can explicitly set the policy using: >> > >> > StAXOMBuilder builder = new StAXOMBuilder(xmlPath); >> > Policy policy = PolicyEngine.getPolicy(builder.getDocumentElement()); >> > >> stub._getServiceClient().getOptions().setProperty(RampartMessageData.KEY_RAMPART_POLICY, >> >> > >> > policy); >> > >> > In general you also need to configure Rampart with information like >> > passwords etc. >> > >> > You do this using another policy file like this: >> > >> > >> > 303 >> > me >> > PWCallback >> > ,,, >> > >> > >> > You can merge the two policies first - so: >> > >> > StAXOMBuilder builder = new StAXOMBuilder(dotnetPolicy); >> > Policy dotnetPolicy = >> > PolicyEngine.getPolicy(builder.getDocumentElement()); >> > StAXOMBuilder builder2 = new StAXOMBuilder(rampartPolicy); >> > Policy rampartPolicy = >> > PolicyEngine.getPolicy(builder.getDocumentElement()); >> > Policy policy = dotnetPolicy.merge(rampartPolicy); >> > >> > And then set it onto the stub or service client as above. >> > >> > Paul >> > >> >> -- >> WBR, >> Mikhail >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org >> For additional commands, e-mail: axis-user-help@ws.apache.org >> >> > > -- WBR, Mikhail --------------010205010801030205020804 Content-Type: text/x-java; name="Client.java" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Client.java" package org.tempuri; import org.apache.axiom.om.OMAbstractFactory; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMFactory; import org.apache.axiom.om.OMNamespace; import org.apache.axiom.om.impl.builder.StAXOMBuilder; import org.apache.axis2.Constants; import org.apache.axis2.addressing.EndpointReference; import org.apache.axis2.client.Options; import org.apache.axis2.client.ServiceClient; import org.apache.axis2.context.ConfigurationContext; import org.apache.axis2.context.ConfigurationContextFactory; import org.apache.neethi.Policy; import org.apache.neethi.PolicyEngine; import org.apache.rampart.RampartMessageData; public class Client { private static String dotnetPolicy = "/home/mikolg/job/axis2/axis2-1.1/samples/rt/PolicyCache.xml"; private static String rampartPolicy = "/home/mikolg/job/axis2/axis2-1.1/samples/rt/rampart.policy"; public static void main(String[] args) throws Exception { JobStub s = new JobStub("http://xxx/WSWrapper/Job.asmx"); StAXOMBuilder builder = new StAXOMBuilder(dotnetPolicy); Policy dotnetPolicy = PolicyEngine.getPolicy(builder.getDocumentElement()); StAXOMBuilder builder2 = new StAXOMBuilder(rampartPolicy); Policy p1 = PolicyEngine.getPolicy(builder.getDocumentElement()); Policy policy = dotnetPolicy.merge(p1); s._getServiceClient().getOptions().setProperty(RampartMessageData.KEY_RAMPART_POLICY,policy); JobStub.ListJobAreas req = new JobStub.ListJobAreas(); Object res = s.ListJobAreas(req); System.out.println(res); } } --------------010205010801030205020804 Content-Type: text/xml; name="PolicyCache.xml" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="PolicyCache.xml" 500 NO org.tempuri.PWCallback wsp:Body() wsp:Header(wsa:To) wsp:Header(wsa:Action) wsp:Header(wsa:MessageID) wse:Timestamp() http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken NO wsp:Body() wsp:Header(wsa:Action) wsp:Header(wsa:FaultTo) wsp:Header(wsa:From) wsp:Header(wsa:MessageID) wsp:Header(wsa:RelatesTo) wsp:Header(wsa:ReplyTo) wsp:Header(wsa:To) wse:Timestamp() bBwPfItvKp3b6TNDq+14qs58VJQ= wsp:Body() wsp:Body() wsp:Header(wsa:To) wsp:Header(wsa:Action) wsp:Header(wsa:MessageID) wse:Timestamp() http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3 CN=Root Agency CN=WSE2QuickStartServer bBwPfItvKp3b6TNDq+14qs58VJQ= wsp:Body() wsp:Header(wsa:Action) wsp:Header(wsa:FaultTo) wsp:Header(wsa:From) wsp:Header(wsa:MessageID) wsp:Header(wsa:RelatesTo) wsp:Header(wsa:ReplyTo) wsp:Header(wsa:To) wse:Timestamp() wsp:Body() wsp:Header(wsa:To) wsp:Header(wsa:Action) wsp:Header(wsa:MessageID) wse:Timestamp() http://schemas.xmlsoap.org/ws/2004/04/security/sc/sct http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken wsp:Body() wsp:Body() wsp:Header(wsa:To) wsp:Header(wsa:Action) wsp:Header(wsa:MessageID) wse:Timestamp() http://schemas.xmlsoap.org/ws/2004/04/security/sc/dk http://schemas.xmlsoap.org/ws/2004/04/security/sc/sct wsp:Body() wsp:Header(wsa:Action) wsp:Header(wsa:FaultTo) wsp:Header(wsa:From) wsp:Header(wsa:MessageID) wsp:Header(wsa:RelatesTo) wsp:Header(wsa:ReplyTo) wsp:Header(wsa:To) wse:Timestamp() --------------010205010801030205020804 Content-Type: text/plain; name="rampart.policy" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rampart.policy" 500 NO org.tempuri.PWCallback --------------010205010801030205020804 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org For additional commands, e-mail: axis-user-help@ws.apache.org --------------010205010801030205020804--