Home Ask Login Register

Developers Planet

Your answer is one click away!

user979974 February 2016

Submit file php soap server

I am requesting help for an issue that I have. I am trying to submit a file to a server by using php SOAP but when I submit, I have this error:

Fatal error: Uncaught SoapFault exception: [soap11env:Client.SchemaValidationError] :2:0:ERROR:SCHEMASV:SCHEMAV_ELEMENT_CONTENT: Element '{http://mutalyzer.nl/2.0/services}submitBatchJob': Missing child element(s). Expected is ( {http://mutalyzer.nl/2.0/services}data ). in C:\xampp\htdocs\ngs\submit4.php:31 Stack trace: #0 C:\xampp\htdocs\ngs\submit4.php(31): SoapClient->__call('submitBatchJob', Array) #1 {main} thrown in C:\xampp\htdocs\ngs\submit4.php on line 31

The WSDL description is the following:

submitBatchJob type submitBatchJob

data type base64Binary
process - optional, nillable; type string
argument - optional, nillable; type string
email - optional, nillable; type string

submitBatchJobResponse type submitBatchJobResponse

submitBatchJobResult - optional, nillable; type string

<xs:complexType name="submitBatchJob">
<xs:sequence>
<xs:element name="data" type="xs:base64Binary" />
<xs:element name="process" type="xs:string" minOccurs="0" nillable="true" />
<xs:element name="argument" type="xs:string" minOccurs="0" nillable="true" />
<xs:element name="email" type="xs:string" minOccurs="0" nillable="true" />
</xs:sequence>
</xs:complexType>

Here my php script:

<?php
$URL = 'https://mutalyzer.nl/services/?wsdl';
?><!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Mutalyzer SOAP client</title>
</head>
<body>
<h1>Mutalyzer SOAP client</h1>
<?php
if (isset($_GET['data']) && $_GET['data']) {

    $variant = $_GET['data'];


    $_FILES['data']['name']=$_GET['data'];
    $filename = basename( $_FILES['data']['name'])        

Answers


peixotorms February 2016

First you need to catch that exception, with:

 try {
   # some code here that causes a problem, hint: soap11env:Client.SchemaValidationError
    } catch (Exception $e) {
        echo $e->getMessage();
    }

Second, it's telling you where the error is:

Element '{http://mutalyzer.nl/2.0/services}submitBatchJob': Missing child element(s). Expected is ( {http://mutalyzer.nl/2.0/services}data ). 

and also:

in C:\xampp\htdocs\ngs\submit4.php:31 Stack trace: #0 C:\xampp\htdocs\ngs\submit4.php(31): SoapClient->__call('submitBatchJob', Array) #1 {main} thrown in C:\xampp\htdocs\ngs\submit4.php on line 31

Post Status

Asked in February 2016
Viewed 4,000 times
Voted 4
Answered 1 times

Search




Leave an answer


Quote of the day: live life