You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Markus Mitterer <ma...@gmx.at> on 2005/04/20 11:32:26 UTC

WG: using Client-Stub class from WSDL2Java to addHeader


Hello,

I searched the list but could't get an answer to my specific problem:

I use the classes which where generated by WSDL2Java tool. In my
xxxSoapBindingStub class I want to extend my soap message with a custom
header element. I use the following code and always get a
ClassCastException:

The exception occurs during the call to _call.invoke() and SoapMonitor tells
me that no message is transmitted (the exception occurs on the client)

Java-Code:
org.apache.axis.message.SOAPHeaderElement header;
header  = new org.apache.axis.message.SOAPHeaderElement(new
javax.xml.namespace.QName("http://wsserver.medsys.xsoap.sectino",
"XSoapUser"), "123");
header.setActor("MyActorName");
_call.addHeader(header);

Exception:
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: java.lang.ClassCastException
 faultActor: 
 faultNode: 
 faultDetail: 
      {http://xml.apache.org/axis/}hostname:qe-fs-1

java.lang.ClassCastException

 
Any help is appreciated

regards
Markus
Computer Science University of Innsbruck