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

  • SEARCH
  • Home
  • 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 8564591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:14:05+00:00 2026-06-11T17:14:05+00:00

I am trying to access a webservice (two files below). The client is using

  • 0

I am trying to access a webservice (two files below). The client is using ASP.NET/C# for their web architecture. I can add the web reference but somehow I cannot generate a proxy class for the wsdl file. The aim is to use the function in the server.php file so that I can use the xmlstring to display the data on the ASP.NET website. Any help would be very appreciated. Many Thanks


server.php file. This file has a php function which extracts data from a mysql db and the function returns the data as an XML string.

<?php
//WEB SERVICE FUNCTION TO EXTRACT DATA FROM CLIENT B INTO XML FORMAT
function getXML()
{
//CONNECT TO THE DATABASE SERVER
$dbserverIP = "xxxxxxx";
$dbusername = "xxxxxxx";
$dbpassword = "xxxxxxx";
$dbconnection = mysql_connect($dbserverIP,$dbusername,$dbpassword)  
or die ("The connection to the database server failed.");

//CONNECT TO THE DATABASE
$dbname = "xxxxxxxx";
$dbselectok = mysql_select_db($dbname,$dbconnection)
or die ("The connection to the database failed.");

//QUERY THE DATABASE
$sqlquery = "SELECT * FROM videogames";
$sqlresult = mysql_query($sqlquery,$dbconnection)
or die ("Error in executing the SQL statement");

//CREATE XML STRING
$xmlstring = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
$xmlstring.= "<videogames>";

while ($row = mysql_fetch_array($sqlresult))
{
    $xmlstring .= "\t<game>\r\n";
        $xmlstring .= "\t\t<gametitle>" .$row["gametitle"]. "</gametitle>\r\n";
        $xmlstring .= "\t\t<genre>" .$row["genre"]. "</genre>\r\n";
        $xmlstring .= "\t\t<year>" .$row["year"]. "</year>\r\n";
        $xmlstring .= "\t\t<platform>" .$row["platform"]. "</platform>\r\n";
        $xmlstring .= "\t\t<agerating>" .$row["agerating"]. "</agerating>\r\n";
        $xmlstring .= "\t\t<price>" .$row["price"]. "</price>\r\n";
    $xmlstring .= "\t</game>\r\n";
}

$xmlstring.= "</videogames>";

//WRITE XML STRING TO EXTERNAL FILE
$filename = "videogames.xml";
$fileaccessmode = "w";
$fptr = fopen($filename,$fileaccessmode);
fwrite($fptr,$xmlstring);
fclose($fptr);

//FREE UP MEMORY
mysql_free_result($sqlresult);
mysql_close($dbconnection);

return $xmlstring;

}

//CODE TO DISABLE THE WSDLE CACHE
ini_set("soap.wsdl_cache_enabled","0");

//DEFINE SOAP SERVER INSTANCE AND RELATED WSDL FILE
//THE service.wsdl FILE IS IN THE SAME FOLDER AS THIS server.php FILE
$server = new SoapServer("service.wsdl");

//ADD FUNCTION TO THE SERVER INSTANCE
$server->addFunction("getXML");

//ACTIVATE THE SOAP HANDLER
$server->handle();

?>

This is the WSDL file linked to the server.php file.

<?xml version ='1.0' encoding ='UTF-8' ?>

<!-- ====================== DEFINITIONS ====================== -->

<definitions name="MyWebService"
     targetNamespace="http://cet-apache-04.cet.bolton.ac.uk/student/mib1bee/CST3017/assignment/scenario1/service.wsdl"
     xmlns="http://schemas.xmlsoap.org/wsdl/"
     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
     xmlns:tns="http://cet-apache-04.cet.bolton.ac.uk/student/mib1bee/CST3017/assignment/scenario1/service.wsdl"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<!-- ====================== TYPES ============================ -->
<!-- No need for type definitions as only xsd built-in ======= --> 
<!-- data types are used                                       -->
<!-- ========================================================= -->

<!-- ====================== MESSAGE ========================== -->

<message name="getXML_Request">
<part name="input" />
</message>

<message name="getXML_Response">
<part name="xmlString" type="xsd:string"/>
</message>

<!-- ====================== PORT TYPE ============================ -->

<portType name="myWebService_PortType">

<operation name="getXML">
   <input  message="tns:getXML_Request"/>
   <output message="tns:getXML_Response"/>
</operation>

</portType>

<!-- ======================= BINDING ============================= -->

<binding name="myWebService_Binding" type="tns:myWebService_PortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

<operation name="getXML">
   <input>
     <soap:body use="literal"/>
   </input>
   <output>
     <soap:body use="literal"/>
   </output>
</operation>

</binding>

<!-- ======================= SERVICE ============================= -->

<service name="myWebService_Service">
<port name="myWebService_Port" binding="tns:myWebService_Binding">
    <soap:address location="http://cet-apache-04.cet.bolton.ac.uk/student/mib1bee/CST3017/assignment/scenario1/server.php"/>
</port>
</service>

</definitions>
  • 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-06-11T17:14:06+00:00Added an answer on June 11, 2026 at 5:14 pm

    You need to fix your wsdl:

    <operation name="getXML">
        <soap:operation soapAction="urn:MyWebService#getXML"/>
       <input>
         <soap:body use="literal"/>
       </input>
       <output>
         <soap:body use="literal"/>
       </output>
    </operation>
    
    </binding>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to access a web service using a secure client. I generated two
I am trying to access a WCF web service, that is using two way
I've built a ASP.NET webservice and I'm trying to access it from a Blackberry.
Two related ASP.NET Web Service JSON questions here. I'm using a N-tier designed ASP.NET
I am trying to access a restful web service using jQuery Ajax but getting
I am trying to access my local database using a web service also running
Im trying to make a webservice in ASP.NET and get the data in a
I am trying to access a webservice from my server using this tutorial consume
I am trying to create Lists in Sharepoint site from my ASP.NET code using
I am trying to access to a webservice in my .net aplication, but the

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.