Specify the username, password and timeout ,in a jboss web service client.
In your generated client class , getting Soap instance method ,
eg:
public TESTGenericDataAccessSoap getTESTGenericDataAccessSoap(){
{
TESTGenericDataAccessSoap soap = super.getPort(TESTGenericDataAccessSoap , TESTGenericDataAccessSoap . class);
BindingProvider bp = (BindingProvider)soap;
Stub stub = (Stub)soap;
stub._setProperty(StubExt. PROPERTY_CLIENT_TIMEOUT, 10); //Time out
bp.getRequestContext().put( BindingProvider.USERNAME_ PROPERTY, "jijo");//Username
bp.getRequestContext().put( BindingProvider.PASSWORD_ PROPERTY, "jijo");//Password
return soap;
}
The import classes are given,
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.rpc.Stub;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws. WebServiceFeature;
import javax.xml.ws.Service;
import org.jboss.ws.core.StubExt;
In your generated client class , getting Soap instance method ,
eg:
public TESTGenericDataAccessSoap getTESTGenericDataAccessSoap(){
{
TESTGenericDataAccessSoap soap = super.getPort(TESTGenericDataAccessSoap , TESTGenericDataAccessSoap .
BindingProvider bp = (BindingProvider)soap;
Stub stub = (Stub)soap;
stub._setProperty(StubExt.
bp.getRequestContext().put(
bp.getRequestContext().put(
return soap;
}
The import classes are given,
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.rpc.Stub;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.
import javax.xml.ws.Service;
import org.jboss.ws.core.StubExt;
1 comment:
thanks for the interesting information
Post a Comment