[wsf-c-dev] svn commit r304 - wsf/php/src/samples

svn at wso2.com svn at wso2.com
Mon Jan 1 23:23:27 PST 2007


Author: nandika
Date: Mon Jan  1 23:23:26 2007
New Revision: 304

Added:
   wsf/php/src/samples/echo_client_rm.php
   wsf/php/src/samples/echo_service_rm.php
Log:
rm sample added

Added: wsf/php/src/samples/echo_client_rm.php
==============================================================================
--- (empty file)
+++ wsf/php/src/samples/echo_client_rm.php	Mon Jan  1 23:23:26 2007
@@ -0,0 +1,44 @@
+<?php
+/*
+ * Copyright 2005,2006 WSO2, Inc. http://wso2.com
+ *
+ * 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.
+ */
+
+$reqPayloadString = <<<XML
+	<ns1:echoString xmlns:ns1="http://php.axis2.org/samples">
+		<text>Hello World!</text>
+	</ns1:echoString>
+XML;
+
+try {
+
+    $msg = new WSMessage($reqPayloadString);
+
+    $client = new WSClient($msg,
+        array("to"=>"http://localhost/echo_service_rm.php",
+	      "reliable"=>TRUE));
+	
+    $resMessage = $client->request($reqPayloadString);
+    
+    printf("Response = %s <br>", htmlspecialchars($resMessage->str));
+
+} catch (Exception $e) {
+
+	if ($e instanceof WSFault) {
+		printf("Soap Fault: %s\n", $e->code);
+	} else {
+		printf("Message = %s\n",$e->getMessage());
+	}
+}
+?>

Added: wsf/php/src/samples/echo_service_rm.php
==============================================================================
--- (empty file)
+++ wsf/php/src/samples/echo_service_rm.php	Mon Jan  1 23:23:26 2007
@@ -0,0 +1,31 @@
+<?php
+/*
+ * Copyright 2005,2006 WSO2, Inc. http://wso2.com
+ *
+ * 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.
+ */
+
+function echoFunction($inMessage) {
+
+    $returnMessage = new WSMessage($inMessage->str);
+
+    return $returnMessage;
+}
+
+$operations = array("echoString" => "echoFunction");
+
+$svr = new WSService(array("operations" => $operations,
+			   "reliable"=>TRUE));
+$svr->reply();
+
+?>




More information about the Wsf-c-dev mailing list