Ссылка объекта WCF Soap не установлена ​​на экземпляр объекта - PullRequest
0 голосов
/ 18 октября 2018

Я пытался вызвать метод в мыльном сервисе. Я наконец-то добился прогресса, но теперь я получаю следующую ошибку:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body>
        <s:Fault>
            <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode>
            <faultstring xml:lang="en-US">Object reference not set to an instance of an object.</faultstring>
            <detail>
                <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                    <HelpLink i:nil="true"/>
                    <InnerException i:nil="true"/>
                    <Message>Object reference not set to an instance of an object.</Message>
                    <StackTrace>   at Radixx.ConnectPoint.Security.Process.RetrieveSecurityToken(RetrieveSecurityToken RetrieveSecurityTokenRequest)&#xD;
   at Radixx.ConnectPoint.ConnectPoint_Security.RetrieveSecurityToken(RetrieveSecurityToken RetrieveSecurityTokenRequest)&#xD;
   at SyncInvokeRetrieveSecurityToken(Object , Object[] , Object[] )&#xD;
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs)&#xD;
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
                    <Type>System.NullReferenceException</Type>
                </ExceptionDetail>
            </detail>
        </s:Fault>
    </s:Body>
</s:Envelope>

Я тестирую это в Почтальоне, этосгенерированный код cURL от Почтальона:

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://aw.connectpoint.uat.radixx.com/ConnectPoint.Security.svc",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n  <soap:Body>\n    <RetrieveSecurityToken xmlns=\"http://tempuri.org/\">\n      <LogonID>xxxxxx</LogonID>\n      <Password>xxxxxx</Password>\n    </RetrieveSecurityToken>\n  </soap:Body>\n</soap:Envelope>",
  CURLOPT_HTTPHEADER => array(
    "Content-Type: text/xml",
    "Postman-Token: 8b7ecc62-aff8-40ab-9801-a9efc47f8141",
    "SOAPAction: http://tempuri.org/IConnectPoint_Security/RetrieveSecurityToken",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

И это wsdl для сервиса: enter image description here

1 Ответ

0 голосов
/ 18 октября 2018
<Message>Object reference not set to an instance of an object.</Message>

Это похоже на внутреннюю ошибку сервера, потому что запрос SAOP недействителен или токен безопасности отсутствует или что-то в этом роде.

Вы пробовали это с PHP Soapclient ?

Редактировать: я протестировал его с SoapClient из PHP, результат тот же.Пожалуйста, свяжитесь со службой технической поддержки, например, Radixx.

...