[英]Soap WCF Object Reference Not Set To An Instance On An Object
我一直在尝试在Soap服务中调用方法,但我终于取得了进展,但是现在出现以下错误:
<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;
}
<Message>Object reference not set to an instance of an object.</Message>
这看起来像是内部服务器错误,因为SAOP请求无效或缺少安全令牌。
您是否尝试过使用PHP Soapclient ?
编辑:我已经用PHP的SoapClient测试了它,结果是一样的。 请联系技术支持,例如Radixx。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.