Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 439421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:46:27+00:00 2026-05-12T20:46:27+00:00

I have a wsdl file and i am trying to call it from a

  • 0

I have a wsdl file and i am trying to call it from a php class. I am using the following code:

<?php

include (“dbconn.php”);

class dataclass
{

function getCountries()
{
    $connection = new dbconn();

    $sql = "SELECT * FROM tblcountries";

    $dataset = $connection -> connectSql($sql);

    return $dataset;
}

function getTest()
{
    $connection = new dbconn();

    $sql = mysql_query('CALL sp_getTest');

    $dataset =  $connection -> connectSql($sql);

    return $dataset;
}


##-------------------------------------------CUSTOMER METHODS-------------------------------------------
function registerCustomer($username,$name,$surname,$password,$email,$country,$tel)
{
    $connection = new dbconn();

    $sql="INSERT INTO tblcustomer (customer_username, customer_password, customer_name, customer_surname,
        customer_email, customer_country, customer_tel) 
        VALUES('$username','$name','$surname','$password','$email','$country','$tel')";

    $dataset = $connection -> connectSql($sql);

}



ini_set("soap.wsdl_cache_enabled", "0");
// start the SOAP server - point to the wsdl file
$webservice = new SoapServer("http://localhost/dataobjects/myWebservice.wsdl", array('soap_version' => SOAP_1_2));

// publish methods
$webservice->addFunction("getCountries");
$webservice->addFunction("registerCustomer");
// publish
$webservice->handle();

}
?>

It is all the time giving me a problem with ini_set("soap.wsdl_cache_enabled", "0");

The error is:

Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in C:\Program Files\xampplite\htdocs\dataobjects\dataClass.php on line 47

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T20:46:27+00:00Added an answer on May 12, 2026 at 8:46 pm

    I believe it is because you have ini_set() call in the body of your class. Put it at the top of the file or in the constructor if you have one.

    class dataClass
    {
        function registerCustomer()
        {
           // some stuff
        }
    
        ini_set(/*args*/); // it's illegal to put instructions in the body of the class
    }
    

    Now I see the whole thing. You probably want to close the class with a closing backet before line 47.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two project, one which generates some artifacts from a WSDL file using
I have been trying to control a camera through a wsdl file using SUDS.
I have been trying to generate a Proxy class in VB.NET using a WSDL
I have created two wsdl files with shared types imported from xsd schema file.
I have a WSDL file which is from an Axis2 Web Service. When I
The Problem is that I have a web reference genereted from WSDL file. Now
I am trying to hit the following web service with axis2: http://www.webservicex.net/geoipservice.asmx?WSDL I have
I have a WSDL file and I am trying to create a web service
When I am trying to generate Apex classes from the below WSDL file I
I'm trying to generate Java service classes from a WSDL definition I have already

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.