web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Binding SAP webservice within CRM plugin

(0) ShareShare
ReportReport
Posted on by 902

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

I have the same question (0)
  • gdas Profile Picture
    50,091 Moderator on at

    Hi Keyur,

    I would suggest keep all the configuration key and value (URL, Credentials etc ) in a CRM entity , using organization service call retrieve all configuration value and assign it dynamically .

  • Seren S Profile Picture
    402 on at

    Hi Keyur,

    Have you tried to add properties for ProxyCredentialType for possible proxy blocks and Message.ClientCredentialType?

    I generally use the same method without no config files and it works with below-stated sample configuration.

                WSHttpBinding myBinding = new WSHttpBinding();
                myBinding.Name = "WsHttpBinding";
                myBinding.Security.Mode = SecurityMode.Transport;
                myBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
    myBinding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None; myBinding.Security.Message.ClientCredentialType = MessageCredentialType.None; EndpointAddress endPointAddress = new EndpointAddress("xxx.azurewebsites.net/.../CustomerService"); YYY.CustomerServiceClient myClient = new YYYCustomerServiceClient(myBinding, endPointAddress); return myClient;

    Cheers, Seren.

  • Suggested answer
    keyur7379 Profile Picture
    902 on at

    Hi,

    Now I am calling web service in different way. I have converted this web service in rest API using azure API management service. I don't know what exact issue in web service. I got this issue in only SAP web service while calling through CRM plugin. I have also called NAV web service in plugin and it is working fine. I think there are some issue in SAP web service.

    Thanks,

    Keyur Shah.

  • Gmanunta81 Profile Picture
    327 on at

    Hi Keyur,

    Can you show to the community the tech details of what you did? 

    I think that could help a lot of people 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans