Edit report at http://bugs.php.net/bug.php?id=50698&edit=1
ID: 50698
User updated by: zippy1981 at gmail dot com
Reported by: zippy1981 at gmail dot com
Summary: SoapClient should handle wsdls with some incompatiable
endpoints
Status: Open
Type: Feature/Change Request
Package: *General Issues
Operating System: Windows XP/7 and probably all.
PHP Version: 5.2.12, 5.3.1
New Comment:
Submitted a new patch with error handling.
Previous Comments:
------------------------------------------------------------------------
[2010-04-02 17:29:49] zippy1981 at gmail dot com
Below is a patch that helps to fix the behavior. The following problems
remain:
1) If the wsdl contains only non http endpoints, and the location
parameter is
not specified, a proper error message is not generated.
2) If the wsdl contains only non http endpoints, and the location
parameter is
specified, the error "Uncaught SoapFault exception: [Client] Function
("echo")
is not a valid method for this service in File.php:21" is displayed.
Index: ext/soap/php_sdl.c
===================================================================
--- ext/soap/php_sdl.c (revision 297339)
+++ ext/soap/php_sdl.c (working copy)
@@ -832,7 +832,12 @@
if (strncmp((char*)tmp-
>children->content, WSDL_HTTP_TRANSPORT, sizeof(WSDL_HTTP_TRANSPORT)) ==
0) {
soapBinding-
>transport = SOAP_TRANSPORT_HTTP;
} else {
-
soap_error1(E_ERROR, "Parsing WSDL: PHP-SOAP doesn't support transport
'%s'",
tmp->children->content);
+ // Since this
is
an E_NOTICE severity message, it will disappear into the ether.
+
soap_error1(E_NOTICE, "Parsing WSDL: PHP-SOAP doesn't support transport
'%s'",
tmp->children->content);
+
efree(soapBinding);
+
efree(tmpbinding);
+ trav = trav-
>next;
+ continue;
}
}
}
------------------------------------------------------------------------
[2010-01-13 20:59:45] zippy1981 at gmail dot com
Thanks for your reply.
On my initial report I posted an example client. In a comment in the
example client is a link to a github repo with a .NET web service that
causes this issue (e.g. config file was bound to nettcp):
http://github.com/zippy1981/EchoService
Inside the .net service is also a copy of the PHP client.
The .NET code can be compiled on any windows machine with the free IDE
SharpDevelop (http://www.icsharpcode.net/OpenSource/SD/Download/)
I can provide a manually generated wsdl with false endpoints if needed.
I'll gladly help test a fix or provide a mock if needed.
------------------------------------------------------------------------
[2010-01-13 20:29:39] [email protected]
thanks for the clarification. if you can provide a test case /script ,
it would help us to work on this. thanks again for taking time for
following up on this. your help will definitely help PHP make better !
------------------------------------------------------------------------
[2010-01-13 15:05:54] zippy1981 at gmail dot com
It seems I was not clear in my original ticket.
My soap service has two end points. One is http (soap 1.1). The other
is nettcp, microsoft private protocol.
PHP throws an error when I parse the WSDL simply because it contains
an endpoint it can't connect to. This is in spite of the following
four facts:
1) There is a http endpoint it knows how to connect to in the WSDL
2) I override the WSDL endpoints in the soap constructor.
3) A soap client only needs to connect to one endpoint in a WSDL to
communicate with it
If I manually edit the WSDL so that the nettcp endpoint is no longer
advertised, but it still exists, PHP will connect to it fine.
------------------------------------------------------------------------
[2010-01-13 14:41:18] [email protected]
as far as I understand, Microsoft TCP transport spec is a private
interface for communicating between .Net server/clients. I would expect
that you will need SOAP/TCP as end point for communicating between php
client and .Net server.
Af course,my knowledge might be outdated on this.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/bug.php?id=50698
--
Edit this bug report at http://bugs.php.net/bug.php?id=50698&edit=1