I have an application that accesses third-party WebService. To improve the testing process, I'm setting up a Web site to simulate the WebService.
This site consists of several Actions, which return the XML, simulating data. This part is ok .
My problem is that I can not get the input parameters, which come from my application.
Remembering that my application continues with the same structure to send the data to the WebService, but only with the URL pointing to my site.
I tried to use Request in the controller, and I could not get the data.
Reference generated by C # when importing WSDL
[System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://services.teste.com.br", ResponseNamespace="http://services.teste.com.br", Use=System.Web.Services.Description.SoapBindingUse.Literal)]
[return: System.Xml.Serialization.XmlElementAttribute("result")]
public moedasExportarOut Exportar(string user, string password, int encryption, moedasExportarIn parameters) {
object[] results = this.Invoke("Exportar", new object[] {
user,
password,
encryption,
parameters});
return ((moedasExportarOut)(results[0]));
}
Action
[HttpPost]
public ActionResult XML(string user, string password, int? encryption, string methodName,
Moeda.moedasExportarIn parameters,
Moeda.moedasExportarIn arg, int? codEmpField)
{
XmlDocument xd = new XmlDocument();
var teste = "";
teste =
"<?xml version='1.0' encoding='UTF-8'?> " +
"<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"> " +
" <S:Body>" +
" <ns2:ExportarResponse xmlns:ns2=\"http://services.teste.com.br\">" +
" <result>" +
" <erroExecucao xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:nil=\"true\"/>" +
" <finalizaramRegistros>S</finalizaramRegistros>" +
" <mensagemRetorno xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:nil=\"true\"/>" +
" <numLot>0</numLot>" +
" <tipoRetorno>1</tipoRetorno>" +
" </result>" +
" </ns2:ExportarResponse>" +
" </S:Body>" +
"</S:Envelope>";
xd.LoadXml(teste);
return new XmlResult(xd);
}
Calling the WebService, made by my application
public Teste.Moedas.moedasExportarOut ExportarMoeda(DadosParaIntegracao dados, Teste.Moedas.moedasExportarIn parameters)
{
System.Net.ServicePointManager.DefaultConnectionLimit = conexaoSimultaneaPorServico;
var service = new Teste.Moedas.g5services();
service.Url = dados.Configuracao.URL;
service.Timeout = ConfiguarTimeOut(service, dados.Configuracao);
ConfigurarProxy(service, dados.Proxy);
try
{
ConfigurarIntegracao(service);
System.Net.ServicePointManager.Expect100Continue = false;
return service.Exportar(dados.Login.Login, dados.Login.Senha, 0, parameters);
}
finally
{
LimparIntegracao();
}
}
I could not even get the value of user, password or any other parameter.