anirbansorcar 0 Newbie Poster
Hi All,

I am completely new to the concept of soap and need to generate multiple xml response at the response page.

I am requesting some parameters and in turn want to generate an xml response in multiple nodes.

//****MY REQUEST XML STARTS***********


<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:ltonlsrvnft">-<SOAP-ENV:Body>-<mns:GetConsumerInfo SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mns="urn:ltonlsrvnft"><Appl_User_ID xsi:type="xsd:string">1234567890</Appl_User_ID><Req_id xsi:type="xsd:string">1234</Req_id><req_dtls xsi:type="xsd:string">800049404</req_dtls><Req_dt_time xsi:type="xsd:string">2014-03-27 16:02:30</Req_dt_time><Corp_code xsi:type="xsd:string">CESC</Corp_code></mns:GetConsumerInfo></SOAP-ENV:Body></SOAP-ENV:Envelope>

//******REQUEST XML ENDS****************

I wan the output to come in multiple xml codes. I am giving my code

//********CODE STARTS*******************

// Pull in the NuSOAP code
require_once('nusoap.php');

// Create the server instance
$server = new soap_server;

//New inclusion
$server->configureWSDL("ltonlsrvnft", "urn:ltonlsrvnft");

// Define the method as a PHP function
function GetConsumerInfo($Appl_User_ID,$Req_id,$req_dtls,$Req_dt_time,$Corp_code)
{

    //Picking the consumer details from table
    $str_rl_nasec_con = "SELECT NVL(CONS_ID,'') AS CONS_ID, NVL(CONS_NUM,' ') AS CONS_NUM, NVL(CHK_DGT,' ') AS CHK_DGT, NVL(ADDR_ONE,' ') AS ADDR_ONE, NVL(RND_NET,'') AS RND_NET FROM TABLE_NAME WHERE CONS_ID = '$req_dtls' ";
    $statement_rl_nasec = oci_parse ($connection_oracle, $str_rl_nasec_con);
    oci_execute ($statement_rl_nasec);
    $row_rl_nasec = oci_fetch_array ($statement_rl_nasec, OCI_ASSOC);

    $consno = $row_rl_nasec['CONS_NUM'];
    $consno_cdg = $row_rl_nasec['CHK_DGT'];
    $consno_with_cdg = $consno.$consno_cdg;

    $consno_addr_one = $row_rl_nasec['ADDR_ONE'];
    $consno_net_amt = $row_rl_nasec['RND_NET'];
    $service_output = $req_dtls."|".$consno_net_amt;

    return $service_output;
}


//New inclusion
$server->register("GetConsumerInfo",array("Appl_User_ID" => "xsd:string","Req_id" => "xsd:string","req_dtls" => "xsd:string","Req_dt_time" => "xsd:string","Corp_code" => "xsd:string"),array("return" => "xsd:string","return" => "xsd:string","return" => "xsd:string","return" => "xsd:string","return" => "xsd:string"),"urn:ltonlsrvnft","urn:ltonlsrvnft#GetConsumerInfo","rpc","encoded","Get Consumer Details");


// Use the request to (try to) invoke the service
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>


//********CODE ENDS*********************

Any early help will be highly appreciated.

Thanks and regards...
Anirban
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.