...

View Full Version : Webservice problem



jrnvnjk
09-20-2011, 09:42 AM
I've got a problem with php webservice, on localhost everything works but when uploaded to a hosting provider it will not work.(I changed the url in the wsdl file) when i navigate with my browser to the files using the url in de wsdl file it works. Error: "Not Found"

php serverside


function test()
{
return "Success";
}


$server = new SoapServer( 'iChannelWebservice.wsdl' );
$server->addFunction('test');
$server->handle();


php clientside


$client = new SoapClient("http://channel.mainport.nl/soap/iChannelWebservice.wsdl");
print $client->test();


wsdl


<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://new.webservice.namespace" targetNamespace="http://new.webservice.namespace">
<wsdl:types>
<xs:schema targetNamespace="http://new.webservice.namespace" elementFormDefault="qualified"/>
</wsdl:types>
<wsdl:message name="testRequest">
</wsdl:message>
<wsdl:message name="testResponse">
<wsdl:part name="config" type="xs:string"/>
</wsdl:message>
<wsdl:portType name="iChannelWebservicePortType">
<wsdl:operation name="test">
<wsdl:input message="tns:testRequest"/>
<wsdl:output message="tns:testResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="iChannelWebserviceBinding" type="tns:iChannelWebservicePortType">
<http:binding verb="GET"/>
<wsdl:operation name="test">
<http:operation location="urn:#test"/>
<wsdl:input>
<http:urlEncoded/>
</wsdl:input>
<wsdl:output>
<mime:content type="string"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="iChannelWebservice">
<wsdl:port name="iChannelWebservicePort" binding="tns:iChannelWebserviceBinding">
<http:address location="http://channel.mainport.nl/soap/i-channelwebmethods.php"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

gvre
09-20-2011, 12:54 PM
Webservice url http://channel.mainport.nl/soap/i-channelwebmethods.php does not exist.

jrnvnjk
09-20-2011, 01:26 PM
Webservice url http://channel.mainport.nl/soap/i-channelwebmethods.php does not exist.

It's case sensitive i guess :P i'll try.

gvre
09-20-2011, 01:29 PM
You should change webservice's url with the correct one in wsdl file. Is http://channel.mainport.nl/soap/i-ChannelWebmethods.php the correct url?

gvre
09-20-2011, 01:32 PM
Try this wsdl


<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://new.webservice.namespace" targetNamespace="http://new.webservice.namespace">
<wsdl:types>
<xs:schema targetNamespace="http://new.webservice.namespace" elementFormDefault="qualified"/>
</wsdl:types>
<wsdl:message name="testRequest">
</wsdl:message>
<wsdl:message name="testResponse">
<wsdl:part name="config" type="xs:string"/>
</wsdl:message>
<wsdl:portType name="iChannelWebservicePortType">
<wsdl:operation name="test">
<wsdl:input message="tns:testRequest"/>
<wsdl:output message="tns:testResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="iChannelWebserviceBinding" type="tns:iChannelWebservicePortType">
<http:binding verb="GET"/>
<wsdl:operation name="test">
<http:operation location="urn:#test"/>
<wsdl:input>
<http:urlEncoded/>
</wsdl:input>
<wsdl:output>
<mime:content type="string"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="iChannelWebservice">
<wsdl:port name="iChannelWebservicePort" binding="tns:iChannelWebserviceBinding">
<http:address location="http://channel.mainport.nl/soap/i-ChannelWebmethods.php"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

jrnvnjk
09-20-2011, 02:01 PM
It works Tanks for your feedback :D

gvre
09-20-2011, 02:10 PM
You are welcome :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum