Skip to main content

Notifications

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

  • Gmanunta81 Profile Picture
    327 on at
    RE: Binding SAP webservice within CRM plugin

    Hi Keyur,

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

    I think that could help a lot of people 

  • Suggested answer
    keyur7379 Profile Picture
    902 on at
    RE: Binding SAP webservice within CRM plugin

    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.

  • Seren S Profile Picture
    402 on at
    RE: Binding SAP webservice within CRM plugin

    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.

  • gdas Profile Picture
    50,091 Moderator on at
    RE: Binding SAP webservice within CRM plugin

    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 .

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans