Friday, 9 January 2015

Send data from XML file with SoapClient php



I'm trying to send a XML file from SoapClient but I still have a cuestions. My XML file is:



<S:Envelope xmlns:S="http://ift.tt/sVJIaE">
<S:Header>
<AuthenticationInfo xmlns="urn:HPD_IncidentInterface_Create_WS">
<userName>USERNAME</userName>
<password>PASSWORD</password>
</AuthenticationInfo>
</S:Header>
<S:Body>
<HelpDesk_Submit_Service xmlns="urn:HPD_IncidentInterface_Create_WS">
<Assigned_Group>PARAMS</Assigned_Group>
</HelpDesk_Submit_Service>
</S:Body>


And my PHP code is:



$xml = simplexml_load_file('prueba.xml');
try{
$soap_client = new SoapClient('URL');
$soap_body = new \SoapVar($xml, \XSD_ANYXML);
$envio_xml = $soap_client->__soapCall('http://ift.tt/tphNwY',array($soap_body));
var_dump($envio_xml);
}catch(SoapFault $e){
echo $e->getMessage();
}


This returns



Function ("http://ift.tt/tphNwY") is not a valid method for this service



So I don't know why. I test from SOAPUI and it works I hope that someone can help me, thanks a lot.


No comments:

Post a Comment