Skip to content

Commit

Permalink
envelope for server
Browse files Browse the repository at this point in the history
  • Loading branch information
goetas committed Jan 3, 2021
1 parent af2d4e7 commit 5874112
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
6 changes: 4 additions & 2 deletions src/Generation/JmsSoapConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ private function visitMessage(OperationMessage $message, $hint = '', \GoetasWebs
$envelopeData["xml_root_namespace"] = $this->soapEnvelopeNs;
$envelopeData["xml_namespaces"] = ['SOAP' => $this->soapEnvelopeNs];

$envelopeData["accessor_order"] = 'custom';
$envelopeData["custom_accessor_order"] = ['header', 'body'];

$property = [];
$property["expose"] = true;
$property["access_type"] = "public_method";
Expand All @@ -130,8 +133,7 @@ private function visitMessage(OperationMessage $message, $hint = '', \GoetasWebs
$property = [];
$property["expose"] = true;
$property["access_type"] = "public_method";
// $property["type"] = 'GoetasWebservices\SoapServices\Metadata\Arguments\Headers\Handler\HeaderPlaceholder<\''.$className.'\'>';
$property["type"] = $className;
$property["type"] = 'GoetasWebservices\SoapServices\Metadata\Headers\Handler\HeaderPlaceholder<\''.$className.'\'>';

$property["serialized_name"] = 'Header';
$property["xml_element"]["namespace"] = $this->soapEnvelopeNs;
Expand Down
7 changes: 1 addition & 6 deletions src/Generation/PhpSoapConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ private function visitMessage(OperationMessage $message, $hint, \GoetasWebservic
$envelopeClass = new PHPClass();
$envelopeClass->setName(Inflector::classify($name));
$envelopeClass->setNamespace($ns . $this->baseNs[$service->getVersion()]['messages']);
$envelopeClass->setImplements(['GoetasWebservices\SoapServices\Metadata\Envelope\Envelope']);
$this->classes[$envelopeClass->getFullName()] = $envelopeClass;

if ($message->getBody()->getParts()) {
Expand All @@ -88,12 +89,6 @@ private function visitMessage(OperationMessage $message, $hint, \GoetasWebservic
$headerClass->setName(Inflector::classify($name));
$headerClass->setNamespace($ns . $this->baseNs[$service->getVersion()]['headers']);

$topHeader = new PHPClass();
$topHeader->setName('HeaderPlaceholder');
$topHeader->setNamespace('GoetasWebservices\SoapServices\Metadata\Arguments\Headers\Handler');

$headerClass->setExtends($topHeader);

$this->classes[$headerClass->getFullName()] = $headerClass;

$envelopeClass->addProperty($property);
Expand Down
2 changes: 1 addition & 1 deletion src/Generation/SoapConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private function visitMessage(OperationMessage $message, $hint = '', \GoetasWebs
$property = [];
$property["expose"] = true;
$property["access_type"] = "public_method";
$property["type"] = count($message->getHeaders()) ? $className : 'GoetasWebservices\SoapServices\Metadata\Arguments\Headers\Handler\HeaderPlaceholder';
$property["type"] = count($message->getHeaders()) ? $className : 'GoetasWebservices\SoapServices\Metadata\Headers\Handler\HeaderPlaceholder';
$property["serialized_name"] = 'Header';
$property["xml_element"]["namespace"] = $this->soapEnvelopeNs;

Expand Down

0 comments on commit 5874112

Please sign in to comment.