soapclient. need to extract information in php from a webservice that was built in C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • macupryk
    New Member
    • Sep 2006
    • 24

    soapclient. need to extract information in php from a webservice that was built in C#

    soapclient. need to extract information in php from a webservice that was built in C# asp.net 2.0

    I am new to php. Can someone help me with the code below.
    I would like to learn how to manipulate the information so if the user would like to display
    the contents of start_date on his/her web page. How would I go parsing this.
    [code=xml]
    <?xml version="1.0" encoding="utf-8" ?>
    - <Program xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http ://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
    <ClassName>Prog ram</ClassName>
    <intern_sql_cod e>I</intern_sql_code >
    <intern_timesta mp>2007-06-08T09:27:03.640 625-04:00</intern_timestam p>
    <intern_creatio n_date>0001-01-01T00:00:00</intern_creation _date>
    <program_id>108 </program_id>
    <start_date>200 7-05-24T00:00:00</start_date>
    <end_date>200 8-05-24T00:00:00</end_date>
    <program_name>C IBC Frequent Flyer</program_name>
    <source_descrip tion>Ceci est un test pour le fun</source_descript ion>
    <comm_id>0</comm_id>
    </Program>
    [/code]

    [Please use CODE tags when posting source code. Thanks! --pbmods]

    How can I see the variables of the above in the below in php below.

    [code=html]
    <html>
    <head>
    <title>PHP test page </title>
    </head>
    <body>
    <?php
    require_once('l ib/nusoap.php');
    $client = new soapclient('htt p://192.168.0.65/aircanada/WebSrvPrg/WebSrvPrg.asmx? wsdl','wsdl');
    $client->debug_flag = true;
    // Help here. I want to see the values.
    //$param = array('Program->ClassName');
    //$result = $client->call('ProgramS ervice', array('paramete rs'=>$param));
    //echo "The message is: " . $result['Program'];

    ?>[/code]
  • ak1dnar
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #2
    [PHP]<?php
    require_once('l ib/nusoap.php');
    $client = new soapclient('htt p://192.168.0.65/aircanada/WebSrvPrg/WebSrvPrg.asmx? wsdl','wsdl');
    $client->debug_flag = true;
    $param = array('Program->ClassName');
    $result = $client->call('ProgramS ervice', array('paramete rs'=>$param));

    # ProgramService => this is the function of your web service(server)
    # parameters => this is the input parameter for the function
    # but once you pass this using this way
    # $param = array('Program->ClassName');
    # value for the $param parameter will be like this
    # $param[0] = 'Program->ClassName';
    # so you are passing something like this to server
    # $result = $client->call('ProgramS ervice', array('paramete rs'=>'Program->ClassName')) ;
    # if that parameter is correct ( I dont think so) Web service (server) genarate the response
    # to the this client and output will assign to $result variable
    # you can print it like this
    echo "The message is: " . $result;
    # but what is this ;
    # echo "The message is: " . $result['Program'];

    # So,change the input parameter value
    # $param = array('Your_Inp ut');

    ?>[/PHP]

    Comment

    Working...