Cliente PHP transmitindo para Webservice .net usando NuSoap

Enviada por Marcelo Corradi 
Marcelo Corradi
Cliente PHP transmitindo para Webservice .net usando NuSoap
07 de December de 2016 às 12:29PM
Bom dia!

Estou tentando transmitir uma string xml para um webservice .net e está ocorrendo o erro abaixo:
Array
(
[faultcode] => a:ActionNotSupported
[faultstring] => Array
(
[!xml:lang] => en-US
[!] => The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
)
)

Alguém pode me dar uma dica do que pode ser?
Abaixo meu código de teste.

<?php
set_time_limit(300); /* Tempo limite em segundos. */

date_default_timezone_set('America/Sao_Paulo');

setlocale(LC_ALL,'pt_BR.UTF8');
mb_internal_encoding('UTF8');
mb_regex_encoding('UTF8');

header('content-type text/html charset=utf-8');

/* Carregando classes Nusoap para criar o servidor */
require_once("WSNusoapSC//lib//nusoap.php");


$cliente = new nusoap_client("http://santacolomba.azurewebsites.net/PMFarmSystemIntegrationServiceFromFarm.PMFarmSystemServiceFromFarm.svc?wsdl");
$cliente->soap_defencoding = "utf-8";
$cliente->http_encoding="utf-8";

if ($cliente->getError()){
echo '<h1>Error: ' . $cliente->getError() . '</h1>';
}

$parametros = array("PurchasseOrder"=>"<PurchaseOrder><OrderId>0416-000002</OrderId><ProductCode>175781</ProductCode><TotalWeightWeek>0.2</TotalWeightWeek><IdClient>59097</IdClient><IdCompany>1</IdCompany><UnitValue>1</UnitValue><OriginalQuantity>0,2000</OriginalQuantity></PurchaseOrder>");
$resultado = $cliente->call("PurchasseOrder", $parametros);

if ($cliente->fault) {
echo '<h2>Fault</h2><pre>';
echo
print_r($resultado);
echo '</pre>';
} else {
// Check for errors
$err = $cliente->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
// Display the result
echo '<h2>Result</h2><pre>';
print_r($resultado);
echo '</pre>';
}
}
Você precisa estar logado no PHPBrasil.com para poder enviar mensagens para os nossos fóruns.

Faça o login aqui.