You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by we...@apache.org on 2004/10/24 14:42:50 UTC
cvs commit: ws-fx/wss4j/interop/org/apache/ws/axis/oasis/ping deploy.wsdd
werner 2004/10/24 05:42:50
Modified: wss4j/interop/org/apache/ws/axis/oasis Client_deploy.wsdd
wss4j/interop ping.wsdl
wss4j/interop/org/apache/ws/axis/oasis/ping deploy.wsdd
Added: wss4j/interop/org/apache/ws/axis/oasis Scenario2a.java
Log:
Enhancements to support "siging with key derived from UsernameToken",
refer to E-mail conversation in ws-fx mailing list (Oct, 20, 2004).
Revision Changes Path
1.23 +17 -0 ws-fx/wss4j/interop/org/apache/ws/axis/oasis/Client_deploy.wsdd
Index: Client_deploy.wsdd
===================================================================
RCS file: /home/cvs/ws-fx/wss4j/interop/org/apache/ws/axis/oasis/Client_deploy.wsdd,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- Client_deploy.wsdd 10 Jun 2004 11:38:31 -0000 1.22
+++ Client_deploy.wsdd 24 Oct 2004 12:42:50 -0000 1.23
@@ -49,6 +49,23 @@
</requestFlow>
</service>
+ <service name="Ping2a">
+ <requestFlow>
+ <handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
+ <parameter name="action" value="UsernameTokenSignature Encrypt Timestamp"/>
+ <parameter name="user" value="Chris"/>
+ <parameter name="passwordCallbackClass"
+ value="org.apache.ws.axis.oasis.PWCallback1"/>
+ <parameter name="encryptionPropFile" value="wsstest.properties" />
+ <parameter name="encryptionKeyIdentifier" value="SKIKeyIdentifier" />
+ <!-- Use the Server's cert/key to encrypt the request -->
+ <parameter name="encryptionUser" value="c82f74d031dabf9d7546f40ad07c32c0_1e149434-9d3a-4adc-9284-4cfdc595012f" />
+ <parameter name="encryptionParts"
+ value="{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}UsernameToken" />
+ </handler>
+ </requestFlow>
+ </service>
+
<service name="Ping3">
<requestFlow>
<handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
1.1 ws-fx/wss4j/interop/org/apache/ws/axis/oasis/Scenario2a.java
Index: Scenario2a.java
===================================================================
/*
* Copyright 2003-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.ws.axis.oasis;
import org.apache.axis.utils.Options;
import org.apache.ws.axis.oasis.ping.PingPort;
import org.apache.ws.axis.oasis.ping.PingServiceLocator;
import javax.xml.rpc.holders.StringHolder;
/**
* Class Scenario2a
*/
public class Scenario2a {
/** Field address */
private static final java.lang.String address =
"http://localhost:9080/axis/services/Ping2a";
/**
* Method main
*
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
Options opts = new Options(args);
opts.setDefaultURL(address);
/*
* Start to prepare service call. Once this is done, several
* calls can be made on the port (see below)
*
* Fist: get the service locator. This implements the functionality
* to get a client stub (aka port).
*/
PingServiceLocator service = new PingServiceLocator();
/*
* this is a JAX-RPC compliant call. It uses a preconfigured
* endpoint address (usually contained in the WSDL). Note the
* cast.
*
* SecPort port = (SwaPort)service.getPort(SwaPortType.class);
*/
/*
* Here we use an Axis specific call that allows to override the
* port address (service endpoint address) with an own URL. Comes
* in handy for testing.
*/
java.net.URL endpoint;
try {
endpoint = new java.net.URL(opts.getURL());
} catch (java.net.MalformedURLException e) {
throw new javax.xml.rpc.ServiceException(e);
}
PingPort port = (PingPort) service.getPing2a(endpoint);
/*
* At this point all preparations are done. Using the port we can
* now perform as many calls as necessary.
*/
// perform call
StringHolder text =
new StringHolder("WSS4J - Scenario 2a text");
port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
System.out.println(text.value);
if (opts.isFlagSet('t') > 0) {
long startTime = System.currentTimeMillis();
for (int i = 0; i < 20; i++) {
port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
}
long endTime = System.currentTimeMillis();
System.out.println("Time used: " + (endTime - startTime) + "ms");
}
}
}
1.8 +3 -0 ws-fx/wss4j/interop/ping.wsdl
Index: ping.wsdl
===================================================================
RCS file: /home/cvs/ws-fx/wss4j/interop/ping.wsdl,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ping.wsdl 30 May 2004 09:26:10 -0000 1.7
+++ ping.wsdl 24 Oct 2004 12:42:50 -0000 1.8
@@ -67,6 +67,9 @@
<port name="Ping2" binding="tns:PingBinding">
<soap:address location="http://localhost:9080/pingservice/Ping2"/>
</port>
+ <port name="Ping2a" binding="tns:PingBinding">
+ <soap:address location="http://localhost:9080/pingservice/Ping2a"/>
+ </port>
<port name="Ping3" binding="tns:PingBinding">
<soap:address location="http://localhost:9080/pingservice/Ping3"/>
</port>
1.22 +29 -0 ws-fx/wss4j/interop/org/apache/ws/axis/oasis/ping/deploy.wsdd
Index: deploy.wsdd
===================================================================
RCS file: /home/cvs/ws-fx/wss4j/interop/org/apache/ws/axis/oasis/ping/deploy.wsdd,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- deploy.wsdd 10 Jun 2004 11:38:31 -0000 1.21
+++ deploy.wsdd 24 Oct 2004 12:42:50 -0000 1.22
@@ -69,6 +69,35 @@
</requestFlow>
</service>
+ <service name="Ping2a" provider="java:RPC" style="wrapped" use="literal">
+ <parameter name="wsdlTargetNamespace" value="http://xmlsoap.org/Ping"/>
+ <parameter name="wsdlServiceElement" value="PingService"/>
+ <parameter name="wsdlServicePort" value="Ping2"/>
+ <parameter name="className" value="org.apache.ws.axis.oasis.ping.PingBindingImpl"/>
+ <parameter name="wsdlPortType" value="PingPort"/>
+ <operation name="ping" qname="operNS:Ping" xmlns:operNS="http://xmlsoap.org/Ping" >
+ <parameter qname="pns:ticket" xmlns:pns="http://xmlsoap.org/Ping" type="tns:ticketType" xmlns:tns="http://xmlsoap.org/Ping"/>
+ <parameter qname="pns:text" xmlns:pns="http://xmlsoap.org/Ping" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema" mode="INOUT"/>
+ </operation>
+ <parameter name="allowedMethods" value="ping"/>
+
+ <typeMapping
+ xmlns:ns="http://xmlsoap.org/Ping"
+ qname="ns:ticketType"
+ type="java:org.apache.ws.axis.oasis.ping.TicketType"
+ serializer="org.apache.axis.encoding.ser.SimpleSerializerFactory"
+ deserializer="org.apache.axis.encoding.ser.SimpleDeserializerFactory"
+ encodingStyle=""
+ />
+ <requestFlow>
+ <handler type="java:org.apache.ws.axis.security.WSDoAllReceiver">
+ <parameter name="passwordCallbackClass" value="org.apache.ws.axis.oasis.PWCallback1"/>
+ <parameter name="action" value="UsernameTokenSignature UsernameToken Encrypt Timestamp"/>
+ <parameter name="decryptionPropFile" value="wsstest.properties" />
+ </handler>
+ </requestFlow>
+ </service>
+
<service name="Ping3" provider="java:RPC" style="wrapped" use="literal">
<parameter name="wsdlTargetNamespace" value="http://xmlsoap.org/Ping"/>
<parameter name="wsdlServiceElement" value="PingService"/>
Re: cvs commit: ws-fx/wss4j/interop/org/apache/ws/axis/oasis/ping deploy.wsdd
Posted by Davanum Srinivas <da...@gmail.com>.
AWESOME!!! :)
-- dims
On 24 Oct 2004 12:42:50 -0000, werner@apache.org <we...@apache.org> wrote:
> werner 2004/10/24 05:42:50
>
> Modified: wss4j/interop/org/apache/ws/axis/oasis Client_deploy.wsdd
> wss4j/interop ping.wsdl
> wss4j/interop/org/apache/ws/axis/oasis/ping deploy.wsdd
> Added: wss4j/interop/org/apache/ws/axis/oasis Scenario2a.java
> Log:
> Enhancements to support "siging with key derived from UsernameToken",
> refer to E-mail conversation in ws-fx mailing list (Oct, 20, 2004).
>
> Revision Changes Path
> 1.23 +17 -0 ws-fx/wss4j/interop/org/apache/ws/axis/oasis/Client_deploy.wsdd
>
> Index: Client_deploy.wsdd
> ===================================================================
> RCS file: /home/cvs/ws-fx/wss4j/interop/org/apache/ws/axis/oasis/Client_deploy.wsdd,v
> retrieving revision 1.22
> retrieving revision 1.23
> diff -u -r1.22 -r1.23
> --- Client_deploy.wsdd 10 Jun 2004 11:38:31 -0000 1.22
> +++ Client_deploy.wsdd 24 Oct 2004 12:42:50 -0000 1.23
> @@ -49,6 +49,23 @@
> </requestFlow>
> </service>
>
> + <service name="Ping2a">
> + <requestFlow>
> + <handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
> + <parameter name="action" value="UsernameTokenSignature Encrypt Timestamp"/>
> + <parameter name="user" value="Chris"/>
> + <parameter name="passwordCallbackClass"
> + value="org.apache.ws.axis.oasis.PWCallback1"/>
> + <parameter name="encryptionPropFile" value="wsstest.properties" />
> + <parameter name="encryptionKeyIdentifier" value="SKIKeyIdentifier" />
> + <!-- Use the Server's cert/key to encrypt the request -->
> + <parameter name="encryptionUser" value="c82f74d031dabf9d7546f40ad07c32c0_1e149434-9d3a-4adc-9284-4cfdc595012f" />
> + <parameter name="encryptionParts"
> + value="{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}UsernameToken" />
> + </handler>
> + </requestFlow>
> + </service>
> +
> <service name="Ping3">
> <requestFlow>
> <handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
>
> 1.1 ws-fx/wss4j/interop/org/apache/ws/axis/oasis/Scenario2a.java
>
> Index: Scenario2a.java
> ===================================================================
> /*
> * Copyright 2003-2004 The Apache Software Foundation.
> *
> * Licensed under the Apache License, Version 2.0 (the "License");
> * you may not use this file except in compliance with the License.
> * You may obtain a copy of the License at
> *
> * http://www.apache.org/licenses/LICENSE-2.0
> *
> * Unless required by applicable law or agreed to in writing, software
> * distributed under the License is distributed on an "AS IS" BASIS,
> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> * See the License for the specific language governing permissions and
> * limitations under the License.
> *
> */
>
> package org.apache.ws.axis.oasis;
>
> import org.apache.axis.utils.Options;
> import org.apache.ws.axis.oasis.ping.PingPort;
> import org.apache.ws.axis.oasis.ping.PingServiceLocator;
>
> import javax.xml.rpc.holders.StringHolder;
>
> /**
> * Class Scenario2a
> */
> public class Scenario2a {
>
> /** Field address */
> private static final java.lang.String address =
> "http://localhost:9080/axis/services/Ping2a";
>
> /**
> * Method main
> *
> * @param args
> * @throws Exception
> */
> public static void main(String[] args) throws Exception {
>
> Options opts = new Options(args);
> opts.setDefaultURL(address);
>
> /*
> * Start to prepare service call. Once this is done, several
> * calls can be made on the port (see below)
> *
> * Fist: get the service locator. This implements the functionality
> * to get a client stub (aka port).
> */
> PingServiceLocator service = new PingServiceLocator();
>
> /*
> * this is a JAX-RPC compliant call. It uses a preconfigured
> * endpoint address (usually contained in the WSDL). Note the
> * cast.
> *
> * SecPort port = (SwaPort)service.getPort(SwaPortType.class);
> */
>
> /*
> * Here we use an Axis specific call that allows to override the
> * port address (service endpoint address) with an own URL. Comes
> * in handy for testing.
> */
> java.net.URL endpoint;
>
> try {
> endpoint = new java.net.URL(opts.getURL());
> } catch (java.net.MalformedURLException e) {
> throw new javax.xml.rpc.ServiceException(e);
> }
>
> PingPort port = (PingPort) service.getPing2a(endpoint);
>
> /*
> * At this point all preparations are done. Using the port we can
> * now perform as many calls as necessary.
> */
>
> // perform call
> StringHolder text =
> new StringHolder("WSS4J - Scenario 2a text");
> port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
> System.out.println(text.value);
>
> if (opts.isFlagSet('t') > 0) {
> long startTime = System.currentTimeMillis();
>
> for (int i = 0; i < 20; i++) {
> port.ping(new org.apache.ws.axis.oasis.ping.TicketType("WSS4J"), text);
> }
>
> long endTime = System.currentTimeMillis();
>
> System.out.println("Time used: " + (endTime - startTime) + "ms");
> }
> }
> }
>
> 1.8 +3 -0 ws-fx/wss4j/interop/ping.wsdl
>
> Index: ping.wsdl
> ===================================================================
> RCS file: /home/cvs/ws-fx/wss4j/interop/ping.wsdl,v
> retrieving revision 1.7
> retrieving revision 1.8
> diff -u -r1.7 -r1.8
> --- ping.wsdl 30 May 2004 09:26:10 -0000 1.7
> +++ ping.wsdl 24 Oct 2004 12:42:50 -0000 1.8
> @@ -67,6 +67,9 @@
> <port name="Ping2" binding="tns:PingBinding">
> <soap:address location="http://localhost:9080/pingservice/Ping2"/>
> </port>
> + <port name="Ping2a" binding="tns:PingBinding">
> + <soap:address location="http://localhost:9080/pingservice/Ping2a"/>
> + </port>
> <port name="Ping3" binding="tns:PingBinding">
> <soap:address location="http://localhost:9080/pingservice/Ping3"/>
> </port>
>
> 1.22 +29 -0 ws-fx/wss4j/interop/org/apache/ws/axis/oasis/ping/deploy.wsdd
>
> Index: deploy.wsdd
> ===================================================================
> RCS file: /home/cvs/ws-fx/wss4j/interop/org/apache/ws/axis/oasis/ping/deploy.wsdd,v
> retrieving revision 1.21
> retrieving revision 1.22
> diff -u -r1.21 -r1.22
> --- deploy.wsdd 10 Jun 2004 11:38:31 -0000 1.21
> +++ deploy.wsdd 24 Oct 2004 12:42:50 -0000 1.22
> @@ -69,6 +69,35 @@
> </requestFlow>
> </service>
>
> + <service name="Ping2a" provider="java:RPC" style="wrapped" use="literal">
> + <parameter name="wsdlTargetNamespace" value="http://xmlsoap.org/Ping"/>
> + <parameter name="wsdlServiceElement" value="PingService"/>
> + <parameter name="wsdlServicePort" value="Ping2"/>
> + <parameter name="className" value="org.apache.ws.axis.oasis.ping.PingBindingImpl"/>
> + <parameter name="wsdlPortType" value="PingPort"/>
> + <operation name="ping" qname="operNS:Ping" xmlns:operNS="http://xmlsoap.org/Ping" >
> + <parameter qname="pns:ticket" xmlns:pns="http://xmlsoap.org/Ping" type="tns:ticketType" xmlns:tns="http://xmlsoap.org/Ping"/>
> + <parameter qname="pns:text" xmlns:pns="http://xmlsoap.org/Ping" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema" mode="INOUT"/>
> + </operation>
> + <parameter name="allowedMethods" value="ping"/>
> +
> + <typeMapping
> + xmlns:ns="http://xmlsoap.org/Ping"
> + qname="ns:ticketType"
> + type="java:org.apache.ws.axis.oasis.ping.TicketType"
> + serializer="org.apache.axis.encoding.ser.SimpleSerializerFactory"
> + deserializer="org.apache.axis.encoding.ser.SimpleDeserializerFactory"
> + encodingStyle=""
> + />
> + <requestFlow>
> + <handler type="java:org.apache.ws.axis.security.WSDoAllReceiver">
> + <parameter name="passwordCallbackClass" value="org.apache.ws.axis.oasis.PWCallback1"/>
> + <parameter name="action" value="UsernameTokenSignature UsernameToken Encrypt Timestamp"/>
> + <parameter name="decryptionPropFile" value="wsstest.properties" />
> + </handler>
> + </requestFlow>
> + </service>
> +
> <service name="Ping3" provider="java:RPC" style="wrapped" use="literal">
> <parameter name="wsdlTargetNamespace" value="http://xmlsoap.org/Ping"/>
> <parameter name="wsdlServiceElement" value="PingService"/>
>
>
--
Davanum Srinivas - http://webservices.apache.org/~dims/