Leslie,
 
As an aside, provided you have an InterOp friendly WSDL and Schema, on the .NET side you have an additional option for generating the client proxy than the built-in wsdl.exe.
 
That is to use the free WSCF Visual Studio.NET addin @
http://www.thinktecture.com/Resources/Software/WSContractFirst/default.html
 
A walk-through on the tool can be found @
http://www.thinktecture.com/Resources/Software/WSContractFirst/WSCF0.5Walkthrough.html
 
Regards,
 
- Anil
 
 

From: Leslie Tighe [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 20, 2005 5:40 PM
To: [email protected]
Subject: Re: Axis 1.2.1 to .NET Interoperability Question

Thanks Anne.
 
I have cleaned up the wsdl file, but I am still having a problem getting the data to show up in my VB.NET client. I have attached the WSDL file.  I have also listed below the steps that I have taken for this.  We did change our return types from collections to arrays wherever they were called. We made dateTime not nulls. 

1)       Created a WSDL file  thru axis with ?wsdl 

2)       This wsdl file contained errors so we manually cleaned it up  with the excellent help recd here.

3)      Calling service methods through a a browser and java test client displays expected results 

4)       On the ..NET side, I used the wsdl.exe utility to generate a VB class from the wsdl file that was created in step.

5)       We run the VB class in a app. If a method returns a string, then data comes through. If it returns an object, I get an object with none of the attributes being set.

 Is this approach correct?   Also, what role does the server-config.wsdd file play in how services operate?

 Any assistance on this is greatly appreciated.

Regards

Leslie



Anne Thomas Manes <[EMAIL PROTECTED]> wrote:
One problem that I see is that your response messages all include two
elements of different type with the same QName. Number 1 -- that's a
really bad practice, and Number 2, I suspect .NET can't handle it.

For example, you have:









I suggest you change it to:









You should do that for all of your response messages.

Anne

On 7/19/05, Leslie Tighe <[EMAIL PROTECTED]>wrote:
>
> Thanks Anne.
>
> I made the change to use arrrays, but I am still having the same problem
> where on the .NET side, the object fields are not being set.
>
> On the java side, I am able to call the service deployed in axis through a
> browser, and do get back the expected results. The wsdl file generated was
> cluttered, so I cleaned it up, as suggested earlier, and verified that the
> services still worked. I also noted that wsdl2java tool created the
> interface correctly.
>
> Attached are my classes. The SOAP response are pasted below. Any help would
> be gratefully appreciated.
>
>
> The SOAP Response Envelope looks like this (testing on the java side):
>
>
> - > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>
>
> -
> >
> -
>
>
> - > xsi:type="ns1:WSLoginValue">
>
>
> 0
>
>
>
>
>
>
>
>
>
>
>
> false
>
>
>
> false
>
> sysadmin
>
> false
>
> passwd00
>
>
>
>
>
> false
>
> ABC
>
>
>
>
>
> 3000
>

>
> - > xsi:type="ns2:WSLoginValue">
>
>
> 0
>
>
>
>
>
>
>
>
>
>
>
> false
>
>
>
> false
>
> sysadmin
>
> false
>
> passwd00
>
>
>
>
>
> false
>
> IDM
>
>
>
>
>
> 3000
>

>

>

>

>
> The SOAP Request was:
>
>
>
>
> - > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:q0="urn:AuthLogin"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>
>
> -
>
>
> -
>
>
> 3000
>

>

>

>
>
> Regards,
>
> Leslie
>
>
> Anne Thomas Manes <[EMAIL PROTECTED]>wrote:
> Leslie,
>
> One recommendation: Don't try to expose a Vector (or any other
> collection type) through your interface. Convert your Vector into an
> array, and it will work a lot better. .NET will have a problem dealing
> with all t he ArrayOf_xsd_anyType types you have.
>
> Axis automatically generates a bunch of namespaces to define the
> bizarre types it needs to map collections to xsd types. If you don't
> use collections, you won't get all these additional namespaces.
>
> Anne
>
> On 7/18/05, Leslie Tighe wrote:
> >
> > Thanks, but I do have a few questions on name spaces in the wsdl files
> >
> >
> > Attached in my AuthLogin.wsdd file. It has namespaces defined as:
> >
> >
> >
> > >
> >
> xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
> >
> > >
> > xmlns:ns="urn:AuthLogin"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> >
> > I am running axis.war in WebSphere 6.
> > I used the above AuthLogin.wsdd with the AdminClient from a DOS window to
> > ; modifiy the server-config file in axis. Then from the axis.war
> application,
> > I created the wsdl file with:
> >
> > http://localhost:9082/axis/services/AuthLogin?wsdl
> >
> > The generated wsdl file, has namespaces which someone from the dot net
> group
> > pointed out is strange. But what I am unable to figure out is why some of
> > these namespaces such as:
> > http://xml.apache.org/xml-soap is in my wsdl file because they are not in
> my
> > wsdd file namespace.ac
> >
> > I also see that in the wsdl, some namespaces are backwards e.g.
> >
> >
> > xmlns:tns2=http://security.ws.diamelle
> >
> > instead of diamelle.ws.security
> >
> > I then tried to use the java2wsdl tool to create the wsdl file, but am
> > confused on how the bean mapping and type mapping which we speci fied in
> the
> > wsdd file above is to be specified using this approach?
> >
> > dateTime is nillable in the wsdl file. Is there a way to make them come
> out
> > as not nillable in the wsdl file, or we could just edit the wsdl file?
> >
> > Any help will be much appreciated
> >
> >
> > Simon Fell wrote:
> >
> >
> > almost certainly the problem is that the namespace of the elements in the
> > response message don't match the namespace identified by the WSDL.
> >
> > Cheers
> > Simon
> >
> > ________________________________
> > From: Leslie Tighe [mailto:[EMAIL PROTECTED]
> > Sent: Monday, July 18, 2005 10:50 AM
> > To: [email protected]; Anne Thomas Manes
> > Subject: Re: Axis 1.2.1 to .NET Interoperability Question
> >
> >
> >
> > Hi Anne,
> >
> > On the .NET side, when I try to consume a complex object, all the
> attributes
> > in that object are empty. For example, if try to call the getLogin()
> method
> > which returns WSLogin, I get an object with nothing in it. However, if I
> > call the methods from the browser, its pulling the correct data so I am
> > thinking that there is problem in they way that I have things set for
> .NET.
> >
> > Any suggestions on what the problem maybe?
> >
> > Thanks
> > Leslie
> >
> >
> > Anne Thomas Manes wrote:
> > What problems are you experiencing?
> >
> > On 7/18/05, Leslie Tighe wrote:
> > >
> > > Hello,
> > >
> > >
> > > I have webservice created with Axis 1.2.1 and that I am trying to
> > consuming
> > > in .NET (VB) using the Microsoft provided tools. While I am able to
> > consume
> > > methods on the service that return simple type, I cannot consume methods
> > > that return complex objects. I have tried experimenting, with this, but
> am
> > > at a bit of loss on where the problem lies. When I call the services
> from
> > a
> > > browser, I do get back the response that contains valid data. Any help
> on
> > > this would be greatly appreciated. I have attached supporting files. For
> > > the purpose of an example, I am using the getLogin method.
> > >
> > > Thanks in advance.
> > > Leslie
> > >
> > > ________________________________
> > > Start your day with Yahoo! - make it your home page
> > >
> > >
> > >
> >
> >
> > ________________________________
> > Start your day with Yahoo! - make it your home page
> >
> >
> >
> > ________________________________
> > Start your day with Yahoo! - make it your home page
> >
> >
> >
> > >
> xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
> > > use="literal"
> > xmlns:ns="urn:AuthLogin"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> > > value="diamelle.ws.security.AuthLogin"/>
> >
> > > type="java:diamelle.security.auth.SSOSubject"/>
> > > type="java:diamelle.ws.security.WSLoginValue"/>
> > > type="java:diamelle.security.auth.LoginValue"/>
> > > type="java:diamelle.security.auth.SSOPrincipal"/>
> > > type="java:diamelle.security.auth.RoleValue"/>
> > > type="java:diamelle.security.auth.EntitlementValue"/>
> > > type="java:diamelle.ebc.navigator.MenuData"/>
> > > type="java:diamelle.ebc.navigator.MenuData[]"
> >
> serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
> >
> deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"/>
> > > type="java:diamelle.security.auth.SSOPrincipal[]"
> >
> serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
> >
> deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"/>
> > > type="java:java.lang.String[]"
> >
> serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
> >
> deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"/>
> > > type="java:diamelle.security.auth.RoleValue[]"
> >
> serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
> >
> deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"/>
> > > qname="ns:ArrayOfEntitlementValue"
> > type="java:diamelle.security.auth.EntitlementValue[]"
> >
> serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
> >
> deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"/>
> > > returnType="ns:SSOSubject"
> > returnQName="ns:authenticateResponse">
> >
> >
> >
> >
> > > returnType="xsd:string"
> returnQName="ns:getUserIdResponse">
> >
> >
> >
> >
> > > qname="ns:autoResetPassword" returnType="xsd:string"
> > returnQName="ns:autoResetPasswordResponse">
> >
> >
> >
> > > qname="ns:getLogin"
> > returnType="ns:WSLoginValue"
> > returnQName="ns:getLoginResponse">
> >
> >
> >
> > > returnQName="ns:removeLoginResponse">
> >
> >
> >
> > > returnType="ns:ArrayOfSSOPrincipal"
> > returnQName="ns:getAllLoginsResponse">
> > > xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
> >
> > > returnType="ns:ArrayOfSSOPrincipal"
> > returnQName="ns:getPrincipalsReturn">
> > > xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
> >
> >
> >
> >
> >
> >
> >
>
>
> ________________________________
> Start your day with Yahoo! - make it your home page
>
>
> package diamelle.ws.security;
>
> import diamelle.app.base.*;
> import diamelle.ebc.user.UserData;
> import diamelle.security.auth.*;
> import diamelle.security.crypt.PBECryptor;
> import diamelle.ws.util.TimeUtil;
>
> import java.rmi.RemoteException;
> import java.util.*;
>
> public class AuthLogin extends NavigationAccess{
>
> Authenticator auth = null;
> static private final String ENCRYPTION_KEY = "diamelle";
>
> public AuthLogin() {
> super();
> try {
> AuthenticatorHome aHome =
> (AuthenticatorHome)getHome("Authenticator");
> auth = aHome.create();
> } catch(Exception e) {
> e.printStackTrace();
> }
> }
>
> /**
> * Get the SSOSubject Object from authenticate() method
> * @param service, login, password,
> * @returns SSOSubject Object
> */
> public SSOSubject authenticate(String serviceId, String login,
> String password)
> throws RemoteException {
> //throws InvalidLoginIdException, InvalidPasswordException,
> Exception {
> LoginValue lv = new LoginValue();
> lv.setService(serviceId);
> lv.setLogin(login);
> lv.setPassword(password);
>
> try {
> SSOSubject sub = auth.authenticate(lv);
> return sub;
> } catch (Exception e) {
> throw new RemoteException();
> }
> }
>
> /**
> * Get the SSOSubject Object from authenticate() method
> * @param lv - LoginValue
> * @returns SSOSubject Object
> */
> /*
> public SSOSubject authenticate(WSLoginValue loginValue)
> throws InvalidLoginIdException, InvalidPasswordException,
> Exception {
> return auth.authenticate(getLoginValue(loginValue));
> }
> */
> /**
> * Get the SSOSubject Object from authenticate() method
> * @param String userId
> * @param String token
> * @returns SSOSubject
> */
> public SSOSubject authenticateToken(String userId, String token)
> throws java.rmi.RemoteException {
>
> // using clear text as token as encrypted tokens do not
> always match
> // decrypt(token) Sometimes BadPaddingException occurs
> // return auth.authenticate(userId, decrypt(token));
> return auth.authenticate(userId, token);
> }
>
> /**
> * Logs out the user
> */
> public void logout(String userId) throws java.rmi.RemoteException {
> auth.logout(userId);
> }
>
>
> // takes the login and service and authenticates the userid and returns
> the userId
> public String getUserId(String serviceId, String login, String password)
> throws RemoteException {
> //throws InvalidLoginIdException, InvalidPasswordException,
> Exception {
> LoginValue lv = new LoginValue();
> lv.setService(serviceId);
> lv.setLogin(login);
> lv.setPassword(password);
>
> try {
> SSOSubject sub = auth.authenticate(lv);
> if (sub != null)
> return sub.getUserId();
> return null;
> } catch (Exception e) {
> throw new RemoteException();
> }
> }
>
> //public Set getPrincipals(String userId) throws RemoteException {
> // public String[] getPrincipals(String userId) throws RemoteException {
> // return auth.getPrincipals(userId);
> // }
>
> public void addLogin(WSLoginValue loginValue) throws RemoteException {
> try {
> auth.addLogin(getLoginValue(loginValue));
> } catch (Exception e) {
> throw new RemoteException();
> }
> }
>
> public void removeLogin(String serviceId, String login) throws
> RemoteException {
> auth.removeLogin(serviceId, login);
> }
>
> public WSLoginValue getLogin(String serviceId, String login) throws
> RemoteE xception {
> LoginValue lv = (auth.getLogin(serviceId, login));
> return getWSLoginValue(lv);
> }
>
> public void updateLogin(WSLoginValue lv) throws RemoteException {
> auth.updateLogin(getLoginValue(lv));
> }
> public String autoResetPassword(String serviceId, String login) throws
> RemoteException {
> return auth.autoResetPassword(serviceId, login);
> }
> //public List getAllLogins(String userId) throws RemoteException {
>
> public WSLoginValue[] getAllLogins(String userId) throws RemoteException {
> List loginList = auth.getAllLogins(userId);
> if (loginList == null)
> return null;
> int size = loginList.size();
> WSLoginValue[] loginAry = new WSLoginValue[size];
> for (int i=0; i < size; i++) {
> LoginValue loginValue = (LoginValue)loginList.get(i);
> loginAry[i] = this.getWSLoginValue(loginValue);
> }
> return loginAry;
> }> public String encrypt(String clearText) throws RemoteException {
>
> String token = null;
> PBECryptor cryptor = new PBECryptor(ENCRYPTION_KEY);
> token = cryptor.encode(clearText);
>
> return token;
> }
>
> public String decrypt(String token) throws RemoteException {
>
> String clearText = null;
> PBECryptor cryptor = new PBECryptor(ENCRYPTION_KEY);
> clearText = cryptor.decode(token);
> System.out.println("clearText: " + clearText);
>
> return clearText;
> }
>
> public LoginValue getLoginValue(WSLoginValue ws) throws
> RemoteException {
> if (ws == null)
> return null;
>
> TimeUtil util = new TimeUtil();
> LoginValue lv = new LoginValue();
> lv.setAuthFailureCount(ws.getAuthFailureCount());
>
> lv.setChangePassword(util.getTimestamp(ws.getChangePassword()));
> lv.setCreateDate(ws.getCreateDate());
> lv.setCreatedBy(ws.getCreatedBy());
> lv.setCurrentLoginHost(ws.getCurrentLoginHost());
> lv.setGracePeriodExp(ws.getGracePeriodExp());
>
> lv.setLastAuthAttempt(util.getTimestamp(ws.getLastAuthAttempt()));
> lv.setLocked(ws.isLocked());
> lv.setLogin(ws.getLogin());
> lv.setNewUser(ws.isNewUser());
> lv.setPassword(ws.getPassword());
>
> lv.setPasswordEquivalentToken(ws.getPasswordEquivalentToken());
> lv.setPasswordExp(util.getTimestamp(ws.getPasswordExp()));
> lv.setResetPassword(ws.isResetPassword());
> lv.setService(ws.getService());
> lv.setStatus(ws.getStatus());
> lv.setToken(ws.getToken());
> lv.setUserId(ws.getUserId());
>
> return lv;
> }
>
> public WSLoginValue getWSLoginValue(LoginValue loginValue) throws
> RemoteException {
> if (loginValue == null)
> return null;
> ;
> TimeUtil util = new TimeUtil();
> WSLoginValue wsLoginValue = new WSLoginValue();
>
> wsLoginValue.setAuthFailureCount(loginValue.getAuthFailureCount());
>
> wsLoginValue.setChangePassword(util.getCalendar(loginValue.getChangePassword()));
> wsLoginValue.setCreateDate(loginValue.getCreateDate());
> wsLoginValue.setCreatedBy(loginValue.getCreatedBy());
>
> wsLoginValue.setCurrentLoginHost(loginValue.getCurrentLoginHost());
>
> wsLoginValue.setGracePeriodExp(loginValue.getGracePeriodExp());
>
> wsLoginValue.setLastAuthAttempt(util.getCalendar(loginValue.getLastAuthAttempt()));
> wsLoginValue.setLocked(loginValue.isLocked());
> wsLoginValue.setLogin(loginValue.getLogin());
> wsLoginValue.setNewUser(loginValue.isNewUser());
> wsLoginValue.setPassword(loginValue.getPassword());
>
> wsLoginValue.setPasswordEquivalentToken(loginValue.getPasswordEquivalentToken());
>
> wsLoginValue.setPasswordExp(util.getCalendar(loginValue.getPasswordExp()));
> wsLoginValue.setResetPassword(loginValue.isResetPassword());
> wsLoginValue.setService(loginValue.getService());
> wsLoginValue.setStatus(loginValue.getStatus());
> wsLoginValue.setToken(loginValue.getToken());
> wsLoginValue.setUserId(loginValue.getUserId());
> return wsLoginValue;
> }
>
>
> }
>
> package diamelle.ws.security;
>
> import java.util.Calendar;
> import java.io.*;
> import diamelle.ws.util.*;
> import diamelle.security.auth.LoginValue;
>
> /**
> *


> * LoginValue is the Bulk Accessor class to
> * get and set values for PasswordLogin.


=== message truncated ===


Start your day with Yahoo! - make it your home page

Reply via email to