This content has been marked as final.
Show 3 replies
-
1. Re: using a webservice in jboss-4.0.4rc1
anders.hedstrom Mar 21, 2006 5:36 AM (in response to dust_puppy)The version of EJB3 that comes with JBoss AS 4.0.4RC1 doesn't support the web service ref yet
see: http://jboss.com/index.html?module=bb&op=viewtopic&t=79178
The workaround I used when moving my application from EJB2.1 to EJB3 was to not follow the way you're supposed to consume web services within a EJB. I instead create the actual soap xml myself and code directly against SAAJ.private SOAPMessage callWS(String soapXml, URL endpoint, String soapAction) throws SOAPException, IOException{ MessageFactory msgFactory = MessageFactory.newInstance(); MimeHeaders mimeHeaders = new MimeHeaders(); mimeHeaders.addHeader("Content-Type", "text/xml; charset=UTF-8"); if(soapAction != null && soapAction.length() > 0){ mimeHeaders.addHeader("SOAPAction",soapAction); } ByteArrayInputStream in = new ByteArrayInputStream(soapXml.getBytes()); SOAPMessage reqMsg = msgFactory.createMessage(mimeHeaders, in); SOAPConnectionFactory conFactory = SOAPConnectionFactory.newInstance(); SOAPConnection conn = conFactory.createConnection(); return conn.call(reqMsg, endpoint); }
Cheers
//Anders -
3. Re: using a webservice in jboss-4.0.4rc1
dust_puppy Mar 22, 2006 7:34 AM (in response to dust_puppy)great! the WSclientAppl aproch seems to be the simplest, il try it out =)
/Anders