SOAP потребляет. NET веб-сервис не передает тип сообщения и APIKey - PullRequest
0 голосов
/ 24 января 2020

Я пытаюсь подключиться к веб-службе. NET, которая подключается к сообщению действия SOAP с типом CVPHandshakeRequest. Мой код публикует, но не добавляет никаких параметров, я также пропускаю много дополнительных заголовков.

   <?php
$trace = true;
    $exceptions = true;
    $client = new SoapClient($uri,array('trace' => $trace, 'exceptions' => $exceptions));

$APIKey= '';
$RequestorID='';
$MessageType='CVPHandshakeRequest';

$result = $client->RouteMessage(array(
    "APIKey" => $APIKey,
    "RequestorID" =>$RequestorID,
    "MessageType" => $MessageType
        ));
 echo "REQUEST:\n" . $result->__getLastRequest() . "\n";
 ?>

Я также пробовал: https://github.com/wsdl2phpgenerator/wsdl2phpgenerator

$service = new \ContractValidationEngine();
$wrapper= new \CVPWrapperMessage();

$wrapper->setAPIKey('');
$wrapper->setRequestorID('');
$wrapper->setMessageType('HandShake');
$request = new \Message($wrapper);
$response = $service->RouteMessage($request);

Пример кода веб-сервера, который мне дали. Я не уверен, что смогу опубликовать URL. Я буду, если это поможет.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">         <s:Header>   
<Action s:mustUnderstand="1"   xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">
  http://tempuri.org/IContractValidation/RouteMessage</Action>

  <h:APIKey xmlns="http://tempuri.org/" xmlns:h="http://tempuri.org/">password</h:APIKey>    
 <h:MessageType xmlns="http://tempuri.org/" xmlns:h="http://tempuri.org/">HandShake</h:MessageType>
<h:RequestorID xmlns="http://tempuri.org/" xmlns:h="http://tempuri.org/">login</h:RequestorID>

  </s:Header>   
 <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">   
  <Message xmlns:q1="http://schemas.datacontract.org/2004/07/Euseco.Mokadom.CVP.Workflow.MessageContracts" xsi:type="q1:CVPHandshakeRequest" xmlns="http://tempuri.org/">     
    <q1:APIKey>password</q1:APIKey>

     <q1:ClientVersion xsi:nil="true" />
            <q1:RequestorID>login</q1:RequestorID>

 </Message>  
 </s:Body> 

Обновление 28/01/2020

WCFTestClient Требуется только 4 переменные и все работы.

Request => 'CVPWrapperMessage' => array (APIKey => '', RequesterID = '', MessageType = 'Handshack', array ('Message' => array (APIKey => '', RequesterID =. ' ', ClientVersion =>' '))

WCFTestClientWorking

...