Yii Framework Forum: can't connect to the web-service - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

can't connect to the web-service Rate Topic: -----

#1 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 503
  • Joined: 08-August 09

Posted 20 August 2009 - 07:50 AM

Hello!
I need help so if enyone could help I'll be really appreciated.
So my question is:

I have working .NET web-service to which I can't connect via PHP.

These lines of code:
$client= new SoapClient("http://kiparis.crimea.ua:81/ws/dataReturn.1cws?wsdl");
$response=$client->GetData();

cause this result:
Fatal error: Uncaught SoapFault exception: [HTTP] Not Found in D:\apache\test\www\nout.php:3 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://kiparis....', '', 1, 0) #1 [internal function]: SoapClient->__call('GetData', Array) #2 D:\apache\test\www\nout.php(3): SoapClient->GetData() #3 {main} thrown in D:\apache\test\www\nout.php on line 3

Yugene
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 20 August 2009 - 08:07 AM

Catch the exception to find out more:

try {
   $client= new SoapClient("http://kiparis.crimea.ua:81/ws/dataReturn.1cws?wsdl");
   $response=$client->GetData();
 } catch (SoapFault $e) {
    print_r($e->getMessage();
 }
  

0

#3 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 503
  • Joined: 08-August 09

Posted 20 August 2009 - 08:58 AM

View PostMike, on 20 August 2009 - 08:07 AM, said:

Catch the exception to find out more:

try {
   $client= new SoapClient("http://kiparis.crimea.ua:81/ws/dataReturn.1cws?wsdl");
   $response=$client->GetData();
 } catch (SoapFault $e) {
    print_r($e->getMessage();
 }
  


Thanks for replying
Tried this and got just "Not found"
0

#4 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 20 August 2009 - 03:40 PM

I tried a print_r($e) and found out that this URL seems te be used for the request:

http://kiparis.crime...dataReturn.1cws

It gives a "not found" and comes from the WSDL. So my guess is, that there might be something wrong in the WSDL description.

0

#5 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 503
  • Joined: 08-August 09

Posted 21 August 2009 - 04:07 AM

I've came to the same opinion, but there's a strange thing: service works perfectly when you call it with C#.
So I'm not sure it's only wsdl. May be php SoapClient doesn't work properly?
Well will try to play with the wsdl - may be will find the solution.

Thanks a lot for replying!
0

#6 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 21 August 2009 - 04:12 AM

Or could it be that GetData() expects some parameters?
0

#7 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 503
  • Joined: 08-August 09

Posted 22 August 2009 - 07:07 AM

View PostMike, on 21 August 2009 - 04:12 AM, said:

Or could it be that GetData() expects some parameters?

Well it seems that wsdl isn't right finally.
Service doesn't work both with or without parameters when i try to connect using PHP.
We cooperate with developer of the service so tried both ways.
Service was developed by .NET programmer and connection in C# works perfectly.
But when I use php SoapClient the connection fails.
So I think something in wsdl_document (which is good for C#) doesn't suit for php soapclient.


Well. thanks for support ))
Will research wsdl docs carefully I hope this will give me the answer)
0

#8 User is offline   paskuale 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 350
  • Joined: 30-December 11
  • Location:Italy, Bari

Posted 10 February 2013 - 03:12 AM

Hi jugene I try to connect to wsdl whit soapClient, it return me __getFunctions() a list of available funcs:

$client = new SoapClient($path_to_wsdl,array(
                        'trace' => 1,
                        'exceptions' => 1,
                        'features' => 'SOAP_SINGLE_ELEMENT_ARRAYS',
                        'cache_wsdl' => WSDL_CACHE_NONE,
                        'location' => $path_to_wsdl,
                        'uri' => $path_to_wsdl, // This may need to be the same as location.
                        'soap_version' => SOAP_1_2,
                        'login' => 'LUPIN',
                        'password' => '********',
                    ));
$allFunctions = $client->__getFunctions();
var_dump($allFunctions);

// return ....
array(6) {
[0]=>
string(29) "lsResponse ls(ls $parameters)"
[1]=>
string(32) "dirResponse dir(dir $parameters)"
[2]=>
string(41) "getlogResponse getlog(getlog $parameters)"
[3]=>
string(32) "getResponse get(get $parameters)"
[4]=>
string(32) "putResponse put(put $parameters)"
[5]=>
string(35) "mgetResponse mget(mget $parameters)"
}



how can execute these commands ?!
if I try this code:
var_dump($client->ls());

return me error:
Fatal error: Uncaught SoapFault exception: [HTTP] Not Found in C:\web-dev\xampp\htdocs\ws-dogana\index.php:41
Stack trace:
#0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'https://ws-tele...', 'ls', 2, 0)
#1 C:\web-dev\xampp\htdocs\ws-dogana\index.php(41): SoapClient->__call('ls', Array)
#2 C:\web-dev\xampp\htdocs\ws-dogana\index.php(41): SoapClient->ls()
#3 {main}
thrown in C:\web-dev\xampp\htdocs\ws-dogana\index.php on line 41

0

#9 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 503
  • Joined: 08-August 09

Posted 11 February 2013 - 07:32 AM

Hi paskuale

Quote

string(29) "lsResponse ls(ls $parameters)"

Is there any expected parameters you may send to that method?
For example
$params = array(
	'someExpectedParam'=>$yourValue
);

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users