-
1. Re: getSOAPHeader() value is null : Migrating webservices from JBOSS 5.1.0 GA to JBOSS 7.1.1 final
nickarls Mar 12, 2013 2:38 AM (in response to edimukc)Can you list the headers and see what's actually in there?
-
2. Re: getSOAPHeader() value is null : Migrating webservices from JBOSS 5.1.0 GA to JBOSS 7.1.1 final
jaysensharma Mar 12, 2013 3:50 AM (in response to edimukc)Hi Arjun,
SOAPHeader header=context.getMessage().getSOAPHeader(); System.out.println("Soap Header = "+header); // ======================> Do you see null here ?
if yes then it means client is not sending a SoapHeader. In order to verify that Can you dump the SOAPMessage to see if there is any SOAPHeader actually coming as part of clients request or not ?
One way to achieve the same in JBoss AS7 is to use the "LoggingInInterceptor" and "LoggingOutInterceptor" On server side or on Client side .
/* Following part of code is needed for client side Logging of Soap request/response */
/* We need to make sure that we place the "log4j.properties" file inside clients classpath */
Client client = ClientProxy.getClient(port);
client.getInInterceptors().add(new LoggingInInterceptor());
client.getOutInterceptors().add(new LoggingOutInterceptor());
http://middlewaremagic.com/jboss/?p=1300
And
http://cxf.apache.org/docs/debugging-and-logging.html
On The Ser\ver Side For CXF SOAP Message Logging we can use the following System Property:
<system-properties>
<property name="org.apache.cxf.logging.enabled" value="true"/>
</system-properties>
OR
see [1] https://docs.jboss.org/author/display/JBWS/Advanced+User+Guide#AdvancedUserGuide-Logging
[2] -Dcom.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump=true to enable the dump of any jaxws-soap-network traffic. Google for it to find more details
-
3. Re: getSOAPHeader() value is null : Migrating webservices from JBOSS 5.1.0 GA to JBOSS 7.1.1 final
edimukc Mar 14, 2013 11:24 AM (in response to nickarls)Hi Nicklas,
Thanks for the reply.
soap header details are
-----------------------------------
<SOAP-ENV:Header><wsse:Security><wsse:BinarySecurityToken>XXXXXXXXXXXXXXXXXactret</wsse:BinarySecurityToken></wsse:Security></SOAP-ENV:Header>
I am getting soap header value as "null", when I try to access the BinarySecurityToken value using above code
-
4. Re: getSOAPHeader() value is null : Migrating webservices from JBOSS 5.1.0 GA to JBOSS 7.1.1 final
nickarls Mar 15, 2013 1:57 AM (in response to edimukc)Just guessing but can the namespace be involved? Can you programmatically iterate over the headers? Or at least get a count of them?
-
5. Re: getSOAPHeader() value is null : Migrating webservices from JBOSS 5.1.0 GA to JBOSS 7.1.1 final
edimukc Mar 15, 2013 6:32 AM (in response to nickarls)Hi Nicklas,
I was not able to iterate over the soapHeader as soapHeader was null as mentioned below ...
SOAPHeader header=context.getMessage().getSOAPHeader();
System.out.println("Soap Header = "+header); ---------------------> prints nullThanks for the reply.
-
6. Re: getSOAPHeader() value is null : Migrating webservices from JBOSS 5.1.0 GA to JBOSS 7.1.1 final
edimukc Mar 18, 2013 1:59 AM (in response to edimukc)Hi All,
Soap Header Details are
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<SOAP-ENV:Header>
<wsse:Security>
<wsse:BinarySecurityToken>actbgkzerrgekt</wsse:BinarySecurityToken>
</wsse:Security>
</SOAP-ENV:Header><SOAP-ENV:Body>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>In Jboss 7.1.1 final, I could not get the details (BinarySecurityToken value) present in SOAP Header using the code mentioned below.
actSOAPHandler.java :
--------------------------------import javax.xml.ws.handler.soap.SOAPHandler;
import javax.xml.ws.handler.soap.SOAPMessageContext;public class actSOAPHandler implements SOAPHandler<SOAPMessageContext> {
@Override
public boolean handleMessage(SOAPMessageContext context) { }
NodeList actSessionList = context.getMessage().getSOAPHeader().getElementsByTagName("BinarySecurityToken");
}