Code Monkey home page Code Monkey logo

zend-soap's Introduction

zend-soap's People

Contributors

akrabat avatar bakura10 avatar beberlei avatar dasprid avatar evandotpro avatar ezimuel avatar freeaqingme avatar jonathanmaron avatar keradus avatar kokspflanze avatar koopzington avatar lilobase avatar lku avatar maks3w avatar marc-mabe avatar micheh avatar mikaelkael avatar mpinkston avatar mwillbanks avatar ocramius avatar rafalwrzeszcz avatar ralphschindler avatar samsonasik avatar sasezaki avatar sgehrig avatar thinkscape avatar vahid-sohrabloo avatar veewee avatar wdalmut avatar weierophinney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zend-soap's Issues

SoapClient Trace/Exception Options

In PHP SOAP documentation http://php.net/manual/fr/class.soapclient.php

$client = new SoapClient($url, array("trace" => 1, "exception" => 0));

it's possible to set options trace or exception when we instanciate SoapClient.

Now, in Zend Soap, in src/Client.php line 1051 we can see that trace option is always set to true
and there no way set change its value; and for exception option it seems that there is no default value.
If we try to set trace or exception in options parameters we have an error « Unknown SOAP client option ».

Is there another way to set those values ?

Thanks

Best Regards,
Pascall

Soap\Server::handle() never returns

Hi There,

I'm having a problem when using Soap\Server() but I'm not 100% sure if this is a framework bug or if I'm not using the API correctly (as the documentation is a little sparse on the matter)

If I construct Soap\Server() with WSDL generated from Soap\AutoDiscover->generate(), a very strange thing happens. Upon calling Server->handle(), the framework will bail immediately and prints the following (regardless of ::setReturnResponse) :

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body>
        <SOAP-ENV:Fault>
            <faultcode>SOAP-ENV:Server</faultcode>
            <faultstring>SoapServer::SoapServer(): Invalid parameters</faultstring>
        </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

In addition, anything outputted previously will appear inside a "detail" element appended to the "Fault" element.

What could be causing this?

I look forward to your thoughts. Thanks in advance.

PS I notice there are no bugs here, should I be making this bug somewhere else?

Cannot install with Composer

When I try to install with Composer:

composer require zendframework/zend-soap

I get the following error:

...

  • Installing zendframework/zend-soap (2.8.0): Downloading (100%)

Installation failed, reverting ./composer.json to its original content.

[ErrorException]

copy(/home/user/src/my_project/vendor/composer/1a184f1b/zendframework-zend-soap-8762d79/doc/book/index.md): failed to open stream: No such file or directory

Zend Soap Version: 2.8.0
Operating System: Ubuntu 18.04
PHP Version: 7.2.19
Composer Version: 1.9.0

I got it working at one point in another project by:

rm -rf vendor
rm composer.lock
composer clearcache
composer require zendframework/zend-soap

but now that does not work anymore.

Soapenv:Header in request

Is there a way to accept soapenv:Header data in a request to a soap server?

We are receiving an header data and the server is returning an error because of this header.

<soapenv:Header> <esb:header> <esb:message_type>AddNewOrder</esb:message_type> <esb:version>01.80</esb:version> <esb:source_entity>LPRO</esb:source_entity> <esb:source_application>NOLS</esb:source_application> <esb:destination_entity>KEIT</esb:destination_entity> <esb:destination_application>TIRE</esb:destination_application> </esb:header> </soapenv:Header>

Do we need to define it in the wsdls and if yes how can we do that as we are not able to find it in the documentation.

Custom namespaces

Hi
I need to know if there is a solution to change default namespaces ns1,ns2 etc... with some custom names ?
In my case it's a real problem cause I can't call provider service which is waiting right namespaces instead of ns1...
If I send a structure like
[
data: [
name: xx
age: yy
]
]
Request is changed into
ns2:datans1:namexx</ns1:name> etc...
And provider doesn't understand it ...
Thanks for your help
Best Regards
Pascall

Check Documentation Tables

Check the tables in a document

TLDR; All tables should be in the format of GHFM using | and - as horizontal and vertical separators respectively

Check all tables are in the correct format. Please don't use leading and trailing | - more information on github flavoured markdown tables can be found here.

Check Documentation For Other Things

Check docs for other problems

TLDR; Cast your eye over the documetation for any problems not covered in the other issues

Things slip through the net, so check the documentation for other problems that have been missed. Common other problems include

  • Bullet lists (should be single * then space at the start of line)
  • Inline code - should be marked by three backticks at start and finish
  • bookdown.json file is correctly formated and has the right escaping
  • Links between documentation using RST have been stripped
  • Any other RST has been removed correctly
  • Anything and everything not covered

If you end up fixing the same problem over and over, please ping Gary Hockin - we may be able to add bespoke issue for that problem, or fix in automated capacity

SOAP Autodiscover WSDL

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7552
User: @patrick-hertling
Created On: 2015-05-26T11:24:58Z
Updated At: 2015-11-06T21:54:54Z
Body
A client which developes for .NET enviroment needs the same targetNamespace for the production and test enviroment.

For now using the Autodiscover feature, thats not possible. Becouse once you define the URI, the same value is set for targetNamespace and soap:address "location".

I would need a way to leave the targetNamespace the same, and only change the soap:adresss location in the <service><port><soap:address></></></>to distinguish between production and test enviroment.


Handler processing error

Hi!

I have a soap server like this:

$this->server = new Server();
$this->server->setWSDL($this->wsdl->getPath())->setClass(Received::class);
$this->server->handler()

If i use that works fine when i call $this->server->handler().

But when i want to get the response and process that before return, like:

$this->server = new Server();
$this->server->setWSDL($this->wsdl->getPath())->setClass(Received::class);
$this->server->setReturnResponse(true); // use return instead of echo in response.
$response = $this->server->handler();

echo $response; //this doesn't works

So when i call $response = $this->server->handler(), doesn't work anymore. Have no errors and have no responses. In postman i get "Could not get any response" and in SoapUI i get "".

if i put a dump('ANYTHING') before the call for "$this->server->handler()" works again.

$this->server = new Server();
$this->server->setWSDL($this->wsdl->getPath())->setClass(Received::class);
$this->server->setReturnResponse(true); // use return instead of echo in response.
dump('foobar');
$response = $this->server->handler();

echo $response; //this works

But my return brokes because that dump.

Anyone know what happening? And how i fix that?

I'm using PHP7.1 and Nginx on a Ubuntu.

Soap server client send special chars

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7637
User: @roeimishori
Created On: 2015-10-14T07:02:04Z
Updated At: 2015-10-14T18:28:33Z
Body
tried to send with cdata but didn't work.

$val = '';


Comment

User: @Ocramius
Created On: 2015-10-14T18:23:53Z
Updated At: 2015-10-14T18:23:53Z
Body
@roeimishori check that you are using UTF-8 for your data.


Comment

User: @Ocramius
Created On: 2015-10-14T18:24:29Z
Updated At: 2015-10-14T18:24:29Z
Body
Also, please report this issue in https://github.com/zendframework/zend-soap


Comment

User: @roeimishori
Created On: 2015-10-14T18:28:33Z
Updated At: 2015-10-14T18:28:33Z
Body
Thanks


Server does not parse huge files

$server = new \Zend\Soap\Server(...);
...
$response = $server->handle($request = file_get_contents('php://input'));

When request is more than 10Mb, we get "Invalid XML" error. The cause in Server->setRequest() method:
789 $dom = new DOMDocument();
790 $loadStatus = $dom->loadXML($xml);

, where loadXML(..) method called without param LIBXML_PARSEHUGE.

Is it bug or feature?

Possibility to turn off warnings (as they are redundant due to Exceptions being thrown)

I'm wondering whether it would make sense to be able to turn off warnings coming from SoapClient as I would assume that most people are relying on Exceptions for error-handling?

For example, we use it like this:

<?php
try {
    $client = new \Zend\Soap\Client('https://example.org/?wsdl', [
        'soap_version' => SOAP_1_1,
        'location'     => 'https://example.org/'
    ]);
    $client->myCommand([
        'arg' => 'value'
    ]);
} catch (SoapFault $exception) {
    // Error handling code
}

Occasionally if there's a communication error with the remote endpoint a PHP warning will be logged like this:

[Tue Jun 19 02:14:31 2018] [error] [client x.x.x.x] PHP Warning: SoapClient::__doRequest(): SSL: Connection reset by peer in /xx/vendor/zendframework/zend-soap/src/Client.php on line 1039

At the same time a SoapFaul exception is thrown which is what we use for error-handling so the warning just clogs up our error logs unnecessarily as we're already handling the situation properly.

We're using version 2.7.0 meaning this line points to https://github.com/zendframework/zend-soap/blob/release-2.7.0/src/Client.php#L1032 where SoapClient::__doRequest is called.

I notice that the PHP manual doesn't actually mention that __doRequest can emit warnings, that might in itself be a glitch to file a bug report for regarding the ext-soap documentation?

Anyhow, even if it would be documented we would still need to silence the warnings in zend-soap if they are not wanted.

Would it make sense to switch to return @call_user_func() or introduce a toggle that disables PHP warnings in zend-soap?

Many thanks!

PHP 7.2 support

$errcontext has been deprecrated in 7.2

Just need to remove the last argument here:

public function handlePhpErrors($errno, $errstr, $errfile = null, $errline = null, array $errcontext = null)

and update the TravisCI

Better interoperability for generated WSDL with .net client generation tools

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7196
User: @micheleorselli
Created On: 2015-02-08T19:20:26Z
Updated At: 2015-11-06T20:55:25Z
Body
Lately I worked on exposing SOAP WS to .net client. On the .net side the client classes were generated using the command line tool svcutil.exe which caused some troubles on getting the wsdl right: I needed to add a couple of tweaks to get class generation working as expected.

For this reason I propose two changes:

  • add elementFormDefault="qualified" as attribute of <schema> tag (see Zend\Soap\Wsdl::addSchemaTypeSection
  • make the maxOccours attribute value for sequence elements configurable. As now it's hardcoded to "unbounded" (see Zend\Soap\Wsdl\ArrayOfTypeSequence::_addSequenceType)

Some information of the constraints imposed by .net tools can be found here: https://msdn.microsoft.com/en-us/library/ms733112.aspx

If there's interest on integrating that stuff I'm willing to create a PR


DocumentLiteralWrapper return Unknown error

I try to wrap zend-soap server response to DocumentLiteral

My code:

$options = array('uri' => 'http://localhost/server', 'soap_version' => SOAP_1_2);               
$soap = new \Zend\Soap\Server(null, $options);
$service = new \App\Services\SOAPVendorAPI();
$soap->setObject(new \Zend\Soap\Server\DocumentLiteralWrapper($service));
$response = $soap->handle();

as a response I receive

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
         <faultcode>Receiver</faultcode>
         <faultstring>Unknown error</faultstring>
      </SOAP-ENV:Fault>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

When I tried to debug this issue based on $soap->setReturnResponse(true); the response was:

SoapFault exception: [Receiver] Unknown error in /var/www/vendor/zendframework/zend-soap/src/Server.php:1182 Stack trace: #0 /var/www/vendor/zendframework/zend-soap/src/Server.php(996): Zend\Soap\Server->fault(Object(Zend\Soap\Exception\UnexpectedValueException)) #1 /var/www/app/Http/Controllers/SoapController.php(52): Zend\Soap\Server->handle() #2 [internal function]: App\Http\Controllers\SoapController->server(Object(Illuminate\Http\Request)) #3 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array) #4 /var/www/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('server', Array) #5 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\SoapController), 'server') #6 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\Routing\Route->runController() #7 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(680): Illuminate\Routing\Route->run() #8 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #9 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #10 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure)) #11 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(76): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #12 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure)) #13 /var/www/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #14 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #15 /var/www/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(56): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #16 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #17 /var/www/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #18 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure)) #19 /var/www/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(66): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #20 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure)) #21 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #22 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(682): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #23 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(657): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request)) #24 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(623): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route)) #25 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(612): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request)) #26 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request)) #27 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request)) #28 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #29 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure)) #30 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #31 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure)) #32 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #33 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure)) #34 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(62): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #35 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure)) #36 /var/www/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #37 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure)) #38 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #39 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #40 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request)) #41 /var/www/public/index.php(55): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) #42 {main}

Unfortunately $soap->setObject($service) ; working correcttly (without DocumentLiteralWrapper`

Improve docblock to pick up namespace in Parser as well as class, or at least add it to the docs.

The docs do not contain any warnings about this problem, which makes it annoying to debug. The error occurs when using anything in a namespace. PHPs typical way of dealing with this is to add the (overused) use statement to the top with the namespace and the class.

However, Zend\Soap\AutoDiscover does not pick up that use statement and instead only uses the classname.

<?php

use myNameSpace\MyClass;

class Foo
{
    /**
     * @var MyClass
     */ 
    public $customer;
}

That fails. When Zend parses it, it will not parse the namespace, just the classname "MyClass", and then fail.

For it to work, it must be done like this:

<?php

class Foo
{
    /**
     * The backspace qualifier is only necessary if this is namespaced.
     * @var \myNameSpace\MyClass
     */ 
    public $customer;
}

A code fix is probably above and beyond, but some docs highlighting that problem would help.

[AutoDiscover] Use typehinting on PHP7

Currently AutoDiscover is not using typehint feature from PHP7.
The main problem is that currently SoapServer is returning empty resposnse and status code 202 Accepted.

My service class:

class MyService
{
    /**
     * @param string $x
     * @return string
     */
    public function test(string $x): string
    {
        return $x;
    }
}

Expected

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
             xmlns:tns="http://localhost/api/My" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" name="MyService"
             targetNamespace="http://localhost/api/My">
    <types>
        <xsd:schema targetNamespace="http://localhost/api/My"/>
    </types>
    <portType name="MyServicePort">
        <operation name="test">
            <documentation>test</documentation>
            <input message="tns:testIn"/>
            <output message="tns:testOut"/>
        </operation>
    </portType>
    <binding name="MyServiceBinding" type="tns:MyServicePort">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="test">
            <soap:operation soapAction="http://localhost/api/My#test"/>
            <input>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                           namespace="http://localhost/api/My"/>
            </input>
            <output>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                           namespace="http://localhost/api/My"/>
            </output>
        </operation>
    </binding>
    <service name="MyServiceService">
        <port name="MyServicePort" binding="tns:MyServiceBinding">
            <soap:address location="http://localhost/api/My"/>
        </port>
    </service>
    <message name="testIn">
        <part name="x" type="xsd:string"/>
    </message>
    <message name="testOut">
        <part name="return" type="xsd:string"/>
    </message>
</definitions>

Actual

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
             xmlns:tns="http://localhost/api/My" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" name="MyService"
             targetNamespace="http://localhost/api/My">
    <types>
        <xsd:schema targetNamespace="http://localhost/api/My"/>
    </types>
    <portType name="MyServicePort">
        <operation name="test">
            <documentation>test</documentation>
            <input message="tns:testIn"/>
        </operation>
    </portType>
    <binding name="MyServiceBinding" type="tns:MyServicePort">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="test">
            <soap:operation soapAction="http://localhost/api/My#test"/>
            <input>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                           namespace="http://localhost/api/My"/>
            </input>
        </operation>
    </binding>
    <service name="MyServiceService">
        <port name="MyServicePort" binding="tns:MyServiceBinding">
            <soap:address location="http://localhost/api/My"/>
        </port>
    </service>
    <message name="testIn">
        <part name="x" type="xsd:anyType"/>
    </message>
</definitions>

Check For Blockquotes In Docs

Check the document for bad blockquoutes

TLDR; Check blockquotes are formatted correctly using > and check headings in blockquotes are using ###

Blockquotes are donated by a single greater than character and then a space. Make sure all the blockquotes in every doc file are correctly formatted. Headings in blockquotes should use ### and not bold.

Any paragraph spacing in blockquotes should be marked using a single greater than, then a space.

Check Documentation Code Blocks

Check code blocks are correct

TLDR; Check in all files that codeblocks are correct, in PSR-2 format and have PHP syntax highlighting applied.

Code blocks should be in the following format...

```php
 'ZEND-FRAMEWORK');

// No required options
$rendererOptions = array();
$renderer = Barcode::factory(
    'code39', 'image', $barcodeOptions, $rendererOptions
);

```

Note the three backticks then php in the opening fence, and the closing fence is just three backticks. It's common for the opening backticks to have no code type, or something like source.

Code should also have been automatically formatted into PSR-2 format, but sometimes these slip through the net.

Check All Headers In Documentation

Check headers are correct

TLDR; Headers should use the #, ## etc to format different levels of headers, and not be underlines using ===== or ``-----`, or be psuedo header using bold

Check all headers on the documentation - headers should use the hash style of declaration rather then be underlined with equals or dashes. The more hashes, the more of a subheading. Eg:

  • # is equal to <h1>
  • ## is equal to <h2>
  • ### is equal to <h3>
  • #### is equal to <h4>
  • ##### is equal to <h5>

Headings should be appropriate for their level in the documentation.

Psuedo headers using bold tags ** should be replaced with appropriate level of heading tag.

Autodiscovery docs are incomplete

The auto-discovery.md docs contain following text:

There are three configurations for SOAP applications supported by zend-soap:

SOAP server PHP application <---> SOAP client PHP application
SOAP server non-PHP application <---> SOAP client PHP application
SOAP server PHP application <---> SOAP client non-PHP application

But what is the difference? How to set up each of these configutrations?

Can not run soap server using document-style binding

I'm trying to use document-style binding startegy with following test code:

<?php
include '../vendor/autoload.php';

ini_set("soap.wsdl_cache_enabled", "0");

class MyClass {
	/**
	 * @param string $inputParam
	 * @param string $inputParam2
	 * @return string
	 */
    public function method1($inputParam, $inputParam2) {
        return "$inputParam $inputParam2";
    }
}

if ($_SERVER['REQUEST_METHOD'] == 'GET') {
    if (isset($_GET['wsdl'])) {
		// WSDL code
		$autodiscover = new Zend\Soap\AutoDiscover();
		$autodiscover
			->setBindingStyle([
				'style' => 'document',
			])
			->setClass('MyClass')
			->setUri('http://localhost.loc/test.php');
		header('Content-Type: text/xml');
		echo $autodiscover->toXml();
	} else {
		// Client code
		$client = new Zend\Soap\Client('http://localhost/test.php?wsdl');
		print_r($client->method1(22, 'some string'));
	}
} else {
	// Server code
	$soap = new Zend\Soap\Server("http://localhost/test.php?wsdl");
	$soap->setClass('MyClass');
	$soap->handle();
}

But when I try to run this script I get error:

SoapFault: Error cannot find parameter in C:\usr\work\amayama\amayama-eng\vendor\zendframework\zend-soap\src\Client.php on line 1166

If I remove the binding style config - it work fine. What I do wrong?

syntax error, unexpected '?' in PHP7.0

…\vendor\zendframework\zend-code\src\Reflection\DocBlock\Tag\VarTag.php69

public function getVariableName() : ?string
{
return $this->variableName;
}

zend

Soap: Autodiscover encodes service URI twice

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7541
User: @LastDragon-ru
Created On: 2015-05-20T09:06:27Z
Updated At: 2015-11-06T21:40:25Z

<?php
class TestService {
    /**
     * @return string
     */
    public function test() {
        return __METHOD__;
    }
}

$wsdl         = './service.xml';
$wsdlUri      = 'http://127.0.0.1/soap/server.php?a=a&b=b';
$autodiscover = new \Zend\Soap\AutoDiscover();

$autodiscover->setUri($wsdlUri);
$autodiscover->setClass('TestService');

$autodiscover->dump($wsdl);

WSDL:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://127.0.0.1/soap/server.php?a=a&amp;b=b" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" name="TestService" targetNamespace="http://127.0.0.1/soap/server.php?a=a&amp;amp;b=b">
    <types>
        <xsd:schema targetNamespace="http://127.0.0.1/soap/server.php?a=a&amp;amp;b=b" />
    </types>
    <portType name="TestServicePort">
        <operation name="test">
            <documentation>test</documentation>
            <input message="tns:testIn" />
            <output message="tns:testOut" />
        </operation>
    </portType>
    <binding name="TestServiceBinding" type="tns:TestServicePort">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
        <operation name="test">
            <soap:operation soapAction="http://127.0.0.1/soap/server.php?a=a&amp;amp;b=b#test" />
            <input>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://127.0.0.1/soap/server.php?a=a&amp;amp;b=b" />
            </input>
            <output>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://127.0.0.1/soap/server.php?a=a&amp;amp;b=b" />
            </output>
        </operation>
    </binding>
    <service name="TestServiceService">
        <port name="TestServicePort" binding="tns:TestServiceBinding">
            <soap:address location="http://127.0.0.1/soap/server.php?a=a&amp;amp;b=b" />
        </port>
    </service>
    <message name="testIn" />
    <message name="testOut">
        <part name="return" type="xsd:string" />
    </message>
</definitions>

WSDL file contains &amp; instead of & in attributes (non critical) and soap:address@location (critical)


Unable to influence \SoapFault::$code from Zend\Soap\Server::fault()

In Zend\Soap\Server::fault (https://github.com/zendframework/zf2/blob/master/library/Zend/Soap/Server.php#L1067) there is the functionality to transform an exception which is preregisterd with Zend\Soap\Server using the method registerFaultException.

Following the logic at line 1072, and $fault is an exception $code becomes the exception error code. The base class exception from PHP libraries defines \Exception::$code as an integer, which is tested in the constructor, and protected with final methods. This has the effect that \Exception::getCode() always returns an integer value.

On line 1086 this value is tested against an array of string values, therefor never making a match, causing the $code variable always being set to 'Receiver' on line 1087.

Original: zendframework/zendframework#6770

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.