Table of Contents
This page contains information about Eclipse Implementation of XML Web Services 2.3.6 specific features and extensions:
At times you need a way to send and receive SOAP headers in your
message - these headers may not be defined in the WSDL binding but
your application needs to do it anyway. One approach has been to write
a SOAPHandler
to do it, but its more work and is
expensive as SOAPHandlers
work on
SOAPMesssage
which is DOM based and Eclipse Implementation of XML Web Services runtime
would need to do conversion from its abstract
Message
representation to
SOAPMessage
and vice versa.
There is a way to do it on the client side by downcasting the
proxy to WSBindingProvider
and use methods on
it.
You would downcasting the proxy to
WSBindingProvider
and set the
Outbound
headers.
HelloService helloService = new HelloService(); HelloPort port = helloService.getHelloPort(); WSBindingProvider bp = (WSBindingProvider) port; bp.setOutboundHeaders( // simple string value as a header, like stringValue Headers.create(new QName("simpleHeader"), "stringValue"), // create a header from Jakarta XML Binding object Headers.create(jaxbContext, myJaxbObject));
List<Header> inboundHeaders = bp.getInboundHeaders();
Web Services developers generally need to see SOAP Messages that are transferred between client and service for debugging. There are SOAP Monitors for this job, but you need modify the client or server code to use those tools. Eclipse Implementation of XML Web Services provides logging of SOAP messages
Set system property
com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true
Set system property
com.sun.xml.ws.transport.http.HttpAdapter.dump=true
This is a very useful feature while developing Web Services.
Often the soap fault messages for not user defined faults does not
convey enough information about the problem. Eclipse Implementation of XML Web Services
relieves you from digging out the server logs to find out the stacktrace.
Whole stacktrace (including nested exceptions) can be propagated in the
SOAP Fault and the complete exception stacktrace can be made visible to
the client as cause of SOAPFaultException
.
Propagation of Stack trace is off by default. To turn it on for your Web Service Application to send the complete stack trace, set the system property
com.sun.xml.ws.fault.SOAPFaultBuilder.captureStackTrace=true
The soap fault messages has a faultstring which contains the exception message if any received from the server side. If the customer does not want to display any exception messages from the server side then this system property can be used to disable that.
The capture of exception message in faultstring is enabled by default. For your Web Service Application to disable the capture of exception message in faultstring, set the system property to false
com.sun.xml.ws.fault.SOAPFaultBuilder.captureExceptionMessage=false