tag:blogger.com,1999:blog-1634875294511193246.post8870200197354692989..comments2023-02-17T00:21:02.120-08:00Comments on Groovy Tom's Blog: CXF and MS CRM 2011Tomhttp://www.blogger.com/profile/01290089094214192952noreply@blogger.comBlogger99125tag:blogger.com,1999:blog-1634875294511193246.post-51988115105165369972016-04-15T06:40:14.059-07:002016-04-15T06:40:14.059-07:00I was facing the Guid related issues mentioned in ...I was facing the Guid related issues mentioned in a number of posts above. The WSDL has it as a SimpleType and classes for it are not generated unless they are enumerations.<br /><br />To work around this - you have to use a binding file and set mapSimpleTypeDef attribute for globalBinding element to true.<br /><br />Please refer - https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html/Developing_Applications_Using_JAX-WS/files/JAXWSCustomTypeMappingSimple.htmlShakti Srivastavahttps://www.blogger.com/profile/15640833563529638971noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-68732242411555733202016-03-25T00:50:17.449-07:002016-03-25T00:50:17.449-07:00Did you able to solve "The signature or decry...Did you able to solve "The signature or decryption was invalid" issue?Anonymoushttps://www.blogger.com/profile/12631165551589547612noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-83565184447002951252015-08-11T09:54:22.276-07:002015-08-11T09:54:22.276-07:00Nevermind, at this point I'm stuck at where Ør...Nevermind, at this point I'm stuck at where Ørjan and you were at: Caused by: org.apache.ws.security.WSSecurityException: The signature or decryption was invalid. Were you able to get through this?Inashhttps://www.blogger.com/profile/10268207880373367673noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-33378543859792245022015-08-11T09:20:56.402-07:002015-08-11T09:20:56.402-07:00Hi Thomas, Where do we place this interceptor at?Hi Thomas, Where do we place this interceptor at?Inashhttps://www.blogger.com/profile/10268207880373367673noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-52568865668068654392015-01-27T08:30:36.723-08:002015-01-27T08:30:36.723-08:00Yeah, that's a good point ... it looks like th...Yeah, that's a good point ... it looks like this differs enough from CRM that I'm falling out of the context of this post. I've been working through it on the CXF mailing list, and will just keep pursuing it there. I do appreciate your feedback, though!<br /><br />Just one more thought before I go, though: I did a deeper debugging dive in response to a CXF list question at http://mail-archives.apache.org/mod_mbox/cxf-users/201501.mbox/%3CF4B5D9FC-F4B7-4A7D-8B1E-6B81556936DF@nexidia.com%3E. If you see anything helpful there, let me know; else thanks very much for taking the time here!Anonymoushttps://www.blogger.com/profile/04027258559598869053noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-68491248222914205082015-01-26T19:13:35.079-08:002015-01-26T19:13:35.079-08:00It's hard to tell what's going on without ...It's hard to tell what's going on without seeing the message exchange. It would be helpful if you could capture the exchange using fiddler or some other http capture tool. The fact that it is getting stuck in a look tells me it's not getting back what it is expecting, so there might be an error message in the response that STSClient doesn't understand. Keep in mind this code hasn't been tested much outside of CRM, so I wouldn't be surprised if there are scenarios it's not handling correctly.Tomhttps://www.blogger.com/profile/01290089094214192952noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-19250757705549544192015-01-26T09:56:30.891-08:002015-01-26T09:56:30.891-08:00I'm not sure that it's even getting a toke...I'm not sure that it's even getting a token back in the STS Client. In this method:<br /><br />public SecurityToken requestSecurityToken(String appliesTo, String action, String requestType, String binaryExchange) throws Exception {<br /><br /> AbstractSTSClient.STSResponse response = issue(appliesTo, action, requestType, binaryExchange);<br /><br /> SecurityToken token = createSecurityToken(getDocumentElement(response.getResponse()), response.getEntropy());<br /><br />...<br />}<br /><br />It's getting caught in that loop at the very first line with its call to issue(...). I can see it building up the request, but when it goes to call client.invoke(...) with the request document that it's built, that call eventually gets caught back in the STSClient at that same issue(...) point. STSClient never progresses beyond that line.<br /><br />Here's the test class I've been using, which is essentially, I think, what you've done up there: https://gist.github.com/anonymous/172987e91dffcecb4792.<br /><br />Let me know if there are other files I can provide that will help. The web service is secured with WsHttpTransport, if that helps, too.<br /><br />Thanks!<br /><br />MarkAnonymoushttps://www.blogger.com/profile/04027258559598869053noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-49479688004836718972015-01-23T17:39:14.988-08:002015-01-23T17:39:14.988-08:00It sounds like it's having trouble exchanging ...It sounds like it's having trouble exchanging the kerberos ticket for the WS-Trust token. Either the STSClient isn't getting back the WS-Trust token or the token doesn't have what the STSClient is expecting. It might be helpful if you could post the exchange on gist or another code sharing site. (with sensitive info removed)Tomhttps://www.blogger.com/profile/01290089094214192952noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-74009165010206192492015-01-23T06:26:36.792-08:002015-01-23T06:26:36.792-08:00Hi Tom,
Extremely helpful post ... it's gotten...Hi Tom,<br />Extremely helpful post ... it's gotten me very close on a similar project I'm working on that involves consuming a WCF 4.0-secured web service with the same message level NTLM/Kerberos based on SPNEGO WS-Trust. It's not CRM, but your instructions have gotten me very close to the finish line.<br /><br />Unfortunately, I've hit a hurdle at the very end that I wonder if you might have any insight into: With Kerberos debugging on, I can see that part of the application working successfully, but it gets caught in a loop afterward, continually reaching out to the domain controller for a new Kerberos key. The looping starts in SpnegoContextTokenOutInterceptor's handleMessage(SoapMessage) call: It tries to get the "ws-security.token.id" from the message, but it's not there, so with a null token, it requests a security token from the STSClient, and that request gets caught up in the same interceptor where the ws-security.token.id is null, and it just keeps rolling from there.<br /><br />I started out using CXF 3.0.3, but went back to 2.7.14 before typing this, to see if the version made a difference, but it didn't.<br /><br />It seems like there must be something small I can do to get around this, but I'm just not seeing it. Any other thoughts you might have would be greatly appreciated.<br /><br />All best,<br />MarkAnonymoushttps://www.blogger.com/profile/04027258559598869053noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-43440645968383905402014-12-02T12:27:48.903-08:002014-12-02T12:27:48.903-08:00Hurray!!! Successfully connected to MS CRM on prem...Hurray!!! Successfully connected to MS CRM on premise. This is a great article...very helpful. Thanks Tom!DPhttps://www.blogger.com/profile/08246124108870761630noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-11698019205486643152014-09-07T15:15:05.930-07:002014-09-07T15:15:05.930-07:00Brennan,
I am getting the same exception. Did you...Brennan,<br /><br />I am getting the same exception. Did you resolve it? I tried disabling the validation altogether but no luck.<br /><br /> ((BindingProvider)port).getRequestContext().put("schema-validation-enabled", "false");Anonymoushttps://www.blogger.com/profile/15716013430869514464noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-63383630598963896232014-05-12T08:23:05.269-07:002014-05-12T08:23:05.269-07:00Hello,
would you be able to provide me with your ...Hello,<br /><br />would you be able to provide me with your code as I'm in the same situation? <br /><br />thanks<br />Lawrencesingleinottawahttps://www.blogger.com/profile/10903274961891951900noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-60263908436609787762014-05-06T06:06:53.946-07:002014-05-06T06:06:53.946-07:00• This is a very helpful blog. According the infor...• This is a very helpful blog. According the information here I was first able to connect to CRM 2011 On-Premise and invoke CRM web service calls through CXF. After looking into the CXF codebase, I figured out the correct implementation for SOAP message signing and encryption. I have been able to authenticate and send SOAP requests to the 2011/2013 On-Premise server through my standalone Java implementation. Many thanks!IT Searcherhttps://www.blogger.com/profile/10051255425751121881noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-70854207630154825272014-04-11T09:53:29.064-07:002014-04-11T09:53:29.064-07:00Here's the error message from the server. Loo...Here's the error message from the server. Looks like BigDecimals create a DecimalAttributeMetadata instead of MoneyAttributeMetadata, but i'm not sure how to override that for the Money fields. Sending the Money class doesn't help, since CXF just maps it as a container with a BigDecimal inside.<br /><br />>Crm Exception: Message: An unexpected error occurred., ErrorCode: -2147220970, InnerException: System.InvalidCastException: Unable to cast object of type 'Microsoft.Crm.Metadata.DecimalAttributeMetadata' to type 'Microsoft.Crm.Metadata.MoneyAttributeMetadata'.<br /> at Microsoft.Crm.ObjectModel.DoubleAttributeValidator.UpdatePrecision(Nullable`1 decimalValue, Nullable`1 floatValue, Money moneyValue, DoubleAttributeMetadata doubleMetadata, Entity entity, String propertyName, ExecutionContext platformContext)<br /> at Microsoft.Crm.ObjectModel.DoubleAttributeValidator.Validate(Entity entity, KeyValuePair`2 property, AttributeMetadata attributeMetadata, ExecutionContext platformContext)<br /> at Microsoft.Crm.ObjectModel.AttributeValidationPlugin.ValidateAttributeValue(Entity entity, KeyValuePair`2 property, AttributeMetadata attributeMetadata, ExecutionContext context, Entity parentEntity)<br /> at Microsoft.Crm.ObjectModel.AttributeValidationPlugin.PerformValidation(Entity entity, EntityMetadata entityMetadata, ExecutionContext platformContext, Entity parentEntity)<br /> at Microsoft.Crm.ObjectModel.AttributeValidationPlugin.Execute(IServiceProvider serviceProvider)<br /> at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)<br /> at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)Jameshttps://www.blogger.com/profile/00123314027765110715noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-52835275954548829412014-04-11T08:33:20.952-07:002014-04-11T08:33:20.952-07:00Anyone have any experience creating SalesOrderDeta...Anyone have any experience creating SalesOrderDetails through this setup? I pretty much have everything working, and can query and create accounts, contacts, orders and detail lines, as well as code to automatically populate picklists and entityreferences, but I can't for the life of me get it to send a Money value to CRM.<br /><br />If i just stick a BigDecimal in the KeyValuePair, it doesn't complain and runs through fine, but the value is zero on CRM. If i intercept the marshaller and create a Money object and set the BigDecimal as the value, I get an unexpected failure on the server message (which digging into appears to be a class cast error). Setting the value as a string yields a generic failure message. I've tried setting the BigDecimal scale to 4 (matching what CRM returns) with a roundingmode of up, but no change. Jameshttps://www.blogger.com/profile/00123314027765110715noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-12580919037466706402014-03-28T13:38:06.237-07:002014-03-28T13:38:06.237-07:00This comment has been removed by the author.Jameshttps://www.blogger.com/profile/00123314027765110715noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-34816500070865329642014-03-27T04:37:47.099-07:002014-03-27T04:37:47.099-07:00This comment has been removed by the author.Subbuhttps://www.blogger.com/profile/06432691563209527811noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-70537878745354479672014-02-26T10:14:32.647-08:002014-02-26T10:14:32.647-08:00I haven't tried that version of cxf, you might...I haven't tried that version of cxf, you might want to try a version that is confirmed working like 2.7.0 or 2.6.9.Tomhttps://www.blogger.com/profile/01290089094214192952noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-19499048912450108092014-02-25T01:38:26.563-08:002014-02-25T01:38:26.563-08:00Hi Tom,
I am generating java stub using apache CX...Hi Tom,<br /><br />I am generating java stub using apache CXF apache-cxf-3.0.0-milestone2 and did the process as you said.<br />But when i am trying run the client then i get the Exception:<br /><br />WARNING: Interceptor for {http://schemas.microsoft.com/xrm/2011/Contracts}OrganizationService#{http://schemas.microsoft.com/xrm/2011/Contracts/Services}RetrieveMultiple has thrown exception, unwinding now<br />org.apache.cxf.interceptor.Fault: No message with ID "kerberosLoginError" found in resource bundle "org/apache/xml/security/resource/xmlsecurity"<br /> at org.apache.cxf.ws.security.policy.interceptors.SpnegoContextTokenOutInterceptor.issueToken(SpnegoContextTokenOutInterceptor.java:117)<br /> at org.apache.cxf.ws.security.policy.interceptors.SpnegoContextTokenOutInterceptor.handleMessage(SpnegoContextTokenOutInterceptor.java:74)<br /> at org.apache.cxf.ws.security.policy.interceptors.SpnegoContextTokenOutInterceptor.handleMessage(SpnegoContextTokenOutInterceptor.java:46)<br /> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)<br /> at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:502)<br /> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:411)<br /> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:314)<br /> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:267)<br /> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)<br /> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:137)<br /> at $Proxy53.retrieveMultiple(Unknown Source)<br /> at test.main(test.java:84)<br />Caused by: org.apache.wss4j.common.ext.WSSecurityException: No message with ID "kerberosLoginError" found in resource bundle "org/apache/xml/security/resource/xmlsecurity"<br />Original Exception was javax.security.auth.login.LoginException: java.lang.NullPointerException<br /> at java.io.ByteArrayInputStream.(ByteArrayInputStream.java:89)<br /> at sun.security.util.DerValue.(DerValue.java:277)<br /> at sun.security.krb5.KrbAsRep.(KrbAsRep.java:46)<br /> at sun.security.krb5.KrbAsReq.getReply(KrbAsReq.java:448)<br /> at sun.security.krb5.Credentials.sendASRequest(Credentials.java:401)<br /> at sun.security.krb5.Credentials.acquireTGT(Credentials.java:350)<br /> at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:662)<br /> at com.sun.security.auth.module.Krb5LoginModule.login(Krb5LoginModule.java:542)<br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br /> at java.lang.reflect.Method.invoke(Method.java:597)<br />Can someone please help me on this.<br /><br />Thanks in Advance.<br /><br />Kiran<br /><br />Kiran Phadtarehttps://www.blogger.com/profile/03158901592923272977noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-72772693737980585412013-10-04T21:39:27.211-07:002013-10-04T21:39:27.211-07:00We have to struggle for almost three weeks to make...We have to struggle for almost three weeks to make <br />the Java Client for CRM Dynamics 2011 work.<br />Special Thanks to Groovy Tom for writing such a good Blog.<br />Also to all the comments given by Alessandro Nisticò, Jair and Thomas<br />Without which the task will never be completed.<br /><br />Sardar Saikh.<br />Anonymoushttps://www.blogger.com/profile/12097358330044915879noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-81192470476437233212013-10-04T19:10:20.124-07:002013-10-04T19:10:20.124-07:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/12097358330044915879noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-50655340212965376552013-10-04T19:08:46.640-07:002013-10-04T19:08:46.640-07:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/12097358330044915879noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-59447661937869572202013-09-04T20:21:22.481-07:002013-09-04T20:21:22.481-07:00You could also do the following instead:
pu...You could also do the following instead:<br /><br /> public void initialize(Client client, Bus bus) {<br /> bus.getProperties().put("soap.no.validate.parts", true);<br /> }<br /><br />I prefer it because the property name is more explicit in what you are try to achieve.Anonymoushttps://www.blogger.com/profile/07076108940376272630noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-91530018728508164502013-08-29T15:32:50.202-07:002013-08-29T15:32:50.202-07:00To be honest, we haven't been doing a lot of a...To be honest, we haven't been doing a lot of active development on CRM lately. It's been several years since I've had to do any significant work with the CRM webservices.Tomhttps://www.blogger.com/profile/01290089094214192952noreply@blogger.comtag:blogger.com,1999:blog-1634875294511193246.post-71810571863674507162013-08-29T10:40:44.781-07:002013-08-29T10:40:44.781-07:00Tom,
Thanks for the update. It looks like there ...Tom,<br /><br />Thanks for the update. It looks like there is a unmarshalling issue for picklists (OptionSetValue) possible due to namespaces? Have you been able to retrieve columns on entities that are configured as picklists?<br /><br />Thanks,<br /><br />BrennanBrennanhttps://www.blogger.com/profile/18041030948858292908noreply@blogger.com