CodeIgniter Forums
CI SOAP Server Problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CI SOAP Server Problem (/showthread.php?tid=28721)

Pages: 1 2


CI SOAP Server Problem - El Forum - 06-09-2010

[eluser]JanDoToDo[/eluser]
abbasmn,

how in your case do you call functions from another client? would they call the function 'hello'? Does this work like a normal server and correctly retrieve function lists etc?


CI SOAP Server Problem - El Forum - 06-09-2010

[eluser]abbasmn[/eluser]
this is my client:
Code:
<?php
/*
* Created on Oct 19, 2009
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/

if (!defined('BASEPATH')) exit('No direct script access allowed');
class Ws_client extends Controller
{
        function __construct()
        {
        session_start();
        parent::Controller();
                
        }
        
public function client_send_data()
{
    try{
    ini_set( 'soap.wsdl_cache_ttl' , 0 );
    $client = new SoapClient("http://localhost/Hello.wsdl",
    array('soap_version' => SOAP_1_2,'trace' => 1 ));

   echo("\nDumping client object functions:\n");
   var_dump($client->__getFunctions());

   $return = $client->__soapCall("hello",array("world"));
   echo("\nReturning value of __soapCall() call: ".$return);
    

  
      $return = $client->hello("World");
   echo("\nReturning value: ".$return);

      
  
   echo("\nDumping request headers:\n"
      .$client->__getLastRequestHeaders());

   echo("\nDumping request:\n".$client->__getLastRequest());

   echo("\nDumping response headers:\n"
      .$client->__getLastResponseHeaders());

   echo("\nDumping response:\n".$client->__getLastResponse());


}
catch (SoapFault $exception)
    {
    echo $exception;      
  }
}
}

?>



CI SOAP Server Problem - El Forum - 06-09-2010

[eluser]abbasmn[/eluser]
here is Hello.wsdl:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="MyDefinition"
targetNamespace="urn:myTargetNamespace"
xmlns:tns="urn:myTns"  
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>
<message name="myRequest">
  <part name="reqParam" type="xsd:string"/>
</message>
<message name="myResponse">
  <part name="resParam" type="xsd:string"/>
</message>
<portType name="MyPortType">
  <operation name="hello">
   &lt;input message="tns:myRequest"/&gt;
   <output message="tns:myResponse"/>
  </operation>
</portType>
<binding name="MyBinding" type="tns:MyPortType">
  <soap:binding style="rpc"
   transport="http://schemas.xmlsoap.org/soap/http"/>
  <operation name="hello">
   <soap:operation soapAction=""/>
   &lt;input&gt;
    <soap:body use="encoded"
     namespace="urn:myInputNamespace"
     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
   &lt;/input&gt;
   <output>
    <soap:body use="encoded"
     namespace="urn:myOutputNamespace"
     encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
   </output>
  </operation>
</binding>
<service name="MyService">
  <documentation>Returns a greeting string.
  </documentation>
  <port name="MyPort" binding="tns:MyBinding">
   <soap:address
  location="http://localhost/ws_server/my_server/"/>
  </port>
</service>
</definitions>



CI SOAP Server Problem - El Forum - 06-09-2010

[eluser]JanDoToDo[/eluser]
cool man thanks!