Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem to understand how to access the respons element #519

Closed
ccievoiceoks opened this issue May 17, 2024 · 10 comments
Closed

Problem to understand how to access the respons element #519

ccievoiceoks opened this issue May 17, 2024 · 10 comments

Comments

@ccievoiceoks
Copy link

Q A
Version 3.2

Support Question

Hi again ,

Finally I made it work to query my cisco AXL device with the SOAP request.
I manage it to work because there was also an issue with SSL but as you have already answered in other issues .
PSR-18 is not accepting stream_context

So I have to manage to use Guzzle wit PSR18-Transport options if have well understood what you proposed in the issue #397.

Sorry to come back to you with a silly question but as newbie in OOP and with all concepts introduced in your package.
I'm trying to decode as much as I can

So I'm receiving for example the following output

object(Phpro\SoapClient\Type\MixedResult)#72 (1) {
  ["result":"Phpro\SoapClient\Type\MixedResult":private]=>
  object(stdClass)#71 (1) {
    ["return"]=>
    object(stdClass)#9756 (1) {
      ["componentVersion"]=>
      object(stdClass)#9757 (1) {
        ["version"]=>
        string(16) "15.0.1.10000(32)"
      }
    }
  }
}

I don't know how to access the element that the response provided me , so in that case the value 15.0.0.1.10000(32)
Indeed I can't access the result options as it is a private element

I know that it is a silly question but can you help me on this ?

$client = AxlClientFactory::factory(__DIR__ . '/AXL/AXLAPI.wsdl');
$request = new MultiArgumentRequest([]);
$response = $client->getCCMVersion($request);
var_dump($response);

Many thanks

Olivier

@veewee
Copy link
Contributor

veewee commented May 17, 2024

Hello,

I just got back to you on previous message regarding the lack of types:
See #517 (comment) and comment below.

This is what is making it hard for you to get to the information you need: As you can see, you currently need to use mixed requests and responses because it is not able to figure out what types it is talking about.

If you update the wsdl dependency and regenerate the types and classmap, you should get the types you need on which you can access the data you are looking for.

composer update php-soap/wsdl

./vendor/bin/soap-client generate:classmap --config=yourconfig.php
./vendor/bin/soap-client generate:types --config=yourconfig.php

Can you try that first to see if that makes things easier for you?

@ccievoiceoks
Copy link
Author

Many thanks ,

I have updated the dependency and now it was able to generate the classmap type and so on
I'm moving on .

Now still trying to understand how to use correctly . If i'm looking at the getCCMVersion method as exposed previously .
Normally I should be able to query the system without "any parameter".

So for example the method is requesting a parameter for this

Fatal error: Uncaught ArgumentCountError: Too few arguments to function App\AxlClient::getCCMVersion(), 0 passed in /Users/oks/Herd/trial/app/test.php on line 14 and exactly 1 expected in /Users/oks/Herd/trial/app/AxlClient.php:15073

or If I'm passing a null argument or null array ... it is answering that my type is wrong .
like

Fatal error: Uncaught TypeError: App\AxlClient::getCCMVersion(): Argument #1 ($axlParams) must be of type App\Type\GetCCMVersion, string given, called in /Users/oks/Herd/trial/app/test.php on line 14 and defined in /Users/oks/Herd/trial/app/AxlClient.php:15073

or

Fatal error: Uncaught TypeError: App\AxlClient::getCCMVersion(): Argument #1 ($axlParams) must be of type App\Type\GetCCMVersion, array given, called in /Users/oks/Herd/trial/app/test.php on line 14 and defined in /Users/oks/Herd/trial/app/AxlClient.php:15073

and If'm looking the definitions of the GetCCMVersionReq type
I have for example the following

<?php

namespace App\Type;

class GetCCMVersionReq
{
    /**
     * @var null | string
     */
    private ?string $processNodeName;

    /**
     * @return null | string
     */
    public function getProcessNodeName() : ?string
    {
        return $this->processNodeName;
    }

    /**
     * @param null | string $processNodeName
     * @return static
     */
    public function withProcessNodeName(?string $processNodeName) : static
    {
        $new = clone $this;
        $new->processNodeName = $processNodeName;

        return $new;
    }
}

I'm may be wrong or I don't understand the type or the variable defintions but I think that I can request it empty .

Can you point me in which format I need to put my $axlparams requested in the AxlClient

A big thank you to you in the time that you have already invested for me :)

Olivier

@ccievoiceoks
Copy link
Author

Can it be in that way that I need to look

So with

$client = AxlClientFactory::factory(__DIR__ . '/AXL/AXLAPI.wsdl');
$request = new GetCCMVersion();
$response = $client->getCCMVersion($request);
var_dump($response);

I got

Fatal error: Uncaught ArgumentCountError: Too few arguments to function App\Type\GetCCMVersion::__construct(), 0 passed in /Users/oks/Herd/trial/app/test.php on line 14 and exactly 1 expected in /Users/oks/Herd/trial/app/Type/GetCCMVersion.php:19

and if I'm pushing an empty string ,

$client = AxlClientFactory::factory(__DIR__ . '/AXL/AXLAPI.wsdl');
$request = new GetCCMVersion('');
$response = $client->getCCMVersion($request);
var_dump($response);

then I got the following answer:


Fatal error: Uncaught Psl\Type\Exception\AssertException: Expected "App\Type\GetCCMVersionResponse", got "Phpro\SoapClient\Type\MixedResult". in /Users/oks/Herd/trial/vendor/azjezz/psl/src/Psl/Type/Exception/AssertException.php:32
Stack trace:
#0 /Users/oks/Herd/trial/vendor/azjezz/psl/src/Psl/Type/Internal/InstanceOfType.php(69): Psl\Type\Exception\AssertException::withValue(Object(Phpro\SoapClient\Type\MixedResult), 'App\\Type\\GetCCM...', Object(Psl\Type\Exception\TypeTrace))
#1 /Users/oks/Herd/trial/app/AxlClient.php(15077): Psl\Type\Internal\InstanceOfType->assert(Object(Phpro\SoapClient\Type\MixedResult))
#2 /Users/oks/Herd/trial/app/test.php(15): App\AxlClient->getCCMVersion(Object(App\Type\GetCCMVersion))
#3 {main}
  thrown in /Users/oks/Herd/trial/vendor/azjezz/psl/src/Psl/Type/Exception/AssertException.php on line 32

Olivier

@ccievoiceoks
Copy link
Author

ok I think that the structure that I need to send is the second one if I'm understanding well the documentation
So this form :

$client = AxlClientFactory::factory(__DIR__ . '/AXL/AXLAPI.wsdl');
$request = new GetCCMVersion('');
$response = $client->getCCMVersion($request);
var_dump($response);

But I still have some issue with the Answer.
How can I debug a little more to see what's happening there

atal error: Uncaught Psl\Type\Exception\AssertException: Expected "App\Type\GetCCMVersionResponse", got "Phpro\SoapClient\Type\MixedResult". in /Users/oks/Herd/trial/vendor/azjezz/psl/src/Psl/Type/Exception/AssertException.php:32
Stack trace:
#0 /Users/oks/Herd/trial/vendor/azjezz/psl/src/Psl/Type/Internal/InstanceOfType.php(69): Psl\Type\Exception\AssertException::withValue(Object(Phpro\SoapClient\Type\MixedResult), 'App\\Type\\GetCCM...', Object(Psl\Type\Exception\TypeTrace))
#1 /Users/oks/Herd/trial/app/AxlClient.php(15077): Psl\Type\Internal\InstanceOfType->assert(Object(Phpro\SoapClient\Type\MixedResult))
#2 /Users/oks/Herd/trial/app/test.php(15): App\AxlClient->getCCMVersion(Object(App\Type\GetCCMVersion))
#3 {main}
  thrown in /Users/oks/Herd/trial/vendor/azjezz/psl/src/Psl/Type/Exception/AssertException.php on line 32

Many thanks

Olivier

@veewee
Copy link
Contributor

veewee commented May 18, 2024

Hello,

Yes, thats the way to request it.
However, you might need to set it to null instead of an empty string:

$request = new GetCCMVersion(null);

You can start debuggin the issue here:

if (!$result instanceof ResultInterface) {
$result = new MixedResult($result);
}

The response coming back from the soap server should implement Phpro\SoapClient\Type\ResultInterface, which it does not for some reason. Which is odd, because the result is GetCCMVersionResponse which should be a ResultInterface.

You might want tot dump the mixed result object before the error is triggered to see what's inside of it.
It might be that you are receiving some kind of error that does not get transformed into an exception or something similar.

@ccievoiceoks
Copy link
Author

ccievoiceoks commented May 18, 2024

Hi ,

Here is what I got as answer to the var_dump

It is like if it is requesting all API in the request .
And the answer to the one that we request is well present

object(Phpro\SoapClient\Type\MixedResult)#4647 (1) {
  ["result":"Phpro\SoapClient\Type\MixedResult":private]=>
  object(App\Type\GetCCMVersionRes)#4646 (1) {
    ["sequence":"App\Type\APIResponse":private]=>
    uninitialized(?int)
    ["return":"App\Type\GetCCMVersionRes":private]=>
    object(App\Type\ReturnType)#14331 (1) {
      ["sipProfile":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\ORSipProfile)
      ["sipTrunkSecurityProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["timePeriod":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["timeSchedule":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["todAccess":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["voiceMailPilot":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["processNode":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["callerFilterList":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["routePartition":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["css":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["callManager":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["expresswayCConfiguration":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["mediaResourceGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["mediaResourceList":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["region":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["aarGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["physicalLocation":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["customer":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["routeGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["devicePool":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["deviceMobilityGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["location":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["softKeyTemplate":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["transcoder":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["commonDeviceConfig":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["resourcePriorityNamespace":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["resourcePriorityNamespaceList":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["deviceMobility":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["cmcInfo":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["credentialPolicy":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["facInfo":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["huntList":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["ivrUserLocale":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["lineGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["recordingProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["routeFilter":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["callManagerGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["userGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["dialPlan":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["dialPlanTag":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["ddi":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["mobileSmartClientProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["processNodeService":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["mohAudioSource":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["dhcpServer":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["dhcpSubnet":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["callPark":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["directedCallPark":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["meetMe":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["conferenceNow":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["mobileVoiceAccess":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RMobileVoiceAccess)
      ["routeList":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["user":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["appUser":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["sipRealm":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["phoneNtp":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["dateTimeGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["presenceGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["geoLocation":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["srst":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["mlppDomain":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["cumaServerSecurityProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["applicationServer":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["applicationUserCapfProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["endUserCapfProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["serviceParameter":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["geoLocationFilter":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["voiceMailProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["voiceMailPort":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["gatekeeper":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["phoneButtonTemplate":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["commonPhoneConfig":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["messageWaiting":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["ipPhoneServices":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["ctiRoutePoint":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["transPattern":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\ORTransPattern)
      ["callingPartyTransformationPattern":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["sipRoutePattern":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["huntPilot":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["routePattern":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["applicationDialRules":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["directoryLookupDialRules":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["phoneSecurityProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["sipDialRules":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["conferenceBridge":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["annunciator":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["interactiveVoiceResponse":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["mtp":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["fixedMohAudioSource":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RFixedMohAudioSource)
      ["remoteDestinationProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["line":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\ORLine)
      ["defaultDeviceProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["h323Phone":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["mohServer":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["h323Trunk":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["phone":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\ORPhone)
      ["h323Gateway":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["deviceProfile":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\ORDeviceProfile)
      ["remoteDestination":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["vg224":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RVg224)
      ["gateway":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["gatewayEndpointAnalogAccess":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RGatewayEndpointAnalogAccess)
      ["gatewayEndpointDigitalAccessPri":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RGatewayEndpointDigitalAccessPri)
      ["gatewayEndpointDigitalAccessBri":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RGatewayEndpointDigitalAccessBri)
      ["gatewayEndpointDigitalAccessT1":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RGatewayEndpointDigitalAccessT1)
      ["ciscoCatalyst600024PortFXSGateway":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["ciscoCatalyst6000E1VoIPGateway":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["ciscoCatalyst6000T1VoIPGatewayPri":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["ciscoCatalyst6000T1VoIPGatewayT1":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["callPickupGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["routePlan":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["geoLocationPolicy":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["sipTrunk":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["calledPartyTransformationPattern":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["externalCallControlProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["safSecurityProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["safForwarder":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["ccdHostedDN":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["ccdHostedDNGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["ccdRequestingService":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RCcdRequestingService)
      ["interClusterServiceProfile":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RInterClusterServiceProfile)
      ["remoteCluster":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["ccdAdvertisingService":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["ldapDirectory":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["emccFeatureConfig":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\REmccFeatureConfig)
      ["safCcdPurgeBlockLearnedRoutes":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["vpnGateway":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["vpnGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["vpnProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["imeServer":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["imeRouteFilterGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["imeRouteFilterElement":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["imeClient":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["imeEnrolledPattern":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["imeEnrolledPatternGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["imeExclusionNumber":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["imeExclusionNumberGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["imeFirewall":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["imeE164Transformation":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["transformationProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["fallbackProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["ldapFilter":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["tvsCertificate":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["featureControlPolicy":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["mobilityProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["enterpriseFeatureAccessConfiguration":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["handoffConfiguration":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RHandoffConfiguration)
      ["calledPartyTracing":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["sIPNormalizationScript":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["customUserField":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["gatewaySccpEndpoints":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RGatewaySccpEndpoints)
      ["billingServer":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RBillingServer)
      ["lbmGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["announcement":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["serviceProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["ldapSyncCustomField":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["audioCodecPreferenceList":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["ucService":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["lbmHubGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["importedDirectoryUriCatalogs":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["vohServer":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["sdpTransparencyProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["featureGroupTemplate":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["dirNumberAliasLookupandSync":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["localRouteGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["advertisedPatterns":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["blockedLearnedPatterns":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["cCAProfiles":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["universalDeviceTemplate":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["userProfileProvision":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["presenceRedundancyGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["assignedPresenceServers":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["unassignedPresenceServers":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["assignedPresenceUsers":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["unassignedPresenceUsers":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["wifiHotspot":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["wlanProfileGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["wLANProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["universalLineTemplate":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["networkAccessProfile":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["licensedUser":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["httpProfile":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RHttpProfile)
      ["elinGroup":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["secureConfig":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RSecureConfig)
      ["unassignedDevice":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["registrationDynamic":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["infrastructureDevice":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["ldapSearch":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["wirelessAccessPointControllers":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["phoneActivationCode":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["deviceDefaults":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["mraServiceDomain":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["ciscoCloudOnboarding":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["row":"App\Type\ReturnType":private]=>
      uninitialized(array)
      ["rowsUpdated":"App\Type\ReturnType":private]=>
      uninitialized(int)
      ["userAuthenticated":"App\Type\ReturnType":private]=>
      uninitialized(bool)
      ["code":"App\Type\ReturnType":private]=>
      uninitialized(int)
      ["daysToExpiry":"App\Type\ReturnType":private]=>
      uninitialized(?int)
      ["isWarningNeeded":"App\Type\ReturnType":private]=>
      uninitialized(?bool)
      ["os":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\XOSVersion)
      ["mobility":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RMobility)
      ["enterprisePhoneConfig":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\XEnterprisePhoneConfig)
      ["ldapSystem":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\XLdapSystem)
      ["ldapAuthentication":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\XLdapAuthentication)
      ["componentVersion":"App\Type\ReturnType":private]=>
      object(App\Type\ComponentVersion)#14332 (1) {
        ["version":"App\Type\ComponentVersion":private]=>
        string(16) "15.0.1.10000(32)"
      }
      ["fallbackFeatureConfig":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RFallbackFeatureConfig)
      ["imeLearnedRoutes":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RImeLearnedRoutes)
      ["imeFeatureConfig":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RImeFeatureConfig)
      ["appServerInfo":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RAppServerInfo)
      ["softKeySet":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RSoftKeySet)
      ["syslogConfiguration":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RSyslogConfiguration)
      ["ilsConfig":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\NewIlsConfig)
      ["SNMPCommunityString":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RSNMPCommunityString)
      ["SNMPUser":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RSNMPGetUser)
      ["SNMPMIB2List":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RSNMPMIB2List)
      ["ccdFeatureConfig":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\XCcdFeatureConfig)
      ["pageLayoutPreferences":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RPageLayoutPreferences)
      ["credentialPolicyDefault":"App\Type\ReturnType":private]=>
      uninitialized(App\Type\RCredentialPolicyDefault)
    }
  }
}

Fatal error: Uncaught Psl\Type\Exception\AssertException: Expected "App\Type\GetCCMVersionResponse", got "Phpro\SoapClient\Type\MixedResult". in /Users/oks/Herd/trial/vendor/azjezz/psl/src/Psl/Type/Exception/AssertException.php:32
Stack trace:
#0 /Users/oks/Herd/trial/vendor/azjezz/psl/src/Psl/Type/Internal/InstanceOfType.php(69): Psl\Type\Exception\AssertException::withValue(Object(Phpro\SoapClient\Type\MixedResult), 'App\\Type\\GetCCM...', Object(Psl\Type\Exception\TypeTrace))
#1 /Users/oks/Herd/trial/app/AxlClient.php(15077): Psl\Type\Internal\InstanceOfType->assert(Object(Phpro\SoapClient\Type\MixedResult))
#2 /Users/oks/Herd/trial/app/test.php(15): App\AxlClient->getCCMVersion(Object(App\Type\GetCCMVersion))
#3 {main}
  thrown in /Users/oks/Herd/trial/vendor/azjezz/psl/src/Psl/Type/Exception/AssertException.php on line 32

The answer is presnet

["componentVersion":"App\Type\ReturnType":private]=>
      object(App\Type\ComponentVersion)#14332 (1) {
        ["version":"App\Type\ComponentVersion":private]=>
        string(16) "15.0.1.10000(32)"
      }

@veewee
Copy link
Contributor

veewee commented May 21, 2024

As mentioned : It seems like GetCCMVersionRes is not implementing ResultInterface, which it should.
However, when I generate the code, it is named GetCCMVersionResponse.

The Return type indeed contains a combined object since the name of de type is not unique.
More info about why this works like it works : https://github.com/phpro/soap-client/blob/v3.x/docs/known-issues/ext-soap.md#duplicate-typenames

@ccievoiceoks
Copy link
Author

Hi Tom ,

Even with the duplicate strategy in the factory , it is not working
It is not working as in fact I think that the XSD defition is not proper for your implementation and with all the request present in the wsdl/xsd defintion , it will difficult to correct everything

In fact for every "element" that I need , I have if I can say like this 4 elements.

So If i'm taking back the example of getCCMversion , i have the following

  • getCCMVersion
  • getCCMVersionReq
  • getCCMVersionRes
  • getCCMVersionResponse

And I think that it is for all element. So even If I'm updating the classRes to implement a ResultInterface , as you said it is not implementing it . It wants to use another definition

Also I found also that for the List elements requests , I need for example the class SearchCriteria but I can't initialize it because there is no constructor so I can't defined my parameter and I'm guessing that it will be the same for the Returned Tags .

I don't know why they implement the structure like that .
If you look the dictionary in the following file/link
Cucm AXL 15 Dictionnary

You will find the 4 definition
like
CleanShot 2024-05-22 at 10 17 22

CleanShot 2024-05-22 at 10 18 21

CleanShot 2024-05-22 at 10 20 00

CleanShot 2024-05-22 at 10 20 34

I will continue to read and document myself to see how I can overcome this as it is so new for me but I don't think that I will be able to use your functionality right now and it is damage but you have done an amazing job on it !!!

Thank you
Olivier

@ccievoiceoks
Copy link
Author

Can it be related as well to specific Rules or Assemblers ?

Olivier

@veewee
Copy link
Contributor

veewee commented May 22, 2024

Hello @ccievoiceoks,

It's indeed a matter of getting the configuration of assemblers and rules right for getting a constructor in the classes where you want them to be.
It could look something like:

->addRule(
    new Rules\TypeMapRule(
        [
            'SearchCriteria' => new Rules\AssembleRule(new Assembler\ConstructorAssembler()),
        ],
        new Rules\MultiRule([])
    )
)

About the response types:

<xsd:complexType name="GetCCMVersionRes"></xsd:complexType>
<xsd:element name="getCCMVersionResponse" type="axlapi:GetCCMVersionRes"/>

Meaning the Response element implements the Res type.
It is being used like this in the method:

<operation name="getCCMVersion">
    <input message="s0:getCCMVersionIn"/>
    <output message="s0:getCCMVersionOut"/>
    <fault name="fault" message="s0:AXLError"/>
</operation>

With

<message name="getCCMVersionIn">
    <part element="xsd1:getCCMVersion" name="axlParams"/>
</message>
<message name="getCCMVersionOut">
    <part element="xsd1:getCCMVersionResponse" name="axlParams"/>
</message>

Meaning that the client expects the type getCCMVersionResponse. Instead, the service seems to return a getCCMVersionRes response which is basically the base-type of the element that it should return.
I'll have to look into similar cases to find out if this is an issue with the soap response or rather PHP's soap decoder.

There are some optimizations being done internally for "knowing those are the same thing". I'll take a look at it later to see if I can know somehow they are the same type and should behave like so.

@veewee veewee closed this as completed Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants