SOAP & W3C API Help

Discussion in 'PHP' started by MrMean, Jul 5, 2008.

  1. #1
    Hi,

    I'm trying to write a function for the W3C API and am having difficulties.

    I'm currently getting the error:
    "Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't find <definitions> in ..." Would be very grateful for advice on how to get this working! ;)

    My code:



    function valid_website_check_2($webpage_url)
    {



    $webpage_url = urlencode($webpage_url);
    $parameters = array(
    uri => $webpage_url,
    /* 'uploaded_file' => '',
    'fragment' => '', */
    output => 'soap12',
    charset => '',
    doctype => '',
    verbose => '',
    debug => '',
    ss => '',
    outline => ''
    );
    $client = new SoapClient("http://validator.w3.org/check",$parameters);
    var_dump($client);
    $valid = $client->markupvalidationresponse->validity($parameters);
    if($valid == true)
    {
    return "Valid";
    }
    else
    {
    return "Invalid";
    }

    }


    I am very greatful for any advice, oh here is the API documentation:
    http://validator.w3.org/docs/api.html

    Cheers,
    Anthony
     
    MrMean, Jul 5, 2008 IP
  2. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #2
    Seeing as it's sending an exception, why not try to catch it?

    Dan
     
    Danltn, Jul 5, 2008 IP