Announcement Announcement Module
No announcement yet.
WebServiceTemplate - Get it to stop adding SOAP Envelope? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • WebServiceTemplate - Get it to stop adding SOAP Envelope?

    Is it possible to use WebServiceTemplate, but have it NOT add the SOAP envelope around the XML Request going to the Spring WS Web Service?

    Because our Spring WS Webservice only uses RAW XML, Web Service Template always returns a "404" error since our dynamically generated method call in our Endpoint class has no idea what the SOAP header is all about and can't route it. Our Web Service just expects the RAW XML Request itself with no SOAP Header.

    Our service works fine with POSTMAN and other tools, but, sadly, not yet with WebServiceTemplate.

    We're looking for a way to test our Spring-WS XML (only) Web Service, but neither SOAP UI nor WebServiceTemplate seem to work since we don't use SOAP at all.

    Workarounds, suggestions???



  • #2
    Configure a different WebServiceMessageFactory by default a SOAP one is used, you probably want to configure the DomPoxMessageFactory instead (or create your own implemenation).


    • #3
      Wow, thank you!!!

      I did not know about this class.

      Our service doesn't use JAXB and I can't find a lot of examples (doing a quick search after reading your reply) on DomPoxMessageFactory, but at least I have something new to investigate.

      If there's a better way to test Spring WS Web Services in a batch, so to speak, please let me know. DomPoxMessageFactory still might not be the optimal solution for Request/Reponse testing of each of a bunch of services implemented methods.

      Thanks again.



      • #4
        It doesn't matter what you use on the service(server) side... You want to sent plain-old-xml messages with the template (client)... The only common thing in between is XML how that is generated doesn't matter.


        • #5
          Thanks to everyone's input and help on this issue!!!

          Spring's DomPoxMessageFactory saved the day. This class isn't listed in any of the references books I have.

          Our Request is working perfectly now.

          We now have a basis for a testing framework for our Spring WS (POX) Web Services.

          This forum rocks!

          - m


          • #6
            Hi Marten,

            DomPoxMessageFactory creates an empty xml for me.

            <?xml version="1.0" encoding="UTF-8" standalone="no"?>

            My code looks like this

            <int:channel id="requestChannel" datatype="com.xx.yy.schema.REQ" />

            uri="http://localhost:8080/service/myservice" id="Gateway"
            request-channel="requestChannel" reply-channel="responseChannel"
            auto-startup="true" marshaller="mesgMarshaller" unmarshaller="mesgMarshaller"
            message-factory="msgFactory" />

            <bean id="msgFactory" class=" eFactory">

            <oxm:jaxb2-marshaller id="mesgMarshaller">
            <oxm:class-to-be-bound name="com.xx.yy.schema.REQ"/>
            <oxm:class-to-be-bound name="com.xx.yy.schema.RES"/>

            Please let me know if I have missed out on something?
            Last edited by prish; Jul 22nd, 2013, 11:10 PM.