Re: [jboss-user] [JBoss Web Services] - setHeader and setServerURL, using javax.xml.ws.Service?
by Kreek Fred
Kreek Fred [http://community.jboss.org/people/fredk] replied to the discussion
"setHeader and setServerURL, using javax.xml.ws.Service?"
To view the discussion, visit: http://community.jboss.org/message/558205#558205
--------------------------------------------------------------
Don't know whether you still need the info, but I found a solution:
(examples uses the sf wsdl, but can be applied in general)
{code}
Soap port = .....
SessionHeader sessionHeader = ......
// Sessionheader properties
QName xmlType = new QName( "urn:enterprise.soap.sforce.com","SessionHeader" );
QName xmlName = new QName( "urn:enterprise.soap.sforce.com","SessionHeader" );
Class<?> javaType = SessionHeader.class
// Register mapping
StubExt stub = (StubExt) port;
TypeMapping mapping = stub.getEndpointMetaData().getServiceMetaData().getTypeMapping();
AbstractSerializerFactory serFactory = new JAXBSerializerFactory();
AbstractDeserializerFactory deserFactory = new JAXBDeserializerFactory();
mapping.register( javaType, xmlType, serFactory, deserFactory );
// Add header to message
stub.addUnboundHeader( xmlName, xmlType, javaType, ParameterMode.IN );
stub.setUnboundHeaderValue( xmlName, this.sessionHeader );
{code}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/558205#558205]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 1 month