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

Issue with parameters structure #57

Open
scramatte opened this issue Feb 1, 2023 · 5 comments
Open

Issue with parameters structure #57

scramatte opened this issue Feb 1, 2023 · 5 comments

Comments

@scramatte
Copy link

Hello,

I need to pass following structure to the SOAP Client:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
               xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <get_voip_account_subscriber xmlns="/SOAP/Provisioning">
         <authentication>
            <type xsi:type="xsd:string">admin</type>
            <username xsi:type="xsd:string">administrator</username>
            <password xsi:type="xsd:string">administrator</password>
         </authentication>
         <parameters>
            <id xsi:type="xsd:int">6</id>
            <username xsi:type="xsd:string">nobody</username>
            <domain xsi:type="xsd:string">example.com</domain>
         </parameters>
      </get_voip_account_subscriber>
   </soap:Body>
</soap:Envelope>

I've tried with the following array as parameters. But it doesn't works.

$params = [
  'authentication' => [
      'type' => 'admin',
      'username' => 'administrator',
     'password' => 'administrator',
  ],
  'parameters' => [
       'id' => 6,
       'username' => 'nobody',
       'domain' => 'example.com'
  ]
]

Anybody can give me an hand with this?

Regards

@krizzdev
Copy link

krizzdev commented Mar 11, 2023

How do you call the method?

I had a similar problem when I used the magic method __call() via:

$client->myMethodName($params)

because when you check the SoapClientRequest.php and check the defined __call() method you will see that it uses only the first part of the $params. ($parameters[0])

public function __call($name, $parameters)
    {
        return $this->call($name, $parameters[0] ?? []);
    }

So directly use the call() method, maybe it will work, because it doesn't take only the first part of $parameters.

$client->call('myMethodName', $params)

If you are already using the call() method, ignore this comment :D

@utsavsomaiya
Copy link

utsavsomaiya commented Mar 13, 2024

@lukeraymonddowning How can i pass multiple parameter to body?

https://help.usaepay.info/api/soap/#token-methods

@utsavsomaiya
Copy link

@lukeraymonddowning
Copy link
Contributor

@nedwors are you able to chime in on this?

@krizzdev
Copy link

maybe my suggested changes here are helping: #61

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

4 participants