php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #30302 Implement Document/Literal with wrapped convention
Submitted: 2004-10-01 14:45 UTC Modified: 2022-04-08 08:05 UTC
Votes:63
Avg. Score:4.8 ± 0.5
Reproduced:54 of 55 (98.2%)
Same Version:18 (33.3%)
Same OS:14 (25.9%)
From: julien dot wajsberg at francetelecom dot com Assigned: ilutov (profile)
Status: Closed Package: SOAP related
PHP Version: 5.2.6 OS: Windows XP
Private report: No CVE-ID: None
 [2004-10-01 14:45 UTC] julien dot wajsberg at francetelecom dot com
Description:
------------
The mode "Document/literal with wrapped convention" is the current industry consensus for exposing Web Services. In particular, the WS-I explicitely forbids use of "RPC/encoded" mode, and most toolkits vendors are working towards "document wrapped/literal".

A very good explanation of this convention can be found on http://www.burtongroup.com/weblogs/annethomasmanes/archives/2004/04/000187.html

I would suggest adding another mode to the "style" options to SoapClient constructor: SOAP_WRAPPED.
There should also be some logic to understand a wsdl using this convention, but it could be done afterwards.

This convention is really very similar to "rpc/literal" mode; I didn't test this mode, but if it's already functional, it shouldn't be hard to implement "document wrapped/literal".



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-01 18:26 UTC] dmitry@php.net
ext/soap works fine with this WSDL file.

To call function on a client side use:

$client->add(array("arg1"=>2,"arg2"=>3));

On server side you can use the following function:

function add($args) {
  return $args->arg1 + $args->arg2;
}


 [2005-04-18 22:21 UTC] peter dot ordal at rochester dot edu
The article linked in the initial report has been taken down, but is available via archive.org.

http://web.archive.org/web/20041012031835/http://www.burtongroup.com/weblogs/annethomasmanes/archives/2004/04/000187.html

There are some formatting issues to watch out for.

I tried dmitry's idea but I just get an emtpy stdClass object back.
 [2005-04-19 09:31 UTC] julien dot wajsberg at francetelecom dot com
Yes, the new location for the article is :

http://atmanes.blogspot.com/2005/03/wrapped-documentliteral-convention.html
 [2007-09-21 01:16 UTC] php-bugs-0709 at nico dot edtinger dot at
(Sorry to comment on this old bug)

While it's possible to use doc/lit wrapped with SoapClient and SoapServer it's a bit ugly because the child elements don't wrap directly to the method parameters.

As doc/lit wrapped is used very often and sometimes the only possibility it would still be nice to use it directly so you can write:

$client->add(2, 3); 

on the client side and:

function add($arg1, $arg2) {
  return $arg1 + $arg2;
} 

on the server side. It would make SOAP transparent to handling class, as it currently does with rpc/enc.
 [2007-12-09 01:58 UTC] brian dot nelson at chordiant dot com
I am also experiencing this problem. I don't think that it's even a question that this isn't implemented.

I am running PHP 5.2.3 on Ubuntu (PHP 5.2.3-1ubuntu6.2) and trying to use ClearSpace SOAP calls. It's dirty enough to get the authentication working, but the calling of methods through __soapCall is pretty nasty. .NET, Java, and C# all support wrapped methods. It's sad that PHP doesn't. 

I know that there is some work around PHP6 for SOAP connectivity, but it would be really nice if we could work well with other systems in PHP5.

Here's the CS soap doc:
http://www.jivesoftware.com/builds/docs/clearspace/latest/ClearspaceWebServicesDevGuide.html#ClearspaceWebServicesDevGuide-WebServiceStyle
 [2008-07-03 14:52 UTC] julien dot wajsberg at francetelecom dot com
Although I've no more time to contriute to this but, someone requested me to reopen the bug so that he could contribute.
 [2008-07-03 15:33 UTC] carmi at avaya dot com
We are working with Zend and need to connect with Axis 2.0 which doesn't support rpc/encoding so we need to support document/literal wrapped.

As stated below, Zend 5.2 also doen't support for document/literal wrapped WSDL generation.
 [2008-10-02 23:19 UTC] ankurbarua at gmail dot com
Does ext/soap now support Document/Literal Wrapped convention? i am still not able to make is work with 5.2.6.
 [2010-12-20 14:04 UTC] jani@php.net
-Summary: SOAP: Implement Document/Literal with wrapped convention +Summary: Implement Document/Literal with wrapped convention -Package: Feature/Change Request +Package: SOAP related
 [2015-09-11 08:57 UTC] driezasson at me dot com
Is it possible that this is not fixed in PHP 5.4.45? Using document/literal with PHP SoapServer results in “Procedure '…' not present” error.
 [2015-10-12 07:31 UTC] nokiamstr at tlen dot pl
In PHP 5.3.5-1ubuntu7.11 This error causes me no answer at random server even though the data are generated . Client reports Error fetching the http headers in the SoapClient... Please fix it :)
 [2017-10-24 07:52 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: dmitry +Assigned To:
 [2022-04-08 08:05 UTC] ilutov@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: ilutov
 [2022-04-08 08:05 UTC] ilutov@php.net
Given how old this issue is this is unlikely to happen unless somebody creates a PR. We're closing feature requests on bugs.php.net, if this is still relevant please create a new issue on GitHub.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 20:01:31 2024 UTC