f00b4r / nusoap

:smirk: Fixed NuSOAP for PHP 5.6 - 8.2
https://f00b4r.github.io/nusoap/
318 stars 355 forks source link

Feature: Added support for "literal wrapped". #100

Closed deivide closed 1 year ago

deivide commented 1 year ago

I used the https://github.com/DimitriCodeurs/nusoap package for a few years, but this package has been unsupported for 6 years, forcing me to create my own fork and make the necessary adjustments.

With that, I decided to migrate to a package with more contributors, where I can also contribute with it, but to be able to use this package in my use case, I needed to add a few lines of code taken from the old package, which adapts the library to my needs.

Basically, it is an adaptation to the needs of some specific SOAP servers, where no nsPrefix is foreseen. I don't know if I was able to explain this feature correctly, but the code can speak for itself:

// wrap document/literal wrapped calls with operation element
if ($usewrapped) {
  // (This code block was based on http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/
  // and tailored to the needs of one specific SOAP server, where no nsPrefix was seen...
  $this->debug("wrapping document request with literal method element");

  if ($namespace) {
    $payload = "<$operation xmlns=\"$namespace\">" .
        $payload .
             "</$operation>";
  } else {
    $payload = "<$operation>" . $payload . "</$operation>";
  }
}
f3l1x commented 1 year ago

Thank you