We have .Net soap service, we need to call one of the services method in that. I've tried creating an instance of stdClass() and assigning the required properties of the .NET. Am unable to pass the object to .Net service.
I have used Nusoap here but if you have a SOAP PHP class solution it is also invited.
$client_card = new nusoap_client('https://uatapi.viad.com/ges/v1/orderService.svc?wsdl', 'WSDL');
$obj = new stdClass();
$obj->CreditCardNumber = "4518169332998699";
$obj->ExpireMonth = 05;
$obj->ExpireYear = 2025;
$obj->CardNickname = "Test";
$obj->CardholderName = "test";
$obj->Address = "test";
$obj->City = "Anywhere";
$obj->State = "test";
$obj->PostalCode = "test";
$obj->Country ="test";
$parameter= array("CreditCardSubmission" => $obj);
$obj1 = $client_card->call('SubmitCreditCardInformation',
array("applicationSessionId" => $id, $parameter));
Here is my method signature.
string SubmitCreditCardInformation(string applicationSessionId, CreditCardSubmission request)
[DataContract(Namespace = "www.xxx.com")]
public class CreditCardSubmission
{
[DataMember] public string CreditCardNumber { get; set; }
[DataMember] public int ExpireMonth { get; set; }
........
}
My xml code
<wsdl:operation name="SubmitCreditCardInformation">
<soap:operation soapAction="www.viad.com/v1/IOrderService/SubmitCreditCardInformation" style="document"/>
<wsdl:input><soap:body use="literal"/></wsdl:input>
<wsdl:output><soap:body use="literal"/></wsdl:output>
<wsdl:fault name="DictionaryOf_String_StringFault">
<soap:fault name="DictionaryOf_String_StringFault" use="literal"/></wsdl:fault></wsdl:operation>
Below is my error
Array
(
[faultcode] => a:InternalServiceFault
[faultstring] => Array
(
[!xml:lang] => en-US
[!] => Object reference not set to an instance of an object.
)
[detail] => Array
(
[ExceptionDetail] => Array
(
[HelpLink] =>
[InnerException] =>
[Message] => Object reference not set to an instance of an object.
[StackTrace] => at Viad.Services.Public.GES.v1.OrderService.SubmitCreditCardInformation(String applicationSessionId, CreditCardSubmission request) in c:\SVN\Viad.GES.Services\Branches\PublicServices_v1\Viad.Services.Public.GES\v1\OrderService.svc.cs:line 1248
at SyncInvokeSubmitCreditCardInformation(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.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
[Type] => System.NullReferenceException
)
)
)
Any help would be appreciated. Thx.......