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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

HOW TO CONSUME WSDL IN CRM

(0) ShareShare
ReportReport
Posted on by 95

Hi Everyone,

I want to consume WSDL given by TIBCO, to get the pdf.

The url they given is

http://10.XX.XX.XXXX:9081/Services/GetPDFDetails?wsdl

I want to generate request xml to this URL

http://10.XX.XX.XXXX:9081/Services/GetPDFDetails to get response.

GetPDFDetails is the method name.

Thanks & Regards,
Sreekanth.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    ashlega Profile Picture
    34,477 on at
    RE: HOW TO CONSUME WSDL IN CRM

    Hi,

     Do you know how to consume a web service in a .net executable application? For crm, you can write a plugin and do the same in the plugin, though, if you need to do any configuration, you'll have to do it in your code - not in the configuration file. Also, you don't seem to be using crm online..if you were, you would need to have a dns name there, not an IP address. If you are onprem, you can simply use a non sandboxed plugin.

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: HOW TO CONSUME WSDL IN CRM

    Hi Sreekanth,

    1. First you need to save the WSDL file in your local machine.

     open 10.xx.xx.xxxx/.../GetPDFDetails and save the xml as .wsdl extension.

    2. Not sure what is your calling method - plugin , WCF service, windows service  . You can add the WSDL file by right click your visual studio solution and click add service reference. You need to choose the save WSDL in your local machine .

    3. Once you add the proxy you need to write some custom code to consume the TIBCO service like below . I have written for -

    document[] documentArray = null;

    //Get the details from  WCF configuration file

    string getPDFEndpoint = (ConfigurationManager.AppSettings["TIBCOServiceURL"] != null) ? ConfigurationManager.AppSettings["TIBCOServiceURL"] : "";

                   string svcUsername = (ConfigurationManager.AppSettings["TibcoSvcUserName"] != null) ? ConfigurationManager.AppSettings["TibcoSvcUserName"] : "";

                   string svcPassword = (ConfigurationManager.AppSettings["TibcoSvcPassword"] != null) ? ConfigurationManager.AppSettings["TibcoSvcPassword"] : "";

                   string getpdfDocumentidentifier = (ConfigurationManager.AppSettings["SearchDocumentidentifier"] != null) ? ConfigurationManager.AppSettings["SearchDocumentidentifier"] : "";

                   string getpdfDocumenttoken = (ConfigurationManager.AppSettings["SearchDocumenttoken"] != null) ? ConfigurationManager.AppSettings["SearchDocumenttoken"] : "";

                   var binding = new BasicHttpBinding();

                   binding.MaxBufferPoolSize = 2147483647;

                   binding.MaxReceivedMessageSize = 2147483647;

                   var ServiceEndpoint = new EndpointAddress(new Uri(getPDFEndpoint));            

                   Document1Client _client = new Document1Client(binding, ServiceEndpoint);

                   _client.ClientCredentials.UserName.UserName = svcUsername;

                   _client.ClientCredentials.UserName.Password = svcPassword;

                   var httpRequestProperty = new HttpRequestMessageProperty();

                   httpRequestProperty.Headers[HttpRequestHeader.Authorization] = "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(svcUsername + ":" + svcPassword));

                   headerType hdrType = new headerType();

                   authentication _auth = new authentication();

                   _auth.identifier = getpdfDocumentidentifier;

                   _auth.token = getpdfDocumenttoken;

                   document objs = new document();

                   using (OperationContextScope scope = new OperationContextScope(_client.InnerChannel))

                   {

                       documentArray = _client.getpdfDocuments(hdrType, _auth, getpdfDocumentRequest.userAs, getpdfDocumentRequest.baseName, getpdfDocumentRequest.request);

                   }

    4.  getpdfDocumentRequest is nothing but your request class where you can assign the request value.

    Please note that I have tried to write a sample code for your requirement . So I hope it will help for your issue .

    Please mark this as answer if its helps.

    Thanks

    Goutam

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
UllrSki Profile Picture

UllrSki 2

#3
SC-08081331-0 Profile Picture

SC-08081331-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans