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

Basic auth using Java & apache SOAP

Expand Messages
  • Dave
    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.
    Message 1 of 4 , Jun 3, 2003
    • 0 Attachment
      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?
    • Saha, Saikat
      You can set it in your generated stub by doing following org.apache.axis.client.Call _call = createCall(); _call.setUsername( USER );
      Message 2 of 4 , Jun 3, 2003
      • 0 Attachment
        RE: [soapbuilders] Basic auth using Java & apache SOAP

        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@...]
        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?


        ------------------------ Yahoo! Groups Sponsor ---------------------~-->
        Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
        http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/W6uqlB/TM
        ---------------------------------------------------------------------~->

        -----------------------------------------------------------------
        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/

      • Dave
        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
        Message 3 of 4 , Jun 4, 2003
        • 0 Attachment
          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/
        • august_pm
          try this in the proxy org.apache.soap.transport.http.SOAPHTTPConnection soapTransport = new org.apache.soap.transport.http.SOAPHTTPConnection();
          Message 4 of 4 , Jun 6, 2003
          • 0 Attachment
            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.