[JBossWS] - Call properties
by alesj
Regarding (basic) authentication from annotated web client (@WebServiceClient) I added the following code:
| JSR181ClientMetaDataBuilder.rebuildEndpointMetaData
|
| // Process @CallProperties
| if (wsClass.isAnnotationPresent(CallProperties.class))
| processCallProperties(epMetaData, wsClass);
|
| JSR181MetaDataBuilder
|
| protected void processCallProperties(EndpointMetaData epMetaData, Class wsClass)
| {
| CallProperties callProperties = (CallProperties) wsClass.getAnnotation(CallProperties.class);
|
| int length = callProperties.keys().length;
| if (length > 0)
| {
| Properties properties = epMetaData.getProperties();
| if (properties == null)
| {
| epMetaData.setProperties(new Properties());
| }
| }
|
| if (length != callProperties.values().length)
| {
| throw new IllegalArgumentException("Different lenght of call properties: keys != values");
| }
|
| for(int i = 0; i < length; i++)
| {
| epMetaData.getProperties().setProperty(callProperties.keys(), callProperties.values());
| }
| }
|
So that when we do SOAPConnectionImpl.getRemotingMetaData we actually get username / password call properties.
Example:
| @WebService
| @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
| @CallProperties(
| keys = {"javax.xml.rpc.security.auth.username", "javax.xml.rpc.security.auth.password"},
| values = {"tomcat", "tomcat"}
| )
| public interface AccountService {
|
| @WebMethod
| @WebResult(name = "createAccountReturn")
| Account createAccount(String username);
|
| @WebMethod
| @Oneway
| void insertAccount(Account account);
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984878#3984878
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984878
18 years, 1 month
[JBossWS] - how to application-client.xml e jboss-client.xml for sessio
by croisfert
I am working with jboss-4.0.5.GA (jems-installer-1.2.0.BETA3) and self contained jbossws (jbossws-1.0.3.GA), i am trying to develop an enterprise stateless session bean(2.x) as a client for a public webservice on an internet.
I have created a standalone client (simple java class with main method not deployed in jboss) and it work fine.
The session bean client not work, it not bound the service JNDI handler the error is "javax.servlet.ServletException: jbossws-client not bound "
Im using application-client.xml and jboss-client.xml in META-INF dir of bean jar to configure the webservice jndi handler but this method not work.
In the log file the web service are not binded.
If i write the <service-ref>... directly in the ejb-jar.xml and and not use application-client.xml, in the log file i look
"2006-11-10 12:49:19,625 DEBUG [org.jboss.ws.metadata.wsdl.WSDL11DefinitionFactory] parse: jar:file:/C:/jboss-4.0.5.GA/server/default/tmp/deploy/tmp21284wsclients.ear-contents/wsclients-ejb.jar!/META-INF/wsdl/HyperlinkExtractor.wsdl
2006-11-10 12:49:20,234 DEBUG [org.jboss.ws.integration.jboss.WebServiceClientDeployer] Webservice binding: java:comp/env/service/HyperlinkExtractor"
Use of application-client.xml and jboss-client.xml are not implemented?
Why dont work?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984867#3984867
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984867
18 years, 1 month
[JBossWS] - Re: WS basic auth only for post requests
by alesj
Is there a way to currently get a BASIC auth secured .wsdl with JBossWS?
| WSDLDefinitionsFactory
|
| private Document getDocument(URL wsdlLocation) throws WSDLException
| {
| try
| {
| InputStream wsdlInputStream = wsdlLocation.openStream();
| try
| {
| DocumentBuilder builder = DOMUtils.getDocumentBuilder();
| return builder.parse(wsdlInputStream);
| }
| finally
| {
| wsdlInputStream.close();
| }
| }
| catch (ConnectException ex)
| {
| throw new WSDLException("Cannot connect to: " + wsdlLocation);
| }
| catch (Exception ex)
| {
| throw new WSDLException("Cannot parse wsdlLocation: " + wsdlLocation, ex);
| }
| }
|
This is probably the code that fetches .wsdl?
How to push username / password in?
Should be using something like this then:
| if(!wsdlurl.getProtocol().startsWith("http"))
| return new InputSource(uri);
| java.net.URLConnection connection = wsdlurl.openConnection();
| if(!(connection instanceof HttpURLConnection))
| return new InputSource(uri);
| HttpURLConnection uconn = (HttpURLConnection)connection;
| String userinfo = wsdlurl.getUserInfo();
| uconn.setRequestMethod("GET");
| uconn.setAllowUserInteraction(false);
| uconn.setDefaultUseCaches(false);
| uconn.setDoInput(true);
| uconn.setDoOutput(false);
| uconn.setInstanceFollowRedirects(true);
| uconn.setUseCaches(false);
| String auth = null;
| if(userinfo != null)
| auth = userinfo;
| else
| if(username != null)
| auth = password != null ? username + ":" + password : username;
| if(auth != null)
| uconn.setRequestProperty("Authorization", "Basic " + base64encode(auth.getBytes("ISO-8859-1")));
| uconn.connect();
| return new InputSource(uconn.getInputStream());
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984851#3984851
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984851
18 years, 1 month
[JBossWS] - Axis problems on jboss 4.0.1sp1
by mvitale
Hi folks.
I'm trying to deploy the Apache Axis jars into JBoss 4.0.1sp1 on HP/UX, and I'm running into a few issues. I'm trying to have my JBoss server interact with a SOAP Server at Melissa Data corporation (an Address Validation service.) It shouldn't matter, but in the interest of full information...They're running IIS at MD, and their SOAP server is written in .NET. My code is, obviously, Java.
First, the error that I'm receiving in the server logs is:
16:33:30,713 ERROR [Engine] StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
java.lang.NoSuchMethodError: org.apache.axis.description.TypeDesc.(Ljava/lang/Class;Z)V
I have removed the jboss-ws4ee.sar directory from the $JBOSS_HOME/server/default/deploy directory.
I have followed Vishal's instructions noted in http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3866172#3866172
Neither of the above seem to help.
I have deployed the Apache Axis version 1.4 JARs inside my war file.
For various reasons, we are unable to upgrade JBoss past version 4.0.1sp1 at this time.
If anyone has any ideas about something that might help me out, I'm very interested in hearing them.
Thanks,
Mike Vitale
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984788#3984788
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984788
18 years, 1 month