Reputation: 1
This request created using .NET Framework
but it did not work in .NET Core because it's not supported
public XmlRpcStruct GetOffers(string msisdn, string userName, string password)
{
XmlRpcStruct req = new XmlRpcStruct
{
{ "originHostName", _originalHostName },
{ "originNodeType", _originalNodeType },
{
"originTimeStamp",
DateTime.Now
}
};
string origTransId = DateTime.Now.Millisecond + msisdn;
req.Add("originTransactionID", origTransId);
req.Add("subscriberNumber", msisdn);
req.Add("subscriberNumberNAI", 2);
req.Add("offerRequestedTypeFlag", "11111000");
XmlRpcStruct resp = null;
IGetOffers proxy =(IGetOffers)XmlRpcProxyGen.Create(typeof(IGetOffers));
XmlRpcTracer trace = new XmlRpcTracer();
trace.Attach(proxy);
proxy.Credentials = new NetworkCredential(userName, password);
proxy.KeepAlive = true;
proxy.PreAuthenticate = true;
proxy.UserAgent = "send_request/4.4/1.0";
proxy.Url = AirServerUrl;
proxy.XmlEncoding = Encoding.UTF8;
proxy.XmlRpcMethod = "GetOffers";
return proxy.GetOffers(req);
}
So I need a way to simulate this using .NET Core 8
This peace of code
IGetOffers proxy =(IGetOffers)XmlRpcProxyGen.Create(typeof(IGetOffers));
I got an error here when search on , that the reflection in .net framework different in reflection .net core `
Upvotes: 0
Views: 49