views:

311

answers:

2

Hi all,

I have two code projects both using CXF to use web services. When I make a call from project A to project B, the method I am calling receives null parameters. I've turned on logging and the inbound message does indeed contain the correct parameters. I have also tried calling my service from SoapUI (a webservice testing tool). This passes over the parameters as I expect. Anyone have any ideas what's going wrong?

The service interface:

@WebService
public interface IShortlistService {

  public IShortlist createOrUpdateShortlist(@WebParam(name = "sessionId") String sessionId,
      @WebParam(name = "datastoreInstance") String datastoreInstance,
      @WebParam(name = "datastoreRecordId") String datastoreRecordId);
}

The service impl:

@Name("shortlistService")
@WebService(endpointInterface = "com.oobjects.shortlist.service.IShortlistService", serviceName = "ShortlistService")
@Features(features = "org.apache.cxf.feature.LoggingFeature")
@Transactional
public class ShortlistService implements IShortlistService {
  public IShortlist createOrUpdateShortlist(String sessionId, String datastoreInstance,
      String datastoreRecordId) {
    // At this point all inputs are null
  }
}

Logging for inbound message that proves it's OK:

INFO: Inbound Message
----------------------------
Encoding: UTF-8
Content-Type: text/xml; charset=UTF-8
Headers: {cache-control=[no-cache], content-type=[text/xml; charset=UTF-8], connection=[keep-alive], host=[mypc.mycompany.com:8080], content-length=[391], SOAPAction=[""], user-agent=[Apache CXF 2.2.5], Accept=[*/*], pragma=[no-cache]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;soap:Body&gt;&lt;ns1:createOrUpdateShortlist xmlns:ns1="http://service.shortlist.mycompany.com/"&gt;&lt;sessionId&gt;854a48b5-922f-4081-9c76-b6d08b58a341&lt;/sessionId&gt;&lt;datastoreInstance&gt;http://mypc.mycompany.com:8080/shortlist-app/services/ShortlistService&lt;/datastoreInstance&gt;&lt;/ns1:createOrUpdateShortlist&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;
--------------------------------------

The versions of CXF are the same (2.2.5). I can't think what else to check!

Some requested information...

  • @Name is a Seam annotation
  • Configured programmatically
  • Aegis databinding (JAXWS doesn't like interfaces)
A: 

@Lee Theobald ... there's nothing obvious in your posted question that reveals why it isn't working for you. In this case, the 'answer,' such as it is, is to request assistance on "CXF Users" , and, if necessary, open a JIRA. Playing 20 questions in the question comments isn't very efficient, and there are a lot more CXF-expert eyeballs on that list than here at this point. We could bring an amended question and answer back over here once the mystery is revealed.

bmargulies
Yeah, I agree. Just knowing that I've not made an obvious mistake is a something good though.
Lee Theobald
A: 

Okay, the problem resolved as an error. The guy whose interface I was using didn't update from the repository before deploying his service, and as something had changed on his part (a throws clause was removed) that he checked in but didn't deploy, I used the fresher version from the repository. His version of the interface threw an exception, but my version of the interface didn't say so. So:

This error can occur if service provider and service client use a slightly different interface.

Akku
Oh I answered this question as I had the same issue and found it out. Somehow thought I posed the question in the first place.
Akku