Hello Guys, I tried to communicate with SOAP-WSDL server with php. When I try to call the ApplyEventDelta function who have 3 parameters: sessionId, _eventDeltaXml and priority WSDL Server send me an error: Caught exception: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1. at Bla.EVenue.Odi.Ws.ODictService.ApplyEventDelta(String sessionId, Byte[] _eventDeltaXml, OStreamPriority priority) --- End of inner exception stack trace --- //--------------------------------------------------------------------------------- //--------------------------------------------------------------------------------- $wsdlAddress_Actions = 'http://ip/ODI/ODictService.asmx?WSDL'; $soapOptions_Actions = array( 'trace' => true ); $soapClient_Actions = new SoapClient($wsdlAddress_Actions, $soapOptions_Actions); //print_r($soapClient_Actions->__getTypes()); //ApplyEventDelta $eventDeltaXml = '<?xml version="1.0" encoding="utf-8"?> <O-Dict> <EventDelta DataSourceId="TextText" CdsTypeId="EV" CdsId="'.date("Y-m-d").'" Name="Name" ShortName="ShortName" SportId="NUM" EventCategoryId="H" DeclaredStartTime="'.date("Y-m-d").' 09:00:00,000000 0:00" NamedStartTime="'.date("Y-m-d").' 09:00:00" IsActive="True"> <VenueRef DataSourceId="TextText" CdsTypeId="VE" CdsId="001" /> <CompetitionRef DataSourceId="TextText" CdsTypeId="CO" CdsId="001" /> </EventDelta> </O-Dict>'; //------------------------------ $xmlEventDeltaXml = simplexml_load_string($eventDeltaXml); //------------------------------ $paramx = array('sessionId' => $session_id, '_eventDeltaXml' => base64_encode($xmlEventDeltaXml), 'priority' => 'Normal'); try { //----------- $result_eventDeltaXml = $soapClient_Actions->__call('ApplyEventDelta', array('parameters' => $paramx)); //----------- } catch (Exception $e) { //----------- echo '<strong>Caught exception:</strong> ', $e->getMessage(), "\n"; //----------- } //--------------------------------------------------------------------------------- //--------------------------------------------------------------------------------- $wsdlAddress_Actions = 'http://ip/ODI/ODictService.asmx?WSDL'; Anyone know what this error could be? Thanks in advance, Regards
In my documentation I have: and in the SOAP XML: POST /ODI/ODictService.asmx HTTP/1.1 Host: 172.82.101.162 Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "urn:Finsoft:EVenue:ODict:Ws/ApplyMarketDelta" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ApplyMarketDelta xmlns="urn:Finsoft:EVenue:ODict:Ws"> <sessionId>string</sessionId> <marketDeltaXml>base64Binary</marketDeltaXml> <priority>Low or Normal or High</priority> </ApplyMarketDelta> </soap:Body> </soap:Envelope> I must encode the $xmlEventDeltaXml to base64Binary but I don't know how. Regards, Radu