[
http://jira.codehaus.org/browse/XFIRE-832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_89423
]
Andreas Baumann commented on XFIRE-832:
---------------------------------------
Exporting a setter function for the HTTPInvoker is also an idea (see Spring
HTTP invoker), so you can
choose between SUN HTTP or Commons HTTPClient and you can also add something
which is missing,
as I have seen it on the web (don't remember the place, sorry):
--- snip ---
import
org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor;
import org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration;
import org.apache.commons.httpclient.methods.PostMethod;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.Credentials;
import org.apache.commons.httpclient.auth.AuthScope;
public class AuthenticatedCommonsHttpInvokerRequestExecutor extends
CommonsHttpInvokerRequestExecutor {
protected String username;
protected String password;
public void setUsername( String username ) {
this.username = username;
}
public void setPassword( String password ) {
this.password = password;
}
protected void setRequestBody( HttpInvokerClientConfiguration config,
PostMethod postMethod, ByteArrayOutputStream baos) throws IOException {
super.setRequestBody( config, postMethod, baos );
Credentials credentials = new UsernamePasswordCredentials(
username, password );
getHttpClient( ).getState( ).setCredentials( AuthScope.ANY,
credentials );
}
}
--- snap ----
> XFire throws exception when working with secure WSDL's
> ------------------------------------------------------
>
> Key: XFIRE-832
> URL: http://jira.codehaus.org/browse/XFIRE-832
> Project: XFire
> Issue Type: Bug
> Affects Versions: 1.2.3
> Reporter: Andres Bernasconi
> Assigned To: Dan Diephouse
> Priority: Critical
>
> While trying to upgrade from 1.1.2 to 1.2.3 I encountered the following
> error. Notice that I'm using spring to configure XFire, so I'm creating an
> XFireClientFactoryBean.
> My WSDL is secured (http username / password), and I get the following
> exception:
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creati
> ng bean with name 'elementManagerService' defined in class path resource
> [servic
> es-context.xml]: Cannot resolve reference to bean 'elementManagerTarget'
> while s
> etting bean property 'target'; nested exception is
> org.springframework.beans.fac
> tory.BeanCreationException: Error creating bean with name
> 'elementManagerTarget'
> defined in class path resource [services-context.xml]: Initialization of
> bean f
> ailed; nested exception is java.io.FileNotFoundException: Response: '401:
> Unauth
> orized xxx' for url: '
> http://localhost:8001/ElementManager/ElementManagerService
> ?WSDL'
> I tracked down the problem to the Resolver class, where in line 74 it tries
> to:
> is = relative.toURL().openStream();
> I have an outHandler configured to add security to my outgoing messages, but,
> obviously it is not being called.
> This works well with 1.1.2 (don't know if in such version XFire tried to get
> a hold of the WSDL doc). This basically prevents from moving on the new
> versions of the stack.
> Thanks a lot
> Andres Bernasconi.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email