Integrated Windows Authentication-DynamicEntity?

Pytanie Integrated Windows Authentication-DynamicEntity?

  • Donnerstag, 24. Juli 2008 13:42
     
     

     

    Hi All

     

    Is there any known issue with reference to Integrated Windows Authentication when using DynamicEntity?  If using an entity object and create command, I am getting the account created, whereas if I use dynamic entity, I am unable to create a record and exception is returned.  My IIS version 6.0, and the security setting - IWA is enabled and am using Java for my development.

     

    The same works fine if IWA / Basic authentication both are enabled.  I have issue when only IWA is enabled.  Any help please.

     

    Regards,

     

    Yuva

     

     

     

    Please note the following:

    Code Snippet

    CrmServiceSoapStub binding = new CrmServiceLocator().getCrmServiceSoap(new URL(Ms CRM URL));

    binding.setUsername("username");
      binding.setPassword("password");

     

     

    My Request to Ms CRM without dynamic Entity:

    Code Snippet

    try{
       
       Account account=new Account();
       account.setName("Test Account-072408-1-IWA");
       
       account.setAddress1_city("cityy1");
       
       String id = binding.create(account);
       System.out.println("Account id = "+id);
      }catch(Exception e){
       e.printStackTrace();
      }

     

     

    Response from Ms CRM: THIS WORKS and the created ID is returned.

    <?xml version="1.0" encoding="utf-8"?>
       <soap:Envelope xmlnsTongue Tiedoap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <soap:Body>
             <CreateResult xmlns="http://schemas.microsoft.com/crm/2006/WebServices">d4f682ea-8159-dd11-a801-000c293388a0</CreateResult>
          </soap:Body>
       </soap:Envelope>

     

    My Request to Ms CRM using dynamic Entity:

    Code Snippet

    try {
       

    //    Set the properties of the contact using property objects.
                StringProperty firstname = new StringProperty();
                firstname.setName("firstname");
                firstname.setValue("Jesper");
                StringProperty lastname = new StringProperty();
                lastname.setName("lastname");
                lastname.setValue("Aaberg using Dyn Entity-3");

                DynamicEntity contactEntity = new DynamicEntity();
                contactEntity.setName("contact");

                Property[] property = new Property[] {firstname, lastname};
                contactEntity.setProperties(property);
               
                TargetCreateDynamic targetCreate = new TargetCreateDynamic();
                targetCreate.setEntity(contactEntity);
                CreateRequest create = new CreateRequest();
                create.setTarget(targetCreate);

                // Execute the request.
                CreateResponse created = (CreateResponse)binding.execute(create);

                System.out.println("\nContact Created : "+created.getId());


      } catch (RemoteException e) {
       System.out.println("Create result  RemoteException : "+e);
       e.printStackTrace();
      }

     

     

    Response from Ms CRM: THIS DOES NOT WORK and an axis exception is returned.   <soap:Envelope xmlnsTongue Tiedoap="   <soap:Envelope xmlnsTongue Tiedoap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <soap:Body>
             <soap:Fault>
                <faultcode>soap:Client</faultcode>
                <faultstring>Server was unable to process request.</faultstring>
                <detail>
                   <error> 
                      <code>0x80040216</code> 
                      <description>An unexpected error occurred.</description> 
                      <type>Platform</type>
                   </error>
                </detail>
             </soap:Fault>
          </soap:Body>
       </soap:Envelope>
      

     

     

Alle Antworten

  • Donnerstag, 24. Juli 2008 20:56
     
     

    Code Snippet

     

    Hi Friends

     

    In continuation to my above post, I tried creating record using dynamicEntity in 2 modes.  I would like to mention:

     

    1) Enable Basic Authentication:

    If I enable Basic Authentication, and use DynamicEntity to create an entity, I am able to successfully create the record.

     

    Response from the CRM :

    <Response xsi:type="CreateResponse" xmlns="http://schemas.microsoft.com/crm/2006/WebServices">
                <id>9f1cdd60-ab59-dd11-a801-000c293388a0</id>
             </Response>

     

     

    2) Disable Basic authentication and have IWA enabled in IIS.

    But if I disable Basic authentication and have only IWA - NTLM enabled in IIS, I get an exception while trying to create the same record using Dynamic Entity.

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <soap:Body>
             <soap:Fault>
                <faultcode>soap:Client</faultcode>
                <faultstring>Server was unable to process request.</faultstring>
                <detail>
                   <error> 
                      <code>0x80040216</code> 
                      <description>An unexpected error occurred.</description> 
                      <type>Platform</type>
                   </error>
                </detail>
             </soap:Fault>
          </soap:Body>
       </soap:Envelope>

     

    Please give me some suggestions, to resolve.

     

    Thanks & Regards

    Yuva

     

     

  • Freitag, 25. Juli 2008 12:44
     
     
    I am just curious.  Where are you running your java application?  On windows or Linux/Unix?  Also, what kind of AppServer are you running?  I am thinking if it has anything to do with the authentication of the AppServer.

     

  • Freitag, 25. Juli 2008 12:59
     
     

     

    Hi

     

    Thanks for your reply.

     

    I am running my application on Windows, and my appServer is Websphere.  My IIS (v6.0) and Ms CRM is installed in a remote machine.

     

    I tried running the code as a standalone java application in Eclipse.  I have the following files in my project path:

     

    axis.jar  (the client-config.wsdd file uses CommonsHTTPTransportSender)

    commons-codec-1.3.jar

    commons-httpclient-3.1.jar

     

    Regards,

     

    Yuva

  • Freitag, 25. Juli 2008 17:28
     
     

    To ensure this is NOT an authentication problem, you should try to set a user as the system administrator and run your application again. 

     

    In your authenticationToken, set your CallerIdto the Administrator GUID and then run the application again.  If it still fails, it is possible that it's the SOAP request call from websphere... or something else.

     

    Here is how you set the UserId

     

    Code Snippet

    // Setup the CRM Service.

    CrmSdk.CrmAuthenticationToken token = new CrmSdk.CrmAuthenticationToken();

    token.CallerId = <System User GUID>

    token.AuthenticationType = 0; // AD authentication

    ............