Good day, reader.
I've been tasked with building a PHP SOAP server to recieve a xml sent by a VB client via WinHttp.WinHttpRequest Object. I am using nuSoap for the php server and it has yet to work until now.
The xml that the vb client sent contain the defined webservice which need to be consumed along with other nessecary variable, which is why theres no soapaction stuff planted inside vb code. 'They' want it this way :'(
The soap server did sent a respond to vb like this :
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
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:Fault>
<faultcode xsi:type="xsd:string">SOAP-ENV:Client</faultcode>
<faultactor xsi:type="xsd:string"></faultactor>
<faultstring xsi:type="xsd:string">Operation '' is not defined in the WSDL for this service</faultstring>
<detail xsi:type="xsd:string"></detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The vb client that sent the xml :
Private Sub Command2_Click()
mydata = "<?xml version=""1.0"" encoding=""UTF-8""?>" & vbCrLf
mydata = mydata & "<root>" & vbCrLf
mydata = mydata & "<SERVICE>SayHello</SERVICE>" & vbCrLf
mydata = mydata & "<NAME>Noobula</NAME>" & vbCrLf
mydata = mydata & "</root>" & vbCrLf
Set w = CreateObject("WinHttp.WinHttpRequest.5.1")
w.Open "POST", "http://127.0.0.1:80/soapvb/terimaxml.php"
w.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
w.Option(WinHttpRequestOption_SslErrorIgnoreFlags) = 13056
w.Send mydata
respo = w.ResponseText
Text1 = respo
End Sub
And the last, the server itself :
require_once "lib/nusoap.php";
$debug = 0;
$server = new soap_server();
$server->configureWSDL('terimaxml', 'urn:terimaxml');
function SayHello($xml){
//messing with xml taking NAME and say Olaa
echo "Olaaa :D";
}
$server->register('SayHello()',
array('xml' =>'xsd:array'),
'urn: terimaxml',
'urn: terimaxml#__construct()',
'rpc',
'encoded',
'-----'
);
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)
? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
Ive been roaming around the internet for quite sometime to solve this one. so any help would be appreciated, Thanks in advance. :D