/*
 * 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.
 *
 */

/**
 * PingBindingImpl.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.2dev Oct 27, 2003 (02:34:09 EST) WSDL2Java emitter.
 */

package org.apache.ws.axis.oasis.ping;

import org.apache.axis.Message;
import org.apache.axis.MessageContext;
import org.apache.ws.axis.security.WSDoAllConstants;
import org.apache.ws.axis.security.WSDoAllReceiverResult;
import org.apache.ws.security.WSConstants;

import java.security.Principal;
import java.util.Vector;

public class PingBindingImpl
	implements org.apache.ws.axis.oasis.ping.PingPort {
	public void ping(
		javax.xml.rpc.holders.StringHolder text,
		org.apache.ws.axis.oasis.ping.TicketType ticket)
		throws java.rmi.RemoteException {
		text.value = "Echo " + text.value.trim();
		MessageContext msgContext = MessageContext.getCurrentContext();
		Message reqMsg = msgContext.getRequestMessage();

		Vector results = null;
		if ((results =
			(Vector) msgContext.getProperty(WSDoAllConstants.RECV_RESULTS))
			== null) {
			System.out.println("No security results!!");
		}
		System.out.println("Number of results: " + results.size());
		for (int i = 0; i < results.size(); i++) {
			WSDoAllReceiverResult rResult = (WSDoAllReceiverResult)results.get(i);
			Vector principals = rResult.getPrincipals();
			Vector actions = rResult.getActions();
			
			for (int j = 0; j < principals.size(); j++) {
				if (((Integer)actions.get(j)).intValue() != WSConstants.ENCR) {
					System.out.println(((Principal)principals.get(j)).getName());
				}
			}			
		}
	}

}

@@ -1338,16 +1338,19 @@
 ion %7B%0A%09%09
+// 
 text.val
@@ -1379,24 +1379,61 @@
 lue.trim();%0A
+%09%09text.value = %22Echo %22 + text.value;%0A
 %09%09MessageCon
@@ -1854,17 +1854,21 @@
 Result =
- 
+%0A%09%09%09%09
 (WSDoAll
@@ -1882,16 +1882,17 @@
 rResult)
+ 
 results.
@@ -1989,19 +1989,16 @@
 ions();%0A
-%09%09%09
 %0A%09%09%09for 
@@ -2057,16 +2057,17 @@
 Integer)
+ 
 actions.
@@ -2084,17 +2084,22 @@
 tValue()
- 
+%0A%09%09%09%09%09
 != WSCon
@@ -2137,16 +2137,23 @@
 println(
+%0A%09%09%09%09%09%09
 ((Princi
@@ -2156,16 +2156,17 @@
 incipal)
+ 
 principa
@@ -2198,19 +2198,16 @@
 %09%09%7D%0A%09%09%09%7D
-%09%09%09
 %0A%09%09%7D%0A%09%7D%0A

Remove trim() to check for unwanted space or \n characters.