Я пытался вызвать метод в мыльном сервисе. Я наконец-то добился прогресса, но теперь я получаю следующую ошибку:
<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)
at Radixx.ConnectPoint.ConnectPoint_Security.RetrieveSecurityToken(RetrieveSecurityToken RetrieveSecurityTokenRequest)
at SyncInvokeRetrieveSecurityToken(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc)
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](https://i.stack.imgur.com/cvWrm.png)