

Having worked on Java and Microsoft technologies, I always found that programming using Microsoft languages like C# is lot easier than coding in Java. There could be many reasons why I felt so and some of them are that MS offers one standard IDE (VS2008) unlike in Java where you have various editors like Eclipse (with MyEclipse), JBuilder, JDeveloper, etc. I personally feel that MyEclipse and Eclipse is a powerful combo than VS 2008 but still it is easier/faster to develop a windows based client in C# than in Java.
Of late, I have been working with CRM web services, trying to develop a custom web application that can consume web services offered by CRM 4.0. I have developed an ASP.NET website and have accomplished what I intended to.
Now, I wanted to experiment with Java a bit (it's been quite some since I had started MyEclipse on my machine ;-) ). I have generated the Java classes using WSDL2Java from Axis1.x. I followed some examples posted in forums and got a sample working using the CRMDiscoveryService. I followed the same process to consume CRMService but hard luck. All the time I encountered "401 User Unauthorized".
After lot of googling, I came to know that Axis1.x doesn't support NTLM authentication (not sure how it worked for CRMDiscoveryService !!). Some posts suggested that the latest stable release of Axis1.x doesn't support NTLM authentication and that we need to download the latest nightly build and the latest sources from SVN. I did that but no luck yet !!
One of my friends suggested to use Axis2 instead of Axis1.x. I have downloaded the latest binaries and source code of Axis2 but the error remained the same - "401 User Unauthorized".
This is real frustrating, 'coz when you say that webservices are aimed to bring about platform independence, getting a client (from a different platform) to work with MS CRM webservices is not that easy !!
Microsoft is famous for the documentation, samples and look-and-feel and I am hoping that someone from Microsoft or Sun finds this post and comes up with some helpful samples and documentation on how to develop clients in Java to consume MS CRM 4.0 web services :-)
Till then, keeping shouting in forums ;-)
Of late, I have been working with CRM web services, trying to develop a custom web application that can consume web services offered by CRM 4.0. I have developed an ASP.NET website and have accomplished what I intended to.
Now, I wanted to experiment with Java a bit (it's been quite some since I had started MyEclipse on my machine ;-) ). I have generated the Java classes using WSDL2Java from Axis1.x. I followed some examples posted in forums and got a sample working using the CRMDiscoveryService. I followed the same process to consume CRMService but hard luck. All the time I encountered "401 User Unauthorized".
After lot of googling, I came to know that Axis1.x doesn't support NTLM authentication (not sure how it worked for CRMDiscoveryService !!). Some posts suggested that the latest stable release of Axis1.x doesn't support NTLM authentication and that we need to download the latest nightly build and the latest sources from SVN. I did that but no luck yet !!
One of my friends suggested to use Axis2 instead of Axis1.x. I have downloaded the latest binaries and source code of Axis2 but the error remained the same - "401 User Unauthorized".
This is real frustrating, 'coz when you say that webservices are aimed to bring about platform independence, getting a client (from a different platform) to work with MS CRM webservices is not that easy !!
Microsoft is famous for the documentation, samples and look-and-feel and I am hoping that someone from Microsoft or Sun finds this post and comes up with some helpful samples and documentation on how to develop clients in Java to consume MS CRM 4.0 web services :-)
Till then, keeping shouting in forums ;-)
9 comments:
Hi Kiran,
Please go to this url, there is an article that mentions how to turn on NT Authentication for web service using Apache Axis.
http://tjordahl.blogspot.com/2007/03/apache-axis-and-commons-httpclient.html
Hope this helps.
Regards
Yuva
Hi Yuva,
Thanks for the link. I had tried this option before but no luck :-( Let me know if you got this thing working, shall be happy to try out the steps :-)
Did you ever find a solution for this? I'm running into precisely the same problem now and haven't found many answers.
Hi Matthew,
I haven't got a chance to revisit the issue ever since I gave up :-) No solution yet, to my knowledge :-(
If you get this cracked, please do share your solution with me.
Cheers,
Kiran Banda
http://www.davidbits.blogspot.com/
I faced the same problem and after loooong research, I have added following code to the stub and problem got resolved.
QName paramQName = new javax.xml.namespace.QName("http://schemas.microsoft.com/crm/2007/WebServices", "CrmAuthenticationToken");
RPCParam rpcParam = new RPCParam(paramQName.getNamespaceURI(),
paramQName.getLocalPart(),
authToken);
_call.addHeader(new RPCHeaderParam(rpcParam));
Sridhar,
Thank you so much.I am sure someone out there might have gained already due to your solution :-)
Regards
hi !
can you please clarify where to insert the mentioned code ???
QName paramQName = new javax.xml.namespace.QName("http://schemas.microsoft.com/crm/2007/WebServices", "CrmAuthenticationToken");
RPCParam rpcParam = new RPCParam(paramQName.getNamespaceURI(),
paramQName.getLocalPart(),
authToken);
_call.addHeader(new RPCHeaderParam(rpcParam));
where should i insert this code ? how to instantiate the authToken parameter ?
greetings
Post a Comment