I think if you use the Dispatch class with raw XML you can send the
service whatever you want:
http://www.jroller.com/gmazza/entry/calling_rpc_encoded_web_services
On 27.01.2011 13:20, Taylor Jones (tayjones) wrote:
Hi everyone, I have a bit of a weird question here. It may be trivial to
a more experienced user though, I'm kind of new to CXF and webservices
in general.
I'm working with CXF to generate Java classes from WSDLs, with which I
interface with a commercial product's exposed SOAP services. The problem
is, the product's XML implementation is sort of funky and I kind of need
CXF to break a few rules to marshal the XML for the SOAP service.
Basically, the form of the soap request expected by the product is this:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<Auth xmlns="namespace1">
<SessionID>5000156__171120a:10a241ff830:-7f711143139816999</SessionID>
</Auth>
</soap:Header>
<soap:Body>
<Read xmlns="namespace1">
<DataBus
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../xsd/read.xsd" xmlns="">
<Header version="12.0.0.5028" />
<Query>
<Filter name="subject"
criteria="EQUALS">some filter text</Filter>
</Query>
</DataBus>
</Read>
</soap:Body>
</soap:Envelope>
I've written a WSDL such that everything CXF generates is fine, verified
this with Wireshark, except for the namespace of the<DataBus> tag. I
don't think it's possible to write a WSDL or schema in such a way that
CXF generates a DataBus class in a blank namespace (maybe it is, I'd
love to be proven wrong there). So, I tried writing an interceptor to do
this manually on outgoing requests, but after the<DataBus> tag is
modified to have a blank namespace the child tags are suddenly generated
with xmlns="namespace1" attribute. It doesn't seem that there is a place
in the interceptor chain to prevent this change from happening, so I'm
pretty much out of ideas. The commercial product I'm using will not
accept these tags unless the namespaces are "correct"; that is to say,
what it expects to receive, not what is standard. Would anyone here be
able to help or point me in a good direction to accomplish this?
Taylor Jones
--
Glen Mazza
Software Engineer, Talend (http://www.talend.com)
blog: http://www.jroller.com/gmazza