modtage soap attachment
Hejsa!Hvordan modtager man en soap attachment i php?? Bruger php_soap.dll til min soap server og altså ikke pear eller nusoap.
Her kan ses min server fil:
<?
require('include/database.php');
class booking {
private $incPath = 'include/';
function updateServerStatus($user, $pass, $status){
global $mysqli, $userid;
if (connect($user, $pass)){
require($this->incPath."updateserverstatus.php");
disconnect();
}else
$result .= 'Login failed';
return $result;
}
function updateMap($user, $pass, $map, $h, $w){
global $mysqli, $userid;
if (connect($user, $pass)){
//require($this->incPath."updateMap.php");
require($this->incPath."updateserverstatus.php");
disconnect();
}else
$result .= 'Login failed';
return $result;
}
function updateEnhedsKat($user, $pass, $enhedsKat, $action){
global $mysqli, $userid;
if (connect($user, $pass)){
require($this->incPath."updateEnhedsKat.php");
disconnect();
}else
$result .= 'Login failed';
return $result;
}
function updateEnheder($user, $pass, $enheder, $action){
global $mysqli, $userid;
if (connect($user, $pass)){
require($this->incPath."updateEnheder.php");
require($this->incPath."updateserverstatus.php");
disconnect();
}else
$result .= 'Login failed';
return $result;
}
} //end class
$server = new SoapServer(NULL ,array('uri' => "http://localhost:8080/booking/"));
$server->setClass("booking");
$server->handle();
?>
Den function der skal modtage min attachment får fejlen "Bad request".
Det der sendes til serveren ser således ud:
--MIME_boundaryB0R9532143182121
Content-Type: text/xml
SOAPAction: "urn:soap-webOneBookingService#updateMap"
Content-ID: <http://www.borland.com/rootpart.xml>
Content-Location: http://www.borland.com/rootpart.xml
Content-Length: 693
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:NS2="urn:soap"><NS1:updateMap xmlns:NS1="urn:soap-webOneBookingService"><user xsi:type="xsd:string">TEST</user><pass xsi:type="xsd:string">TEST</pass><image href="#1"/><h xsi:type="xsd:int">438</h><w xsi:type="xsd:int">687</w></NS1:updateMap><NS2:Tmap id="1" href="cid:E707486A-BC60-4474-BA36-6739AC2E75EB"/></SOAP-ENV:Body></SOAP-ENV:Envelope>
--MIME_boundaryB0R9532143182121
Content-ID: <E707486A-BC60-4474-BA36-6739AC2E75EB>
Content-Length: 0
Content-Type: application/binary
Content-transfer-encoding: binary
--MIME_boundaryB0R9532143182121--
Her er det xml min webservice returnere:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Bad Request</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
