Loading ...
Sorry, an error occurred while loading the content.

Re: Reg...SOAP thru PHP

Expand Messages
  • ramana
    Hi Salil, Thank you for throwing some light on this....but i couldnt find out any control charecters in my WSDL file... and another thing is that i m able to
    Message 1 of 6 , Sep 27, 2004
    • 0 Attachment
      Hi Salil,

      Thank you for throwing some light on this....but i couldnt find out
      any control charecters in my WSDL file... and another thing is that
      i m able to insert the data in the back end...but after inserting
      only that error is showing up.(acutal process is after inserting it
      has to redirect to another page).

      NewUser.wsdl has 2 messages... InputMessage contains 14 parts and
      OutputMessage contains 1 part....

      what could be wrong ?? :(

      Thanx a lot again
      -Ramana.

      --- In in-phpug@yahoogroups.com, Salil Kothadia <saliluk@y...> wrote:
      > Hello Ramana,
      >
      > I think you have control characters in your XML.
      > You are not allowed to have control characters in your
      > XML.
      >
      > You try validating the xml document for any such
      > characters.
      >
      > -Salil
      >
      >
      >
      > --- ramana <pvr_ramana@y...> wrote:
      >
      > > Hi All,
      > >
      > > I m Ramana... and i m currently working on a project
      > > where i had to
      > > write the webservices using WSDL's and Implement
      > > them thru PHP(i m
      > > new to this stuff)...i wrote a WSDL's
      > > named.."NewUser.wsdl" and the
      > > API for that... is "UserRegProcess.php" and the
      > > client part resides
      > > in "fc_userreg.php". fc_userreg.php contains the
      > > calling part of the
      > > SOAP client and .... UserRegProcess.php contains the
      > > calling of SOAP
      > > server. the whole process is that i have to just
      > > enter a new user
      > > info in to the backend(MySQL).
      > >
      > > but while doing that i get the following Error:
      > >
      > > SoapFault exception: [SOAP-ENV:Client] looks like we
      > > got no XML
      > > document in /var/www/html/fc_userreg.php:206 Stack
      > > trace:
      > > #0 /var/www/html/fc_userreg.php(206):
      > > SoapClient->UserRegProcess
      > > ('UserRegProcess', Array) #1 {main}
      > >
      > >
      > > Can anyone tell me... When does such SoapFault
      > > occurs and how to
      > > rectify them...and what could be the actual problem
      > > as such.
      > >
      > >
      > > Thanks in advance
      > > - Ramana.
      > >
      > >
      >
      >
      >
      >
      > _______________________________
      > Do you Yahoo!?
      > Declare Yourself - Register online to vote today!
      > http://vote.yahoo.com
    • ramana
      Hi All, Here i m giving my code... to jus get an idea of what i did... NewUser.wsdl ...
      Message 2 of 6 , Sep 27, 2004
      • 0 Attachment
        Hi All,

        Here i m giving my code... to jus get an idea of what i did...

        NewUser.wsdl
        --------------
        <?xml version="1.0" encoding="UTF-8"?>
        <wsdl:definitions xmlns:tns="http://192.168.1.60/soap/"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        xmlns="http://schemas.xmlsoap.org/wsdl/"
        xmlns:xsd1="http://192.168.1.60/soap/"
        targetNamespace="http://192.168.1.60/soap/" name="NewUser">
        <message name="NewUserRequest">
        <part name="FcRegUserName" type="xsd:string"/>
        <part name="FcRegUserPswrd" type="xsd:string"/>
        <part name="FcRegRPwrd" type="xsd:string"/>
        <part name="FcRegFristName" type="xsd:string"/>
        <part name="FcRegLastName" type="xsd:string"/>
        <part name="FcRegCompName" type="xsd:string"/>
        <part name="FcRegPhone" type="xsd:string"/>
        <part name="FcRegEMail" type="xsd:string"/>
        <part name="FcRegCountry" type="xsd:string"/>
        <part name="FcRegAdd1" type="xsd:string"/>
        <part name="FcRegAdd2" type="xsd:string"/>
        <part name="FcRegCity" type="xsd:string"/>
        <part name="FcRegState" type="xsd:string"/>
        <part name="FcRegAgree" type="xsd:string"/>
        </message>
        <message name="NewUserResponse">
        <part name="valid" type="xsd:integer"/>
        </message>
        <portType name="NewUserPortType">
        <operation name="UserRegProcess">
        <input message="NewUserRequest"/>
        <output message="NewUserResponse"/>
        </operation>
        </portType>
        <binding name="NewUserValidBinding" type="NewUserPortType">
        <soap:binding style="rpc"
        transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="UserRegProcess">
        <soap:operation soapAction="UserRegProcess"/>
        <input>
        <soap:body use="literal"/>
        </input>
        <output>
        <soap:body use="literal"/>
        </output>
        </operation>
        </binding>
        <service name="UserRegProcess">
        <documentation>Provides interface to calculate
        numbers</documentation>
        <port name="NewUserPortType"
        binding="NewUserValidBinding">
        <soap:address
        location="http://192.168.1.60/UserRegProcess.php"/>
        </port>
        </service>
        </wsdl:definitions>
        -------------------------------------------------------------------
        API: UserRegProcess.php
        ------------------------
        <?PHP
        include "sqllayer.php";
        include "uilayer.php";

        function UserRegProcess
        ($FcRegUserName,$FcRegUserPswrd,$FcRegRPwrd,$FcRegFirstName,$FcRegLas
        tName,$FcRegCompName,$FcRegPhone,$FcRegEMail,$FcRegCountry,$FcRegAdd1
        ,$FcRegAdd2,$FcRegCity,$FcRegState,$FcRegAgree)
        {

        $SQLUSER="select max(usr_id) from usr_mstr order by
        usr_id";
        $sResultID=mysql_query($SQLUSER);
        $Row=mysql_fetch_array($sResultID);

        $FcUserId=Auto_Generate($Row[0]);

        $FcRegAddress=$FcRegAdd1.",".$FcRegAdd2.",".$FcRegCity.",".$FcRegStat
        e;
        $FcStDate=Date("Y-m-d");
        $SQLInsertDet="insert into usr_mstr
        (usr_id,usr_name,usr_fname,usr_lname,usr_password,usr_comp_name,usr_e
        mail,usr_phone,usr_addr,usr_country,usr_st_date,usr_end_date)values
        ('$FcUserId','$FcRegUserName','$FcRegFirstName','$FcRegLastName','$Fc
        RegUserPswrd','$FcRegCompName','$FcRegEMail','$FcRegPhone','$FcRegAdd
        ress','$FcRegCountry','$FcStDate','')";

        $sResultID=mysql_query($SQLInsertDet);

        if($sResultID)
        {
        $valid=1;
        return $valid;
        }
        else
        {
        $valid=0;
        return $valid;
        }
        }
        try
        {
        $server = new SoapServer
        ("http://192.168.1.60/soap/NewUser.wsdl");
        $server->addFunction("UserRegProcess");
        $server->handle();
        }
        catch(Exception $exception)
        {

        echo $exception;
        }

        ?>
        ---------------------------------------------------------------------
        Client: TestRegister.php
        -------------------------
        <?PHP
        if(isset($_REQUEST['Submit']))
        {
        try
        {
        $client = new SoapClient
        ("http://192.168.1.60/soap/NewUser.wsdl", array("trace" =>
        $CLIENT_TRACE, "exceptions" => $CLIENT_EXCEPTION));
        $result = $client->UserRegProcess$FcRegUserName, $FcRegUserPswrd,
        $FcRegRPwrd, $FcRegFirstName, $FcRegLastName, $FcRegCompName,
        $FcRegPhone, $FcRegEMail, $FcRegCountry, $FcRegAdd1, $FcRegAdd2,
        $FcRegCity, $FcRegState, $FcRegAgree);
        }
        catch(Exception $exception)
        {
        echo $exception;
        }
        }
        ?>

        <html>
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-
        1">
        <title>Untitled Document</title>
        <style type="text/css">
        <!--
        .style5 {font-family: Verdana, Arial, Helvetica, sans-serif; font-
        size: x-small; font-weight: bold; }
        -->
        </style>
        </head>

        <body>
        <form name="testregister" method="get" action="testregister.php">
        <center>
        <table width="100%" border="0" cellpadding="5" cellspacing="5">
        <tr>
        <td align="right"><span class="style5">User Name </span></td>
        <td><input name="FcRegUserName" type="text"
        id="FcRegUserName"></td>
        </tr>
        <tr>
        <td align="right"><span class="style5">User Password
        </span></td>
        <td><input name="FcRegUserPswrd" type="text"
        id="FcRegUserPswrd"></td>
        </tr>
        <tr>
        <td align="right"><span class="style5">Retype Password
        </span></td>
        <td><input name="FcRegRPwrd" type="text" id="FcRegRPwrd"></td>
        </tr>
        <tr>
        <td align="right"><span class="style5">First Name </span></td>
        <td><input name="FcRegFirstName" type="text"
        id="FcRegFirstName"></td>
        </tr>
        <tr>
        <td align="right"><span class="style5">Last Name </span></td>
        <td><input name="FcRegLastName" type="text"
        id="FcRegLastName"></td>
        </tr>
        <tr>
        <td align="right"><span class="style5">Company</span></td>
        <td><input name="FcRegCompName" type="text"
        id="FcRegCompName"></td>
        </tr>
        <tr>
        <td align="right"><span class="style5">Phone</span></td>
        <td><input name="FcRegPhone" type="text" id="FcRegPhone"></td>
        </tr>
        <tr>
        <td align="right"><span class="style5">Email</span></td>
        <td><input name="FcRegEMail" type="text" id="FcRegEMail"></td>
        </tr>
        <tr>
        <td align="right"><span class="style5">Country</span></td>
        <td><input name="FcRegCountry" type="text"
        id="FcRegCountry"></td>
        </tr>
        <tr>
        <td align="right"><span class="style5">Address 1 </span></td>
        <td><input name="FcRegAdd1" type="text" id="FcRegAdd1"></td>
        </tr>
        <tr>
        <td align="right"><span class="style5">Address 2 </span></td>
        <td><input name="FcRegAdd2" type="text" id="FcRegAdd2"></td>
        </tr>
        <tr>
        <td align="right"><span class="style5">City</span></td>
        <td><input name="FcRegCity" type="text" id="FcRegCity"></td>
        </tr>
        <tr>
        <td align="right"><span class="style5">State</span></td>
        <td><input name="FcRegState" type="text" id="FcRegState"></td>
        </tr>
        <tr>
        <td align="right"><span class="style5">Agree</span></td>
        <td><input name="FcRegAgree" type="checkbox" id="FcRegAgree"
        value="checked"></td>
        </tr>
        <tr>
        <td> </td>
        <td><input type="submit" name="Submit" value="Save User
        Details"></td>
        </tr>
        </table>
        </center>
        </form>
        </body>
        </html>
        ---------------------------------------------------------------------

        In in-phpug@yahoogroups.com, Salil Kothadia <saliluk@y...> wrote:
        > Hello Ramana,
        >
        > I think you have control characters in your XML.
        > You are not allowed to have control characters in your
        > XML.
        >
        > You try validating the xml document for any such
        > characters.
        >
        > -Salil
        >
        >
        >
        > --- ramana <pvr_ramana@y...> wrote:
        >
        > > Hi All,
        > >
        > > I m Ramana... and i m currently working on a project
        > > where i had to
        > > write the webservices using WSDL's and Implement
        > > them thru PHP(i m
        > > new to this stuff)...i wrote a WSDL's
        > > named.."NewUser.wsdl" and the
        > > API for that... is "UserRegProcess.php" and the
        > > client part resides
        > > in "fc_userreg.php". fc_userreg.php contains the
        > > calling part of the
        > > SOAP client and .... UserRegProcess.php contains the
        > > calling of SOAP
        > > server. the whole process is that i have to just
        > > enter a new user
        > > info in to the backend(MySQL).
        > >
        > > but while doing that i get the following Error:
        > >
        > > SoapFault exception: [SOAP-ENV:Client] looks like we
        > > got no XML
        > > document in /var/www/html/fc_userreg.php:206 Stack
        > > trace:
        > > #0 /var/www/html/fc_userreg.php(206):
        > > SoapClient->UserRegProcess
        > > ('UserRegProcess', Array) #1 {main}
        > >
        > >
        > > Can anyone tell me... When does such SoapFault
        > > occurs and how to
        > > rectify them...and what could be the actual problem
        > > as such.
        > >
        > >
        > > Thanks in advance
        > > - Ramana.
        > >
        > >
        >
        >
        >
        >
        > _______________________________
        > Do you Yahoo!?
        > Declare Yourself - Register online to vote today!
        > http://vote.yahoo.com
      • Salil Kothadia
        Hello, I tried executing your code and it worked fine on my system. I did following changes. One more thing, i had commented the sql part. so if have a problem
        Message 3 of 6 , Sep 28, 2004
        • 0 Attachment
          Hello,

          I tried executing your code and it worked fine on my
          system.

          I did following changes.

          One more thing, i had commented the sql part. so if
          have a problem after changing this check you sql
          query.

          Cheers,
          Salil

          -------------------------------------------------------------------------------
          <form name="testregister" method="get"
          action="testregister.php">

          CHANGE IT TO

          <form name="testregister" method="GET" action="<?php
          echo($_SERVER['PHP_SELF']); ?>">

          case sensitive, use 'TestRegister.php' not
          'testregister.php' and also may be use post method.

          -----------------------------------------------------------------

          $result = $client->UserRegProcess($FcRegUserName,
          $FcRegUserPswrd,
          $FcRegRPwrd, $FcRegFirstName, $FcRegLastName,
          $FcRegCompName,
          $FcRegPhone, $FcRegEMail, $FcRegCountry, $FcRegAdd1,
          $FcRegAdd2,
          $FcRegCity, $FcRegState, $FcRegAgree);

          CHANGE IT TO

          $result= $client->UserRegProcess(
          $_GET['FcRegUserName'], $_GET['FcRegUserPswrd'],
          $_GET['FcRegRPwrd'], $_GET['FcRegFirstName'],
          $_GET['FcRegLastName'], $_GET['FcRegCompName'],
          $_GET['FcRegPhone'], $_GET['FcRegEMail'],
          $_GET['FcRegCountry'], $_GET['FcRegAdd1'],
          $_GET['FcRegAdd2'], $_GET['FcRegCity'],
          $_GET['FcRegState'], $_GET['FcRegAgree'] );

          you need to use $_GET for get data or $_GET for post
          data, better to keep register globals OFF

          -----------------------------------------------------------------------------

          Also try executing UserRegProcess.php directly to
          catch the execption there.

          -----------------------------------------------------------------------------

          --- ramana <pvr_ramana@...> wrote:

          > Hi Salil,
          >
          > Thank you for throwing some light on this....but i
          > couldnt find out
          > any control charecters in my WSDL file... and
          > another thing is that
          > i m able to insert the data in the back end...but
          > after inserting
          > only that error is showing up.(acutal process is
          > after inserting it
          > has to redirect to another page).
          >
          > NewUser.wsdl has 2 messages... InputMessage contains
          > 14 parts and
          > OutputMessage contains 1 part....
          >
          > what could be wrong ?? :(
          >
          > Thanx a lot again
          > -Ramana.
          >
          > --- In in-phpug@yahoogroups.com, Salil Kothadia
          > <saliluk@y...> wrote:
          > > Hello Ramana,
          > >
          > > I think you have control characters in your XML.
          > > You are not allowed to have control characters in
          > your
          > > XML.
          > >
          > > You try validating the xml document for any such
          > > characters.
          > >
          > > -Salil
          > >
          > >
          > >
          > > --- ramana <pvr_ramana@y...> wrote:
          > >
          > > > Hi All,
          > > >
          > > > I m Ramana... and i m currently working on a
          > project
          > > > where i had to
          > > > write the webservices using WSDL's and Implement
          > > > them thru PHP(i m
          > > > new to this stuff)...i wrote a WSDL's
          > > > named.."NewUser.wsdl" and the
          > > > API for that... is "UserRegProcess.php" and the
          > > > client part resides
          > > > in "fc_userreg.php". fc_userreg.php contains the
          > > > calling part of the
          > > > SOAP client and .... UserRegProcess.php contains
          > the
          > > > calling of SOAP
          > > > server. the whole process is that i have to just
          > > > enter a new user
          > > > info in to the backend(MySQL).
          > > >
          > > > but while doing that i get the following Error:
          > > >
          > > > SoapFault exception: [SOAP-ENV:Client] looks
          > like we
          > > > got no XML
          > > > document in /var/www/html/fc_userreg.php:206
          > Stack
          > > > trace:
          > > > #0 /var/www/html/fc_userreg.php(206):
          > > > SoapClient->UserRegProcess
          > > > ('UserRegProcess', Array) #1 {main}
          > > >
          > > >
          > > > Can anyone tell me... When does such SoapFault
          > > > occurs and how to
          > > > rectify them...and what could be the actual
          > problem
          > > > as such.
          > > >
          > > >
          > > > Thanks in advance
          > > > - Ramana.
          > > >
          > > >
          > >
          > >
          > >
          > >
          > > _______________________________
          > > Do you Yahoo!?
          > > Declare Yourself - Register online to vote today!
          > > http://vote.yahoo.com
          >
          >




          __________________________________
          Do you Yahoo!?
          Yahoo! Mail - You care about security. So do we.
          http://promotions.yahoo.com/new_mail
        • p v ramana
          Hi Salil, Thanks a lot.. yea my prob is solved... after commenting sqlpart and other file that i included in server part(API)... i donno why but for some
          Message 4 of 6 , Sep 28, 2004
          • 0 Attachment
            Hi Salil,

            Thanks a lot.. yea my prob is solved... after commenting sqlpart and other file that i included in server part(API)... i donno why but for some obvious reasons some stray charecter is been returned by one of those files.. and i removed all the comments etc from those files... and it worked..... and i even... did the changes what u pointed out.....

            Thanks a lot again Salil

            Regards..
            --Ven.

            Salil Kothadia <saliluk@...> wrote:
            Hello,

            I tried executing your code and it worked fine on my
            system.

            I did following changes.

            One more thing, i had commented the sql part. so if
            have a problem after changing this check you sql
            query.

            Cheers,
            Salil

            -------------------------------------------------------------------------------
            <form name="testregister" method="get"
            action="testregister.php">

            CHANGE IT TO

            <form name="testregister" method="GET" action="<?php
            echo($_SERVER['PHP_SELF']); ?>">

            case sensitive, use 'TestRegister.php' not
            'testregister.php' and also may be use post method.

            -----------------------------------------------------------------

            $result = $client->UserRegProcess($FcRegUserName,
            $FcRegUserPswrd,
            $FcRegRPwrd, $FcRegFirstName, $FcRegLastName,
            $FcRegCompName,
            $FcRegPhone, $FcRegEMail, $FcRegCountry, $FcRegAdd1,
            $FcRegAdd2,
            $FcRegCity, $FcRegState, $FcRegAgree);

            CHANGE IT TO

            $result= $client->UserRegProcess(
            $_GET['FcRegUserName'], $_GET['FcRegUserPswrd'],
            $_GET['FcRegRPwrd'], $_GET['FcRegFirstName'],
            $_GET['FcRegLastName'], $_GET['FcRegCompName'],
            $_GET['FcRegPhone'], $_GET['FcRegEMail'],
            $_GET['FcRegCountry'], $_GET['FcRegAdd1'],
            $_GET['FcRegAdd2'], $_GET['FcRegCity'],
            $_GET['FcRegState'], $_GET['FcRegAgree'] );

            you need to use $_GET for get data or $_GET for post
            data, better to keep register globals OFF

            -----------------------------------------------------------------------------

            Also try executing UserRegProcess.php directly to
            catch the execption there.

            -----------------------------------------------------------------------------

            --- ramana <pvr_ramana@...> wrote:

            > Hi Salil,
            >
            > Thank you for throwing some light on this....but i
            > couldnt find out
            > any control charecters in my WSDL file... and
            > another thing is that
            > i m able to insert the data in the back end...but
            > after inserting
            > only that error is showing up.(acutal process is
            > after inserting it
            > has to redirect to another page).
            >
            > NewUser.wsdl has 2 messages... InputMessage contains
            > 14 parts and
            > OutputMessage contains 1 part....
            >
            > what could be wrong ?? :(
            >
            > Thanx a lot again
            > -Ramana.
            >
            > --- In in-phpug@yahoogroups.com, Salil Kothadia
            > <saliluk@y...> wrote:
            > > Hello Ramana,
            > >
            > > I think you have control characters in your XML.
            > > You are not allowed to have control characters in
            > your
            > > XML.
            > >
            > > You try validating the xml document for any such
            > > characters.
            > >
            > > -Salil
            > >
            > >
            > >
            > > --- ramana <pvr_ramana@y...> wrote:
            > >
            > > > Hi All,
            > > >
            > > > I m Ramana... and i m currently working on a
            > project
            > > > where i had to
            > > > write the webservices using WSDL's and Implement
            > > > them thru PHP(i m
            > > > new to this stuff)...i wrote a WSDL's
            > > > named.."NewUser.wsdl" and the
            > > > API for that... is "UserRegProcess.php" and the
            > > > client part resides
            > > > in "fc_userreg.php". fc_userreg.php contains the
            > > > calling part of the
            > > > SOAP client and .... UserRegProcess.php contains
            > the
            > > > calling of SOAP
            > > > server. the whole process is that i have to just
            > > > enter a new user
            > > > info in to the backend(MySQL).
            > > >
            > > > but while doing that i get the following Error:
            > > >
            > > > SoapFault exception: [SOAP-ENV:Client] looks
            > like we
            > > > got no XML
            > > > document in /var/www/html/fc_userreg.php:206
            > Stack
            > > > trace:
            > > > #0 /var/www/html/fc_userreg.php(206):
            > > > SoapClient->UserRegProcess
            > > > ('UserRegProcess', Array) #1 {main}
            > > >
            > > >
            > > > Can anyone tell me... When does such SoapFault
            > > > occurs and how to
            > > > rectify them...and what could be the actual
            > problem
            > > > as such.
            > > >
            > > >
            > > > Thanks in advance
            > > > - Ramana.
            > > >
            > > >
            > >
            > >
            > >
            > >
            > > _______________________________
            > > Do you Yahoo!?
            > > Declare Yourself - Register online to vote today!
            > > http://vote.yahoo.com
            >
            >




            __________________________________
            Do you Yahoo!?
            Yahoo! Mail - You care about security. So do we.
            http://promotions.yahoo.com/new_mail


            Read Posting Guidelines at
            http://groups.yahoo.com/group/in-phpug/files/guidelines.html


            Yahoo! Groups SponsorADVERTISEMENT


            ---------------------------------
            Yahoo! Groups Links

            To visit your group on the web, go to:
            http://groups.yahoo.com/group/in-phpug/

            To unsubscribe from this group, send an email to:
            in-phpug-unsubscribe@yahoogroups.com

            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



            ---------------------------------
            Do you Yahoo!?
            New and Improved Yahoo! Mail - Send 10MB messages!

            [Non-text portions of this message have been removed]
          Your message has been successfully submitted and would be delivered to recipients shortly.