Soap - wsdl

Discussion in 'PHP' started by faralimite, Apr 8, 2011.

  1. #1
    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
     
    faralimite, Apr 8, 2011 IP
  2. faralimite

    faralimite Greenhorn

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    Hello,

    Nobody knows?
     
    faralimite, Apr 12, 2011 IP
  3. myharshdesigner

    myharshdesigner Peon

    Messages:
    147
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    try to look in to the Doc of that SOAP URL. may be u r missing some thing...
     
    myharshdesigner, Apr 12, 2011 IP
  4. faralimite

    faralimite Greenhorn

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #4
    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
     
    faralimite, Apr 13, 2011 IP
  5. myharshdesigner

    myharshdesigner Peon

    Messages:
    147
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    can you provide me the link, let me try to get the result, then i will explain to you if i succeed.
     
    myharshdesigner, Apr 13, 2011 IP