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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Consuming Dynamics GP native web service from Java using Apache CXF framework

(1) ShareShare
ReportReport
Posted on by

I have a requirement to consume Dynamics GP native web service from Java and i am using Apache CXF to create the soap client. We are using kerbaros authentication as part of CXF (spnego).

We are able to call the web service from a .net based  soap client from the same computer by passing the username, password and domain name as input for authentication.

But with java.. we are getting SocketTimeoutException as below.

[Krb5LoginModule] authentication failed

org.apache.cxf.interceptor.Fault: General security error (An error occurred in trying to obtain a TGT: Receive timed out)

Caused by: java.net.SocketTimeoutException: Receive timed out
at java.net.DualStackPlainDatagramSocketImpl.socketReceiveOrPeekData(Native Method)
at java.net.DualStackPlainDatagramSocketImpl.receive0(DualStackPlainDatagramSocketImpl.java:124)
at java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:143)
at java.net.DatagramSocket.receive(DatagramSocket.java:812)
at sun.security.krb5.internal.UDPClient.receive(NetClient.java:206)
at sun.security.krb5.KdcComm$KdcCommunication.run(KdcComm.java:411)
at sun.security.krb5.KdcComm$KdcCommunication.run(KdcComm.java:364)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.krb5.KdcComm.send(KdcComm.java:348)
at sun.security.krb5.KdcComm.sendIfPossible(KdcComm.java:253)
at sun.security.krb5.KdcComm.send(KdcComm.java:229)
at sun.security.krb5.KdcComm.send(KdcComm.java:200)
at sun.security.krb5.KrbAsReqBuilder.send(KrbAsReqBuilder.java:316)
at sun.security.krb5.KrbAsReqBuilder.action(KrbAsReqBuilder.java:361)
at com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:766)
... 40 more

We have login.config and krb5.conf files as below.

login.config ==============

spnego-client {
com.sun.security.auth.module.Krb5LoginModule required
debug=true
refreshKrb5Config=true;
};

======================

krb5.conf================

[libdefaults]
default_realm=DOMAIN1.MYCOMPANY.LOCAL

[realms]
DOMAIN1.MYCOMPANY.LOCAL = {
kdc=MACHINE01.domain1.mycompany.local
default_domain=DOMAIN1.MYCOMPANY.LOCAL
}
[domain_realm]
.domain1.mycompany.local=DOMAIN1.MYCOMPANY.LOCAL
domain1.mycompany.local=DOMAIN1.MYCOMPANY.LOCAL

=======================

Endpoint : http://MACHINE01:112233/Dynamics/GPService/GPService

client.getRequestContext().put("ws-security.callback-handler", new NamePasswordCallbackHandler("UERNAME", "PASSWORD"));

*This post is locked for comments

I have the same question (0)

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans