How to pass this XML structure to SOAP structure?

BloortCrard

New Member
This is the XML structure: \[code\] <tem:Login xmlns:tem="http://tempuri.org/"> <tem:token xmlns:tem="http://tempuri.org/"> <bpf:company xmlns:bpf="http://schemas.datacontract.org/2004/07/Bpf.Security.Common"> <bpf1:Description xmlns:bpf1="http://schemas.datacontract.org/2004/07/Bpf.Security.Authentication.Common">Desc</bpf1:Description> <bpf1:Id xmlns:bpf1="http://schemas.datacontract.org/2004/07/Bpf.Security.Authentication.Common">1</bpf1:Id> <bpf1:Name xmlns:bpf1="http://schemas.datacontract.org/2004/07/Bpf.Security.Authentication.Common">Name</bpf1:Name> </bpf:company> <bpf:password xmlns:bpf="http://schemas.datacontract.org/2004/07/Bpf.Security.Common">Password</bpf:password> <bpf:userName xmlns:bpf="http://schemas.datacontract.org/2004/07/Bpf.Security.Common">userName</bpf:userName> </tem:token> </tem:Login>\[/code\]I need to transform in something like this:\[code\]//E.g. $nsTem = 'http://tempuri.org/'; $nsBpf = 'http://schemas.datacontract.org/2004/07/Bpf.Security.Common'; $nsBpf1 = 'http://schemas.datacontract.org/2004/07/Bpf.Security.Authentication.Common'; $params = new stdClass(); $params->Login = new stdClass(); $params->token = new stdClass(); $params->company = new stdClass(); $params->company->Description = new SoapVar('desc', XSD_STRING, null, null, null, $nsBpf1); $params->company->Id = new SoapVar(1, XSD_INT, null, null, null, $nsBpf1); $params->company->Name = new SoapVar('Name', XSD_STRING, null, null, null, $nsBpf1); $params->password = new SoapVar('Password', XSD_STRING, null, null, null, $nsBpf); $params->userName = new SoapVar('userName', XSD_STRING, null, null, null, $nsBpf); $client = new SoapClient($wsdl); $client->MyLogin($params); //etc..\[/code\]The above request is only an example, I will tried but doesn't work.I hope someone can help me.
 
Back
Top