Gå til innhold

Web Services - na makter jeg ikke mer! HJELP!


Anbefalte innlegg

Hei,

 

jeg sliter sann med en web-servicesoppgave jeg har!... jeg har startet pa nytt og pa nytt hundre ganger, og jeg har spurt og spurt, og lest og lest. Gjor som jeg far beskjed om, men det funker ikke uasnett hva jeg gjor. Data fra databasen displayer nar jeg ikke involverer WSDL-fila. Men nar jeg prover a connecte den, kommer ingenting fram. Please, kan noen lose dette for meg? Jeg har slitt i 3 uker na.... Far stadig mer og mer hetta ettersom deadline naermer seg.. Jeg paster inn client-server og WSDL-fila mi...

 

Pa forhand tusen takk for hjelpa om noen kan hjelpe...

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

CLIENT-FILE:

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

 

<?php

 

include ('nusoap.php');

 

$client = new soapclient('http://studprog.city.londonmet.ac.uk/~cel017/cw1mod4/mokk.wsdl', true);

 

$proxy = $client->getProxy();

 

$params = array('message' => 'select * from mod4timetable');

 

$response = $proxy->timetable($params);

 

 

 

foreach ($response as $row)

{

foreach ($row as $key=>$value)

{

print $value . "\n";

 

}

print "<br>";

}

 

 

?>

 

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

SERVER-FILE

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

<?php

 

require_once ('nusoap.php');

 

$server = new soap_server();

$server->register('timetable');

 

function timetable($message)

{

// if ($message == '')

// {

// return new soap_fault ('123', 'client', 'Please supply your date of birth');

// }

// else

// {

$link = mysql_connect("localhost", "msciad003", "Sansansa");

mysql_select_db ("msciad003");

$result = mysql_query ($message);

 

while ($result_data = mysql_fetch_array ($result))

{

$data[] = array(

'I_day' => $result_data['day'],

'I_start' => $result_data['start'],

'I_finish' => $result_data['finish'],

'I_location' => $result_data['location'],

'I_activity' => $result_data['activity']);

 

 

 

}

return $data;

}

$server->service ($HTTP_RAW_POST_DATA);

exit();

 

?>

 

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

WSDL-FILE

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

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

<definitions name="TimetableService"

targetNamespace="http://studprog.city.londonmet.ac.uk/~cel017/cw1mod4/mokk.wsdl"

xmlns="http://schemas.xmlsoap.org/wsdl/"

xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"

xmlns:tns="http://studprog.city.londonmet.ac.uk/~cel017/cw1mod4/mokk.wsdl"

xmlns:xsd="http://www.w3.org/2001/XMLSchema">

 

<!-- ABSTRACT DEFINITIONS -->

 

<!-- Type definitions -->

 

<xsd:complexType name="timetableArray">

<xsd:all>

 

 

<xsd:element name="I_day" type="xsd:string"/>

<xsd:element name="I_start" type="xsd:string"/>

<xsd:element name="I_finish" type="xsd:string"/>

<xsd:element name="I_location" type="xsd:string"/>

<xsd:element name="I_activity" type="xsd:string"/>

</xsd:all>

</xsd:complexType>

 

<!-- Message definitions -->

 

<message name="timeRequest">

<part name="sqlrequest" type="xsd:string" />

</message>

 

<message name="timeResponse">

<part name="details" type="typens:timetableArray" />

</message>

 

<!-- PortType definitions -->

<portType name="timePortType">

<operation name="timetable">

<input message="tns:timeRequest" />

<output message="tns:timeResponse" />

</operation>

</portType>

 

 

<!-- CONCRETE DEFINITIONS -->

 

<!-- Binding -->

<binding name="timeBinding" type="tns:timePortType">

<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />

<operation name="timetable">

<soap:operation soapAction="timetable" />

<input>

<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />

</input>

<output>

<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />

</output>

</operation>

</binding>

 

 

<!-- Service definition -->

 

<service name="timeService">

<documentation>WSDL File for TimetableService</documentation>

<port binding="tns:timeBinding" name="timePort">

<soap:address location="http://studprog.city.londonmet.ac.uk/~cel017/cw1mod4/mokkserver.php" />

</port>

</service>

 

 

</definitions>

Lenke til kommentar
Videoannonse
Annonse

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
×
×
  • Opprett ny...