[jboss-user] [JBoss Web Services] - setHeader and setServerURL, using javax.xml.ws.Service?
Kreek Fred
do-not-reply at jboss.com
Thu Aug 19 14:06:10 EDT 2010
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&containerType=14&container=2044]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100819/3bccb4f6/attachment.html
More information about the jboss-user
mailing list