Schweter, Ryan wrote:
Figured it out..
The SaajMarshaler is adding SOAP message properties, not HTTP Headers.
This fixed it:
protected void addSoapProperties(SOAPMessage soapMessage,
NormalizedMessage normalizedMessage) throws SOAPException {
MimeHeaders headers = soapMessage.getMimeHeaders();
for (Iterator iter =
normalizedMessage.getPropertyNames().iterator(); iter.hasNext();) {
String name = (String) iter.next();
Object value = normalizedMessage.getProperty(name);
if (shouldIncludeHeader(normalizedMessage, name, value)) {
soapMessage.setProperty(name, value);
headers.addHeader(name, value.toString());
}
}
}
I just got a ref to the MimeHeaders obj and added a header along with a
message property. If your intention was to add headers, you could
replace the setProperty call with addHeader.
Aha! :)
My bad for not using the headers; I meant to use those :)
I raised a JIRA issue for this one...
http://jira.logicblaze.com/jira/browse/SM-49
so we can track this in the release notes. I've applied your patch with
a minor refactor (there are now 2 methods to decide if a property should
be a SAAJ MimeHeader or a SAAJ property).
Many thanks!
James
-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of James Strachan
Sent: Tuesday, August 30, 2005 2:15 PM
To: [email protected]
Subject: Re: [servicemix-user] SOAPAction Not Set Using SaajBinding
Schweter, Ryan wrote:
I tried that already. Although since I'm having trouble getting the
HTTP headers to get pulled out of the properties collection it might
be
a similar issue (even though the SaajMarshaler doesn't require
"instanceof string" on it's headers).
I've just added a new test case which demonstrates invoking multiple
services from inside the XPath Router and added a test case that the
generated messages all have the right header values - which are all
Strings.
So this part is definitely working fine in the XPath Router. You can see
the test case yourself here...
http://cvs.servicemix.codehaus.org/servicemix/base/src/test/java/org/ser
vicemix/components/xslt/XsltPublisherTest.java?rev=HEAD&view=auto
with this XSL...
http://cvs.servicemix.codehaus.org/servicemix/base/src/test/resources/or
g/servicemix/components/xslt/publish.xsl?rev=HEAD&view=auto
and this configuration
http://cvs.servicemix.codehaus.org/servicemix/base/src/test/resources/or
g/servicemix/components/xslt/publish.xml?rev=HEAD&view=auto
So having something like
<jbi:invoke service="foo:service2">
<jbi:setOutProperty name="SOAPAction" select="whatever"/>
<xsl:copy-of select="/"/>
</jbi:invoke>
Should do the trick from inside the XPath Router to pass the SOAPAction
header.
Any ideas why this isn't working?
James
-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of James Strachan
Sent: Tuesday, August 30, 2005 9:08 AM
To: [email protected]
Subject: Re: [servicemix-user] SOAPAction Not Set Using SaajBinding
Schweter, Ryan wrote:
I'm attempting to call a .net web service using SaajBinding. The SOAP
request looks perfect exception that the SOAPAction is empty. Anyone
know how to set it?
I don't see a SAAJ standard way to set it. I wonder does adding a
"SOAPAction" property to the NormalizedMessage before invoking the
SaajBinding help at all? If set that should appear as a SAAJ
SOAPMessage.addMimeHeader() which might do the trick.
If that does the trick we could customize the binding some more to
make
it easier to configure a SOAPAction from the Spring.xml
--
James
-------
http://radio.weblogs.com/0112098/