Hi,
I'm new to SOAP (and relatively new to php). I'm really struggling to get what looks like a very simple web service request to work. I need to send an XML string to a remote .NET service.
I can access the WSDL (I even understand most of it!) but I can't for love nor money get the server to send back anything more encouraging than a 400 or 500 error - using either PHP SOAP or nusoap.
The operation name I need is SubmitCalls. It has only one input message - SubmitCallsSoapIn, the message looks like this:
<wsdl:part name="parameters" element="tns:SubmitCalls"/>
***nusoap attempt generating a 500 (username/password obfuscated)
<?php
require_once('../lib/nusoap.php');
/* Initialize parameter */
$xml = '<SubmitCalls xmlns="http://biomni.com/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<request>
<?xml version="1.0" encoding="UTF-8"?>
<bXML xmlns="http://www.biomni.com/Schemas" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<From>
<UserName>***</UserName>
<Password>***</Password>
</From>
<Calls>
<Call>
<Reference>11111</Reference>
<Name>Joe Bloggs</Name>
<Tel1>02075574200</Tel1>
<Tel2>02075574201</Tel2>
<Tel3>02075574202</Tel3>
<Tel4>02075574203</Tel4>
<Tel5>02075574204</Tel5>
<CLI>08448220640</CLI>
<CallTime>09:00</CallTime>
<FileName>02075574200_1</FileName>
</Call>
<Call>
<Reference>11111</Reference>
<Name>Joe Bloggs</Name>
<Tel1>02075574200</Tel1>
<Tel2>02075574206</Tel2>
<Tel3>02075574207</Tel3>
<Tel4>02075574208</Tel4>
<Tel5>02075574209</Tel5>
<CLI>08448220640</CLI>
<CallTime>10:00</CallTime>
<FileName>02075574200_2</FileName>
</Call>
</Calls>
</bXML>
</request>
</SubmitCalls>';
$wsdl = "https://www.biomnivoice.com/BrooksHealthcareWebService/BrooksHealthcareWebService.asmx?WSDL";
$client = new nusoap_client($wsdl, true);
$client->soap_defencoding = 'utf-8';
$client->useHTTPPersistentConnection();
$soapaction = "http://biomni.com/SubmitCalls";
/* create the proxy object */
$proxy = $client->getProxy();
$response = $proxy->send($xml,$soapaction);
// Snipped code for displaying request/response and debug_str
Instead of using the proxy object and the send method (trying both in desperation) I can generate a 400 error using the following:
$response = $client->call("SubmitCalls",$xml,"http://www.bionmi.com/", '', false, null, 'document', 'literal');
I've been trying to get this to work for three days - read countless forum posts and web pages. It looks dirt simple, but for whatever reason I just can't get it to work. I've also tried using PHP's compiled in SOAP with the same results (using nusoap because the display on screen is more verbose).
Please, please, please can you point me in the right direction on this one. It's driving me nuts!