user242386 February 2016

Codeigniter SOAP Server Error - Reserved XML - already tried trim

I am working on this legacy system that needs to maintain its SOAP service, and I am currently trying to integrate it with codeigniter, keeps giving me an error XML error parsing SOAP payload on line 70: Reserved XML Name. I have tried the trim solution that someone mention and that did not work. It does not give me this error with normal arrays. Only multidimensional arrays. Any advice would be appreviated

<?php
class Employee_Trainings_Soap extends MY_Controller {
   public function __construct() {
       parent::__construct();
       $this->load->library("Soap_lib");
       $this->nusoap_server = new soap_server(); 
   }

   public function employee_detail() {   
       $namespace = 'http://localhost/employee_trainings_soap/employee_detail?wsdl';

       $this->nusoap_server->debug_flag = true;
       $this->nusoap_server->configureWSDL('EmployeeTrainings', $namespace);
       $this->nusoap_server->wsdl->schemaTargetNamespace = $namespace;

       $this->nusoap_server->wsdl->addComplexType('response', 'complexType', 'struct', 'all', '', array(
           "validOPIN" => array(
               "name" => "valid_OPIN",
               "type" => "xsd:string"
           ),
           "message" => array(
               "name" => "message",
               "type" => "xsd:string"
           )
       ));

       $this->nusoap_server->wsdl->addComplexType('responses', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(
           array(
               "ref" => "SOAP-ENC:arrayType",
               "wsdl:arrayType" => "tns:response[]"
           )),
           "tns:response"
       ); 

       $this->nusoap_server->register('getEmployeeTrainings', array("id" => "xsd:string"), array('test'=>'tns:responses'),
           $namespace, $namespace."#getEmployeeTrainings", "rpc", "encoded",
           'Use this service to list notaries con        

Answers


user242386 February 2016

So I have found the issue, this may not be the only solution, it is the solution that we found that worked for us. We had to take the SOAP Service out of Code Igniter for it to work. The moment that we took the service outside of Code Igniter, it worked. This may be a bug with code igniter or it could have been with the way we were using it, but as a quick solution it worked. Additionally, we also found it worked better on a Linux dev box compared to an XAMPP dev box. I hope this helps anyone else that might have the same issue.

Post Status

Asked in February 2016
Viewed 1,375 times
Voted 10
Answered 1 times

Search




Leave an answer