Return-Path: Delivered-To: apmail-axis-java-user-archive@www.apache.org Received: (qmail 47726 invoked from network); 10 Sep 2010 12:02:01 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 10 Sep 2010 12:02:01 -0000 Received: (qmail 54107 invoked by uid 500); 10 Sep 2010 12:01:59 -0000 Delivered-To: apmail-axis-java-user-archive@axis.apache.org Received: (qmail 53725 invoked by uid 500); 10 Sep 2010 12:01:55 -0000 Mailing-List: contact java-user-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@axis.apache.org Delivered-To: mailing list java-user@axis.apache.org Received: (qmail 53714 invoked by uid 99); 10 Sep 2010 12:01:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Sep 2010 12:01:54 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [62.206.52.69] (HELO smtp.soloplan.de) (62.206.52.69) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Sep 2010 12:01:49 +0000 Received: from soloplan203.soloplan.de (unknown [192.168.156.203]) by smtp.soloplan.de (Postfix) with ESMTP id A46985F801 for ; Fri, 10 Sep 2010 14:01:26 +0200 (CEST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CB50DF.E55E5797" Subject: AW: AW: Axis and WS-Security on a standalone client Date: Fri, 10 Sep 2010 14:01:26 +0200 Message-ID: <1A3D5F1165829041A6E13EC92EBCC193017F6E11@soloplan203.soloplan.de> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: AW: Axis and WS-Security on a standalone client Thread-Index: ActQ2+ACrav+48S5S8CBbDh2yR+pwwAA/i5Q References: <1A3D5F1165829041A6E13EC92EBCC193017F6CBB@soloplan203.soloplan.de> ,<1A3D5F1165829041A6E13EC92EBCC193017F6CF2@soloplan203.soloplan.de> From: "Markus Schaber" To: ------_=_NextPart_001_01CB50DF.E55E5797 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, Martin, =20 I just cannot figure out how your advice is related to my problem, = sorry. =20 Markus =20 *************************************************************************= * Soloplan GmbH Software f=FCr Logistik und Planung Markus Schaber (Dipl.-Informatiker) Entwicklung, Projektleitung Burgstra=DFe 20 | 87435 Kempten | Deutschland Telefon: +49 831 57407-0 | Telefax: +49 831 57407-111 E-Mail: msr@soloplan.de | Internet: = www.soloplan.de =20 Gesch=E4ftsf=FChrer: Wolfgang Heidl, HRB 5304 Kempten ________________________________ Von: Martin Gainty [mailto:mgainty@hotmail.com]=20 Gesendet: Freitag, 10. September 2010 13:32 An: java-user@axis.apache.org Betreff: RE: AW: Axis and WS-Security on a standalone client =20 You must define operation of GetCurrentLocation() with required = parameters as well as the return parameter Martin Gainty=20 ______________________________________________=20 Verzicht und Vertraulichkeitanmerkung/Note de d=E9ni et de = confidentialit=E9 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene = Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede = unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. = Diese Nachricht dient lediglich dem Austausch von Informationen und = entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten = Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt = uebernehmen. Ce message est confidentiel et peut =EAtre privil=E9gi=E9. Si vous = n'=EAtes pas le destinataire pr=E9vu, nous te demandons avec bont=E9 que = pour satisfaire informez l'exp=E9diteur. N'importe quelle diffusion non = autoris=E9e ou la copie de ceci est interdite. Ce message sert =E0 = l'information seulement et n'aura pas n'importe quel effet l=E9galement = obligatoire. =C9tant donn=E9 que les email peuvent facilement =EAtre = sujets =E0 la manipulation, nous ne pouvons accepter aucune = responsabilit=E9 pour le contenu fourni. =20 > Subject: AW: Axis and WS-Security on a standalone client > Date: Fri, 10 Sep 2010 08:11:46 +0200 > From: MSR@soloplan.de > To: java-user@axis.apache.org >=20 > Hi, >=20 > I also tried to subscribe via the links given on = http://ws.apache.org/axis2/mail-lists.html and they point to obsolete = lists, it seems - the resulting mailer daemon message is where I got = redirected to this place. >=20 > Markus >=20 > = *************************************************************************= * > Soloplan GmbH > Software f=FCr Logistik und Planung > Markus Schaber (Dipl.-Informatiker) > Entwicklung, Projektleitung > Burgstra=DFe 20 | 87435 Kempten | Deutschland > Telefon: +49 831 57407-0 | Telefax: +49 831 57407-111 > E-Mail: msr@soloplan.de | Internet: www.soloplan.de > Gesch=E4ftsf=FChrer: Wolfgang Heidl, HRB 5304 Kempten > > -----Urspr=FCngliche Nachricht----- > > Von: Andreas Veithen [mailto:andreas.veithen@gmail.com] > > Gesendet: Donnerstag, 9. September 2010 20:49 > > An: java-user@axis.apache.org > > Betreff: Re: Axis and WS-Security on a standalone client > >=20 > > As part of the promotion of the Axis project to a top level project, > > we have decided to create separate mailing lists for Axis 1 and = Axis2. > > For all Axis 1 related questions please subscribe and post to > > axis1-java-user@axis.apache.org. Thanks! > >=20 > > Andreas > >=20 > >=20 > > On Thu, Sep 9, 2010 at 17:58, Markus Schaber = wrote: > > > Hello, > > > > > > I'm struggling with creating a standalone soap client that employs > > > WS-Security against a windows (WCF / .NET 3.5) server. > > > > > > When removing the WS-Security requirement from the server, = everything > > > works fine. But I just cannot get the java client to send the > > > appropriate SOAP headers with username and password. > > > > > > Most tutorials / FAQs I googled talk about deployment descriptors = in > > > Tomcat, but I do not have that, I just have some small standalone = java > > > application. > > > > > > My current state of the art is: > > > > > > package test; > > > > > > import java.io.IOException; > > > import java.net.MalformedURLException; > > > import java.net.URL; > > > > > > import javax.security.auth.callback.Callback; > > > import javax.security.auth.callback.CallbackHandler; > > > import javax.security.auth.callback.UnsupportedCallbackException; > > > import javax.xml.rpc.ServiceException; > > > > > > import org.apache.ws.security.WSConstants; > > > import org.apache.ws.security.WSPasswordCallback; > > > import org.apache.ws.security.handler.WSHandlerConstants; > > > import org.apache.ws.security.message.token.UsernameToken; > > > > > > import de.soloplan.TestServices.GPSPosition; > > > import de.soloplan.TestServices.TestServiceLocator; > > > import de.soloplan.TestServices.TestServices; > > > import de.soloplan.TestServices.TestServicesBindingStub; > > > > > > public class TestClass { > > > > > > /** > > > * @param args > > > * @throws ServiceException > > > * @throws MalformedURLException > > > */ > > > public static void main(String[] args) throws Exception { > > > > > > System.getProperties().setProperty("javax.net.ssl.trustStore", > > > "/home/schabi/.keystore"); > > > > > > System.getProperties().setProperty("javax.net.ssl.keyStore", > > > "/home/schabi/.keystore"); > > > > > > = System.getProperties().setProperty("javax.net.ssl.keyStorePassword", > > > "foobar"); > > > > > > System.getProperties().setProperty("javax.net.ssl.keyStoreType", = "JKS"); > > > > > > URL url =3D new > > > URL("https://localhost:62615/TestService"); > > > > > > TestServiceLocator locator =3D new = TestServiceLocator(); > > > > > > TestServices service =3D = locator.getTestServicesSOAP(url); > > > > > > TestServicesBindingStub stub =3D = (TestServicesBindingStub) > > > service; > > > > > > stub._setProperty(UsernameToken.PASSWORD_TYPE, > > > WSConstants.PASSWORD_DIGEST); > > > stub._setProperty(WSHandlerConstants.USER, = "test1"); > > > = stub._setProperty(WSHandlerConstants.PW_CALLBACK_REF, > > > new PWCallback()); > > > > > > GPSPosition position =3D = service.getCurrentLocation(-42); > > > > > > System.out.format("Position of vechile %s: Lat: %s, > > > Long: %s, Height: %s", vehicle, position.getLatitude(), > > > position.getLongitude(), position.getHeight()); > > > } > > > > > > public static class PWCallback implements CallbackHandler { > > > /** > > > * @see > > > = javax.security.auth.callback.CallbackHandler#handle(javax.security.auth. > > > callback.Callback[]) > > > */ > > > public void handle(Callback[] callbacks) throws = IOException, > > > UnsupportedCallbackException { > > > System.err.println("Called with " + = callbacks.length + " > > > callbacks."); > > > for (int i =3D 0; i < callbacks.length; i++) { > > > if (callbacks[i] instanceof WSPasswordCallback) = { > > > WSPasswordCallback pc =3D > > > (WSPasswordCallback)callbacks[i]; > > > // set the password given a username > > > if ("test1".equals(pc.getIdentifier())) { > > > pc.setPassword("1tset"); > > > System.err.println("Set password."); > > > } else { > > > System.err.println("No password > > > found."); > > > } > > > } else { > > > throw new > > > UnsupportedCallbackException(callbacks[i], "Unrecognized = Callback"); > > > } > > > } > > > } > > > } > > > } > > > > > > The stub and locator was autogenerated by eclipse, but if you have = any > > > better Idea, please tell me. I'm also not tied to axis, this was = just > > > what my eclipse autogenerated from the WSDL. > > > > > > I tried several different methods I found in google, all that I = deemed > > > to work without a tomcat running, but non success. The application > > > started fine with no exceptions, but simply did not send the = WS-Security > > > headers to the server. > > > > > > With .NET, it is some lines in the App.Config and then barely 20 = lines > > > of code, and it works: > > > > > > namespace Soloplan. SoapServer.Tests > > > { > > > using System; > > > using System.Diagnostics; > > > class TestConsoleApp > > > { > > > public static void Main() > > > { > > > var client =3D new > > > ServiceReference1.TestServicesClient("TestServicesSOAP", > > > "https://localhost:62615/TestService"); > > > Debug.Assert(client.ClientCredentials !=3D null, "No client > > > credentials"); > > > client.ClientCredentials.UserName.UserName =3D "test1"; > > > client.ClientCredentials.UserName.Password =3D "1tset"; > > > Console.WriteLine("got client, sending request"); > > > var location =3D client.GetCurrentLocation(-42); > > > Console.WriteLine("Got location: {0}/{1}", = location.longitude, > > > location.latitude); > > > Console.ReadLine(); > > > } > > > } > > > } > > > > > > > > > Any ideas? > > > Markus Schaber > > > > > > > > > = --------------------------------------------------------------------- > > > To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org > > > For additional commands, e-mail: java-user-help@axis.apache.org > > > > > > > >=20 > > = --------------------------------------------------------------------- > > To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org > > For additional commands, e-mail: java-user-help@axis.apache.org >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org > For additional commands, e-mail: java-user-help@axis.apache.org >=20 ------_=_NextPart_001_01CB50DF.E55E5797 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi, = Martin,

=  

I just cannot figure out how your advice is related to my problem, = sorry.

=  

Marku= s

=  

****= ********************************************************************** Solo= plan GmbH
= Software f=FCr Logistik und Planung
Markus Schaber = (Dipl.-Informatiker)
Entwicklung, Projektleitung
Burgstra=DFe 20
| 87435 Kempten = | Deutschland
Telefon: +49 831 57407-0
| Telefax: +49 831 57407-111
E-Mail:
msr@soloplan.de | Internet: www.soloplan.de
Gesch=E4ftsf=FChrer: Wolfgang Heidl, HRB 5304 Kempten


Von: = Martin Gainty [mailto:mgainty@hotmail.com]
Gesendet: Freitag, 10. = September 2010 13:32
An: = java-user@axis.apache.org
Betreff: RE: AW: Axis and WS-Security on a standalone client

 

You must define operation = of GetCurrentLocation() with required parameters as well as the return = parameter

<!-- wsdl -->
<definitions
xmlns:tns=3D"http://soapinterop.org/wsdl"= ;
xmlns:xsd=3D"http://www.w3.org/2001/XMLSchem= a"
>
  <types>
    <schema
            = xmlns=3D"http://www.w3.org/2001/XMLSchem= a"
            xmlns:tns=3D"http://soapinterop.org/types/p= art"
            targetNamespace=3D"http://soapinterop.org/types/p= art">
           <element name=3D"vehicleId" type=3D"xsd:int">
            = <element name=3D"Lat" type=3D"xsd:int"/>
            = <element name=3D"Long"        &n= bsp;       type=3D"xsd:int">
    </schema>
</types>
  <message name=3D"input">
         <part name=3D"input" element=3D"vehicleId"/>
    </message>
  <message name=3D"output">
        <part = name=3D"output1" element=3D"tns:Lat"/>
        <part = name=3D"output2" element=3D"tns:Long"/>
    </message>

    <portType = name=3D"getCurrentLocationPortType">
        <!--
            = Throws an empty fault
        -->
        <operation name=3D"getCurrentLocation" >
            = <input message=3D"tns:input"/>
            = <output message=3D"tns:output"/>
        </operation>

Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de d=E9ni et de = confidentialit=E9

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene = Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte = Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient = lediglich dem Austausch von Informationen und entfaltet keine rechtliche = Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine = Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut =EAtre =
privil=E9gi=E9. Si vous n'=EAtes pas le destinataire pr=E9vu, nous te =
demandons avec bont=E9 que pour satisfaire informez l'exp=E9diteur. =
N'importe quelle diffusion non autoris=E9e ou la copie de ceci est =
interdite. Ce message sert =E0 l'information seulement et n'aura pas =
n'importe quel effet l=E9galement obligatoire. =C9tant donn=E9 que les =
email peuvent facilement =EAtre sujets =E0 la manipulation, nous ne =
pouvons accepter aucune responsabilit=E9 pour le contenu =
fourni.





 
> Subject: AW: Axis and WS-Security on a standalone client
> Date: Fri, 10 Sep 2010 08:11:46 +0200
> From: MSR@soloplan.de
> To: java-user@axis.apache.org
>
> Hi,
>
> I also tried to subscribe via the links given on http://ws.apache.org/axis2/mail-lists.html and they point to obsolete = lists, it seems - the resulting mailer daemon message is where I got redirected to = this place.
>
> Markus
>
> = *************************************************************************= *
> Soloplan GmbH
> Software f=FCr Logistik und Planung
> Markus Schaber (Dipl.-Informatiker)
> Entwicklung, Projektleitung
> Burgstra=DFe 20 | 87435 Kempten | Deutschland
> Telefon: +49 831 57407-0 | Telefax: +49 831 57407-111
> E-Mail: msr@soloplan.de | Internet: www.soloplan.de
> Gesch=E4ftsf=FChrer: Wolfgang Heidl, HRB 5304 Kempten
> > -----Urspr=FCngliche Nachricht-----
> > Von: Andreas Veithen [mailto:andreas.veithen@gmail.com]
> > Gesendet: Donnerstag, 9. September 2010 20:49
> > An: java-user@axis.apache.org
> > Betreff: Re: Axis and WS-Security on a standalone client
> >
> > As part of the promotion of the Axis project to a top level = project,
> > we have decided to create separate mailing lists for Axis 1 = and Axis2.
> > For all Axis 1 related questions please subscribe and post = to
> > axis1-java-user@axis.apache.org. Thanks!
> >
> > Andreas
> >
> >
> > On Thu, Sep 9, 2010 at 17:58, Markus Schaber = <MSR@soloplan.de> wrote:
> > > Hello,
> > >
> > > I'm struggling with creating a standalone soap client = that employs
> > > WS-Security against a windows (WCF / .NET 3.5) = server.
> > >
> > > When removing the WS-Security requirement from the = server, everything
> > > works fine. But I just cannot get the java client to send = the
> > > appropriate SOAP headers with username and password.
> > >
> > > Most tutorials / FAQs I googled talk about deployment descriptors in
> > > Tomcat, but I do not have that, I just have some small standalone java
> > > application.
> > >
> > > My current state of the art is:
> > >
> > > package test;
> > >
> > > import java.io.IOException;
> > > import java.net.MalformedURLException;
> > > import java.net.URL;
> > >
> > > import javax.security.auth.callback.Callback;
> > > import javax.security.auth.callback.CallbackHandler;
> > > import javax.security.auth.callback.UnsupportedCallbackException;
> > > import javax.xml.rpc.ServiceException;
> > >
> > > import org.apache.ws.security.WSConstants;
> > > import org.apache.ws.security.WSPasswordCallback;
> > > import = org.apache.ws.security.handler.WSHandlerConstants;
> > > import = org.apache.ws.security.message.token.UsernameToken;
> > >
> > > import de.soloplan.TestServices.GPSPosition;
> > > import de.soloplan.TestServices.TestServiceLocator;
> > > import de.soloplan.TestServices.TestServices;
> > > import = de.soloplan.TestServices.TestServicesBindingStub;
> > >
> > > public class TestClass {
> > >
> > >        /**
> > >         * @param args
> > >         * @throws = ServiceException
> > >         * @throws = MalformedURLException
> > >         */
> > >        public static void = main(String[] args) throws Exception {
> > >
> > > System.getProperties().setProperty("javax.net.ssl.trustStore",<= br> > > > "/home/schabi/.keystore");
> > >
> > > System.getProperties().setProperty("javax.net.ssl.keyStore", > > > "/home/schabi/.keystore");
> > >
> > > System.getProperties().setProperty("javax.net.ssl.keyStorePassword&q= uot;,
> > > "foobar");
> > >
> > > = System.getProperties().setProperty("javax.net.ssl.keyStoreType"= , "JKS");
> > >
> > >               =  URL url =3D new
> > > URL("https://localhost:62615/TestService");
> > >
> > >                TestServiceLocator locator =3D new TestServiceLocator();
> > >
> > >                TestServices service =3D locator.getTestServicesSOAP(url);
> > >
> > >                TestServicesBindingStub stub =3D (TestServicesBindingStub)
> > > service;
> > >
> > >                stub._setProperty(UsernameToken.PASSWORD_TYPE,
> > > WSConstants.PASSWORD_DIGEST);
> > >                stub._setProperty(WSHandlerConstants.USER, "test1");
> > >                stub._setProperty(WSHandlerConstants.PW_CALLBACK_REF,
> > > new PWCallback());
> > >
> > >                GPSPosition position =3D service.getCurrentLocation(-42);
> > >
> > >                System.out.format("Position of vechile %s: Lat: %s,
> > > Long: %s, Height: %s", vehicle, = position.getLatitude(),
> > > position.getLongitude(), position.getHeight());
> > >        }
> > >
> > >        public static class PWCallback implements CallbackHandler {
> > >            /**
> > >             * @see
> > > javax.security.auth.callback.CallbackHandler#handle(javax.security.auth.<= br> > > > callback.Callback[])
> > >             */
> > >            public void handle(Callback[] callbacks) throws IOException,
> > >                 =            UnsupportedCallbackException {
> > >                System.err.println("Called with " + callbacks.length + = "
> > > callbacks.");
> > >               =  for (int i =3D 0; i < callbacks.length; i++) {
> > >                 =    if (callbacks[i] instanceof WSPasswordCallback) {
> > >                 =        WSPasswordCallback pc =3D
> > > (WSPasswordCallback)callbacks[i];
> > >                 =        // set the password given a username
> > >                 =        if ("test1".equals(pc.getIdentifier())) = {
> > >                 =            pc.setPassword("1tset");
> > >                 =            System.err.println("Set password.");
> > >                 =        } else {
> > >                 =               =  System.err.println("No password
> > > found.");
> > >                 =        }
> > >                 =    } else {
> > >                 =        throw new
> > > UnsupportedCallbackException(callbacks[i], = "Unrecognized Callback");
> > >                 =    }
> > >               =  }
> > >            }
> > >        }
> > > }
> > >
> > > The stub and locator was autogenerated by eclipse, but if = you have any
> > > better Idea, please tell me. I'm also not tied to axis, = this was just
> > > what my eclipse autogenerated from the WSDL.
> > >
> > > I tried several different methods I found in google, all = that I deemed
> > > to work without a tomcat running, but non success. The application
> > > started fine with no exceptions, but simply did not send = the WS-Security
> > > headers to the server.
> > >
> > > With .NET, it is some lines in the App.Config and then = barely 20 lines
> > > of code, and it works:
> > >
> > > namespace Soloplan. SoapServer.Tests
> > > {
> > >  using System;
> > >  using System.Diagnostics;
> > >  class TestConsoleApp
> > >  {
> > >    public static void Main()
> > >    {
> > >      var client =3D new
> > > ServiceReference1.TestServicesClient("TestServicesSOAP",
> > > "https://localhost:62615/TestService");
> > >      Debug.Assert(client.ClientCredentials = !=3D null, "No client
> > > credentials");
> > >     =  client.ClientCredentials.UserName.UserName =3D "test1";
> > >     =  client.ClientCredentials.UserName.Password =3D "1tset";
> > >      Console.WriteLine("got client, = sending request");
> > >      var location =3D = client.GetCurrentLocation(-42);
> > >      Console.WriteLine("Got location: {0}/{1}", location.longitude,
> > > location.latitude);
> > >      Console.ReadLine();
> > >    }
> > >  }
> > > }
> > >
> > >
> > > Any ideas?
> > > Markus Schaber
> > >
> > >
> > > = ---------------------------------------------------------------------
= > > > To unsubscribe, e-mail: = java-user-unsubscribe@axis.apache.org
> > > For additional commands, e-mail: = java-user-help@axis.apache.org
> > >
> > >
> >
> > = ---------------------------------------------------------------------
= > > To unsubscribe, e-mail: = java-user-unsubscribe@axis.apache.org
> > For additional commands, e-mail: = java-user-help@axis.apache.org
>
>
> = ---------------------------------------------------------------------
= > To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>

------_=_NextPart_001_01CB50DF.E55E5797--