Jump to content

Eris

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Eris's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey, isn't there anybody who knows SOAP? I really need your help.
  2. Well, thx anyways for attention. At least you lifted this topic up the queue for a while : )
  3. No. The thing is that there are not 2 classes in the real code, there're more that 10 classes and I want the SoapServer to provide services from all of them at once...
  4. Hi. I've got 2 classes that provide services and 1 wsdl file for both of them, 1 SoapServer and 1 SoapClient. When I do $server->setClass("Class1"); $server->handle(); I can call functions from Class1 in the SoapClient. But if I do $server->setClass("Class1"); $server->setClass("Class2"); $server->handle(); then I am able only to call the functions from Class2, the ones from Class1 disappear. I suppose the problem can be solved if I correctly use namespaces, but don't know how. Here's the php file for the server - server.php: $server = new SoapServer("bla.wsdl"); $server->setClass("Class1"); $server->setClass("Class2"); $server->handle(); class Class1 { public function pow2($a) { return $a * $a; } public function pow3($a) { return $a * $a * $a; } } class Class2 { public function pow4($a) { return $a * $a * $a * $a; } } client.php: $client = new SoapClient("bla.wsdl"); echo "2 ^ 2 = " . $client->pow2(2) . "\n"; echo "2 ^ 3 = " . $client->pow3(2) . "\n"; echo "2 ^ 4 = " . $client->pow4(2) . "\n"; and the wsdl file - bla.wsdl <?xml version ='1.0' encoding ='UTF-8' ?> <definitions xmlns:class1Ns='http://example.org/Class1' xmlns:class2Ns='http://example.org/Class2' 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/'> <message name='pow2Request'> <part name='number' type='xsd:float'/> </message> <message name='pow2Response'> <part name='result' type='xsd:float'/> </message> <message name='pow3Request'> <part name='number' type='xsd:float'/> </message> <message name='pow3Response'> <part name='result' type='xsd:float'/> </message> <message name='pow4Request'> <part name='number' type='xsd:float'/> </message> <message name='pow4Response'> <part name='result' type='xsd:float'/> </message> <portType name='Class1PortType'> <operation name='pow2'> <input message='class1Ns:pow2Request'/> <output message='class1Ns:pow2Response'/> </operation> <operation name='pow3'> <input message='class1Ns:pow3Request'/> <output message='class1Ns:pow3Response'/> </operation> </portType> <portType name='Class2PortType'> <operation name='pow4'> <input message='class2Ns:pow4Request'/> <output message='class2Ns:pow4Response'/> </operation> </portType> <binding name='Class1Binding' type='class1Ns:Class1PortType'> <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/> <operation name='pow2'> <soap:operation soapAction='urn:pow2'/> <input> <soap:body use='literal'/> </input> <output> <soap:body use='literal'/> </output> </operation> <operation name='pow3'> <soap:operation soapAction='urn:pow3'/> <input> <soap:body use='literal'/> </input> <output> <soap:body use='literal'/> </output> </operation> </binding> <binding name='Class2Binding' type='class2Ns:Class2PortType'> <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/> <operation name='pow4'> <soap:operation soapAction='urn:pow4'/> <input> <soap:body use='literal'/> </input> <output> <soap:body use='literal'/> </output> </operation> </binding> <service name='Class1AndClass2Service'> <port name='Class1Port' binding='class1Ns:Class1Binding'> <soap:address location='http://localhost/collision/server.php'/> </port> <port name='Class2Port' binding='class2Ns:Class2Binding'> <soap:address location='http://localhost/collision/server.php'/> </port> </service> </definitions> If you comment the $server->setClass("Class2"); line in server.php the first two calls in the client: echo "2 ^ 2 = " . $client->pow2(2) . "\n"; echo "2 ^ 3 = " . $client->pow3(2) . "\n"; will work. I've read loads of tutorials and documentation, but couldn't find any solution. So PLEASE help me with this. You're my only hope : )
  5. Thanx a lot, that was exactly what I needed
  6. Hi! I have an integer timestamp, for example 1217147392 which means 27/07/2008 08:29:52 and I want it to be printed in GMT +3 offset that is: 27/07/2008 11:29:52. I don't want to change locale, just need a function that takes the offset as argument and returns new time. Is there a standard function like that or I have to write my own one? Thx
  7. . Yep, I'm a noob in php. Thx
  8. Hi. This is a very simple fragment of code and I don't understand why it doesn't work. I'm probably doing smt very wrong. Plz help $line = 'array("Home", "Invite", "About", "Contacts");'; $array = eval($line);
  9. Ok, i assume there is no better way. thanks anyway Bauer418
  10. lines have different length and the file's very big. i was thinking about reaching the required line with fgets(), but maybe there's a better way?
  11. i need to read only n-th line from a large file, n is given. what's the fastest way to do that?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.