Announcement Announcement Module
Collapse
No announcement yet.
Improving the spring-ws client Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Well, you could do:

    Code:
    private List<Marshaller> marshallers;
    private List<Unmarshaller> unmarshallers;
    ...
    public void doWithMessage(WebServiceMessage request) throws IOException, TransformerException {
        for (Marshaller marshaller : marshallers) {
            if (marshaller.supports(requestPayload.getClass())) {}
                MarshallingUtils.marshal(marshaller, requestPayload, request);
                if (requestCallback != null) {
                    requestCallback.doWithMessage(request);
                }
                break;
            }
        }
    }

    Comment


    • #17
      I would have to make at least 2 passes at marshalling. One for the *Request & *Response objects, and one for the value(s) in the *Request & *Response.

      So wouldn't it be something like:

      Code:
      private List<Marshaller> marshallers;
      private List<Unmarshaller> unmarshallers;
      ...
      public void doWithMessage(WebServiceMessage request) throws IOException, TransformerException {
          for (Marshaller marshaller : marshallers) {
              if (marshaller.supports(requestPayload.getClass())) {
                  MarshallingUtils.marshal(marshaller, requestPayload, request);
              }
          }
          if (requestCallback != null) {
              requestCallback.doWithMessage(request);
          }
      }

      Comment


      • #18
        Plus I'm not sure how the unmarshalling would work since I don't have a responsePayload

        Comment


        • #19
          I've tried playing with extending WebServiceTemplate but ran into problems. I'll just have to wait until the client officially supports multiple (un)marshallers.

          Comment


          • #20
            So I noticed that in revision 8931, there was a change in org.springframework.oxm.jaxb.AbstractJaxbMarshalle r that allows contextPaths. Does that mean I can now have one JAXBMarshaller handle multiple packages? Both for server & client? This would really help me out.

            EDIT:
            I have confirmed that this works. This is great! I now have separate packages for my request/response objects for each web service yet one marshaller/unmarshaller.
            Last edited by mmccaskill; Nov 26th, 2007, 08:15 AM.

            Comment


            • #21
              Yeah, I added that explicit feature. Silly of me not to mention it here. It was available in the past as well, though you had to do it by hand (i.e. create one colon separated context path from multiple package names, like so: com.acme.foo:com.acme.bar

              Comment

              Working...
              X