Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autowire PortType implementation doesn´t work #43

Open
Manas101 opened this issue Apr 22, 2014 · 4 comments
Open

Autowire PortType implementation doesn´t work #43

Manas101 opened this issue Apr 22, 2014 · 4 comments

Comments

@Manas101
Copy link

Hello, I have a problem with correct settings (propably) of cxf-client 1.6.0. My config.groovy:
// cxf config
cxf {
client {
authLdService {
wsdl = "docs/wsdl/auth.wsdl"
namespace = "cxf.client.ld.auth"
outputDir = "src/java"
clientInterface = cxf.client.ld.auth.AuthService
serviceEndpointAddress = "${service.ld.url}/services/Auth"
}
}
}

Wsdl2java script executed successfully (java classes were generated). But when I want to test a service:

class LdAuthService {

AuthService authLdService

def loginUser(String userName, String password) {
    def sid

    try {
        sid = authLdService.login(userName, password)
        return sid

    } catch (Exception e) {
        e.printStackTrace()
        throw new RuntimeException('login to LD failed')
    }
}

}

I always got a null pointer exception (at use authLdService in controller). I supposed that authLdService should be wired automatically.... What do I wrong?

Thanks a lot.

@ctoestreich
Copy link
Member

What version of grails are you using?

@Manas101
Copy link
Author

Grails 2.3.7

@froderik
Copy link
Contributor

Similar problem here on Grails 2.4.3 - also tried to use the generated classes directly but getting javax.xml.ws.WebServiceException: Port {.......}MyMessageResponderPort not found. in that case. How did you move forward?

@froderik
Copy link
Contributor

I had some other problems also but now I got it working. (Doing anything where SOAP is involved always requires a "random changes until it works"-session.....) I think the missing thing in your code is that the clientInterface property needs to point to the interface rather than the service. Replace AuthService with AuthInterface.

I believe this issue can be closed or maybe result in better documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants