Hello,
I am trying to call webservice through plugin for . I can access the same webservice externally, but when i am trying to consume the same, it gives an error.
Please suggest how to bind it within CRM without using app config as CRM doesn't allow to use appconfig within plugin.
I want to call web service with out use of .config file.
Please refer below code :
BasicHttpBinding binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.Transport;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
var address = new EndpointAddress("https://****************/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_CRM&receiverParty=&receiverService=BC_PRD&interface=SI_Inventory_Out&interfaceNamespace=http%3A%2F%2Fknack.com%2FCRM%2FInventory");
SI_Inventory_OutClient client = new SI_Inventory_OutClient();
client.ClientCredentials.UserName.UserName = "*****";
client.ClientCredentials.UserName.Password = "******";
client.Open();
DT_Inventory_ReqRecords Inventory_ReqRecords = new DT_Inventory_ReqRecords();
Inventory_ReqRecords.Material = "100000035";
Inventory_ReqRecords.Plant = "1100";
Inventory_ReqRecords.Storage_Loc = "";
// Inventory_ReqRecords.Storage_Loc = "";
DT_Inventory_ReqRecords[] DT_Inventory_ReqRecords = new DT_Inventory_ReqRecords[] { Inventory_ReqRecords };
try
{
var Response = client.SI_Inventory_Out(DT_Inventory_ReqRecords);
}
*This post is locked for comments