Hello,
I need to place some parameters in a header and send the others as
a body. However when i try to place some in a header i get error.
This is the code of the CLIENT:
Header header=new Header();
Vector params = new Vector ();
params.addElement (new Parameter("UserName", String.class,
"xxx", Constants.NS_URI_SOAP_ENC));
(...) <-- other params (similar as the one above)
header.setHeaderEntries(params);
// build the call.
Call call = new Call();
call.setSOAPTransport(st);
call.setSOAPMappingRegistry (smr);
//"urn:xmethods-Temperature" (below--> for the temperature thing
call.setTargetObjectURI("https://www.creditinform.no/creditinform
.standardwebservice.ws2005207/InfoXML");
call.setMethodName("HitListPerson");
call.setEncodingStyleURI("http://schemas.xmlsoap.org/soap/encodin
g/");
call.setHeader(header);
And i get the following error:
java.lang.ClassCastException: org.apache.soap.rpc.Parameter
at org.apache.soap.Header.marshall(Header.java:134)
at org.apache.soap.Envelope.marshall(Envelope.java:197)
at org.apache.soap.Envelope.marshall(Envelope.java:162)
at
org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnect
ion.java:354)
at org.apache.soap.rpc.Call.invoke(Call.java:261)
Any sugestion could be helpfull.
Thank you for your time,
C.E.