NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Help:unable to serialize result


Joined: 24 Apr 2006
Posts: 1
Reply with quote
my code:
Code:

require './nusoap.php';
$server = new soap_server();
$server->configureWSDL("APCenter", "http://apcenter/v1.0/", false, 'document','http://schemas.xmlsoap.org/soap/http','types');
$server->wsdl->addComplexType(
    'PaymentResult',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'TransactionID' => array('name' => 'TransactionID', 'type' => 's:string'),
        'Result' => array('name' => 'Result', 'type' => 's:int'),
        'ErrorDescription' => array('name' => 'ErrorDescription', 'type' => 's:string')
    )
);

$server->wsdl->schemaTargetNamespace="urn:http://apcenter/v1.0/"; 
$server->register("Payment",
                 array(
                  "APID"            =>   "s:string",
                  "TimeStamp"         =>   "s:string",
                  "TransactionID"      =>   "s:string",
                  "CorpID"         =>   "s:string",
                  "Action"         =>   "s:int",
                  "ServiceItemID"      =>   "s:string",
                  "SubscriptionType"   =>   "s:string",
                  "BeginTime"         =>   "s:string",
                  "EndTime"         =>   "s:string",
                  "AdminID"         =>   "s:string",
                  "Description"      =>   "s:string"
               ),               
               array('return'=>'tns:PaymentResult'),                        "urn:http://apcenter/v1.0/",         //namespace
               "urn:http://apcenter/v1.0/Payment",      //soap action
               "document",                     //style   
               'UTF-8',                     //encode               
               "AP Interface."   ,               //documentation
               true                        //use 
);

function Payment($APID,   $TimeStamp, $TransactionID,$CorpID, $Action, $ServiceItemID, $SubscriptionType, $BeginTime, $EndTime, $AdminID, $Description)
{
   $retval = array(
                'TransactionID' => "\"".time()."\"",
                'Result' => 0,
            'ErrorDescription' => 'ErrorDescription'
                );

   return $retval;




}


$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : "";

$server->service($HTTP_RAW_POST_DATA);
?>


I hope return :

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="PaymentResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="PaymentResult">
<xs:complexType>
<xs:sequence>
<xs:element name="TransactionID" type="xs:string"/>
<xs:element name="Result" type="xs:int"/>
<xs:element name="ErrorDescription" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

but get error:

Quote:

Response
HTTP/1.1 500 Internal Server Error
Date: Tue, 25 Apr 2006 02:33:57 GMT
Server: Apache/2.0.55 (Win32)
X-Powered-By: PHP/5.1.2
X-SOAP-Server: NuSOAP/0.7.2 (1.94)
Content-Length: 651
Connection: close
Content-Type: text/xml; charset=ISO-8859-1

<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body><SOAP-ENV:Fault><faultcode xsi:type="xsd:string">Server</faultcode><faultactor xsi:type="xsd:string"></faultactor><faultstring xsi:type="xsd:string">unable to serialize result</faultstring><detail xsi:type="xsd:string"></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
View user's profileFind all posts by freespySend private message
Help:unable to serialize result
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic