Loading ...
Sorry, an error occurred while loading the content.
 

Re: Basic auth using Java & apache SOAP

Expand Messages
  • august_pm
    try this in the proxy org.apache.soap.transport.http.SOAPHTTPConnection soapTransport = new org.apache.soap.transport.http.SOAPHTTPConnection();
    Message 1 of 4 , Jun 6, 2003
      try this in the proxy

      org.apache.soap.transport.http.SOAPHTTPConnection soapTransport =
      new org.apache.soap.transport.http.SOAPHTTPConnection();
      soapTransport.setUserName(userID);
      soapTransport.setPassword(password);
      call.setSOAPTransport(soapTransport);



      --- In soapbuilders@yahoogroups.com, "Dave" <dtregay@y...> wrote:
      > Thanks for responding. Unfortunately, those methods are new in the
      > axis implementation. I'm not sure which version of SOAP I have (in
      > WAS4), but the API seems to match this:
      >
      > http://ws.apache.org/soap/docs/apiDocs/org/apache/soap/rpc/Call.html
      >
      > --- In soapbuilders@yahoogroups.com, "Saha, Saikat"
      > <saikat.saha@c...> wrote:
      > > You can set it in your generated stub by doing following
      > > org.apache.axis.client.Call _call = createCall();
      > > _call.setUsername("USER");
      > > _call.setPassword("password");
      > >
      > > Thanks,
      > > Saikat
      > >
      > > -----Original Message-----
      > > From: Dave [mailto:dtregay@y...]
      > > Sent: Tuesday, June 03, 2003 3:38 PM
      > > To: soapbuilders@yahoogroups.com
      > > Subject: [soapbuilders] Basic auth using Java & apache SOAP
      > >
      > >
      > > I'm developing in WSAD, and I'm trying to modify the Proxy class
      > > generated to call my web service so that it provides the
      > credentials
      > > for basic authentication. Following is the relevant code:
      > >
      > > import org.apache.soap.rpc.*;
      > >
      > > Call call = new Call();
      > > SOAPMappingRegistry smr = call.getSOAPMappingRegistry();
      > > String targetObjectURI
      = "http://tempuri.org/SampleSOAPInterface";
      > > String SOAPActionURI = "";
      > >
      > > call.setMethodName("execute");
      > > call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
      > > call.setTargetObjectURI(targetObjectURI);
      > > Vector params = new Vector();
      > > [...params details unimportant, just strings for my method]
      > > call.setParams(params);
      > > Response resp = call.invoke(getURL(), SOAPActionURI);
      > >
      > > When I run the generated proxy without modification, it fails
      > > authentication. When I stepped through the execution I noticed
      > that
      > > the st variable (SOAPTransport) is created somewhere inside of
      the
      > > invoke. I don't have source code, so I'm not sure where, but it
      > > holds an instance of SOAPHTTPConnection.
      > >
      > > What I'd like to know is if there is any way to have it set the
      > > userName and password values on the SOAPHTTPConnection. Are
      there
      > > parameters I can set on the Call object that will populate these,
      > or
      > > is there some other way to do it?
      > >
      > >
      > >
      > > -----------------------------------------------------------------
      > > This group is a forum for builders of SOAP implementations to
      > discuss
      > > implementation and interoperability issues. Please stay on-topic.
      > >
      > > To unsubscribe from this group, send an email to:
      > > soapbuilders-unsubscribe@yahoogroups.com
      > >
      > >
      > >
      > > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
    Your message has been successfully submitted and would be delivered to recipients shortly.