473,408 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Problem Calling a web service in .NET

Hello,
I have a webservice running on a J2EE server created with Axis 1.2.. I
have a client that I am building in .net that needs to consume this
webserivce and am having a bit of trouble. I have pasted the wsdl
below and have a created a class in VB.net by adding a web refrence to
my project. What is odd is that I can successfully call methods that
return a simple value like a string. I call also call methods that add
an object. However, for methods the return objects, i always get an
empty object. When methods return arrays of objects, I get the correct
number of records in the array, but none of the fields in the objects
are set. It seems to be a binding problem. Any suggestions as to how I
can get around this?
Regards,
Leslie

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
targetNamespace="urn:AuthLogin"
xmlns:tns="urn:AuthLogin"
xmlns:typens="urn:AuthLogin"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!-- type defs -->
<wsdl:types>
<schema elementFormDefault="qualified"
targetNamespace="urn:AuthLogin"
xmlns="http://www.w3.org/2001/XMLSchema">

<element name="getUserId">
<complexType>
<sequence>
<element name="serviceId" type="xsd:string"/>
<element name="login" type="xsd:string"/>
<element name="password" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="getUserIdResponse">
<complexType>
<sequence>
<element name="getUserIdReturn" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="autoResetPassword">
<complexType>
<sequence>
<element name="serviceId" type="xsd:string"/>
<element name="login" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="autoResetPasswordResponse">
<complexType>
<sequence>
<element name="autoResetPasswordReturn" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="getLogin">
<complexType>
<sequence>
<element name="serviceId" type="xsd:string"/>
<element name="login" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="getLoginResponse">
<complexType>
<sequence>
<element name="getLoginReturn" type="tns:WSLoginValue"/>
</sequence>
</complexType>
</element>
<complexType name="WSLoginValue">
<sequence>
<element name="authFailureCount" type="xsd:int" minOccurs="0"
nillable="false"/>
<element name="changePassword" nillable="false"
type="xsd:dateTime" minOccurs="0"/>
<element name="createDate" nillable="false" type="xsd:dateTime"
minOccurs="0"/>
<element name="createdBy" nillable="false" type="xsd:string"
minOccurs="0"/>
<element name="currentLoginHost" nillable="false"
type="xsd:string" minOccurs="0"/>
<element name="gracePeriodExp" nillable="false"
type="xsd:dateTime" minOccurs="0"/>
<element name="guest" type="xsd:boolean" nillable="false"
minOccurs="0"/>
<element name="lastAuthAttempt" nillable="false"
type="xsd:dateTime" minOccurs="0"/>
<element name="locked" type="xsd:boolean" minOccurs="0"
nillable="false"/>
<element name="login" nillable="false" type="xsd:string"
minOccurs="0"/>
<element name="newUser" type="xsd:boolean" minOccurs="0"
nillable="false"/>
<element name="password" nillable="false" type="xsd:string"
minOccurs="0"/>
<element name="passwordEquivalentToken" nillable="false"
type="xsd:string" minOccurs="0"/>
<element name="passwordExp" nillable="false" type="xsd:dateTime"
minOccurs="0"/>
<element name="resetPassword" type="xsd:boolean" minOccurs="0"
nillable="false"/>
<element name="service" nillable="false" type="xsd:string"
minOccurs="0"/>
<element name="status" nillable="false" type="xsd:string"
minOccurs="0"/>
<element name="token" nillable="false" type="xsd:string"
minOccurs="0"/>
<element name="userId" nillable="false" type="xsd:string"
minOccurs="0"/>
</sequence>
</complexType>
<element name="authenticate">
<complexType>
<sequence>
<element name="serviceId" type="xsd:string" />
<element name="login" type="xsd:string" />
<element name="password" type="xsd:string" />
</sequence>
</complexType>
</element>
<element name="authenticateResponse">
<complexType>
<sequence>
<element name="authenticateResponse" type="tns:SSOSubject" />
</sequence>
</complexType>
</element>
<complexType name="SSOSubject">
<sequence>
<element name="expirationTime" type="xsd:long" nillable="false"
minOccurs="0"/>
<element name="readOnly" type="xsd:boolean" nillable="false"
minOccurs="0"/>
<element name="resultCode" type="xsd:int" nillable="false"
minOccurs="0"/>
<element name="token" nillable="false" type="xsd:string"
minOccurs="0"/>
<element name="userId" nillable="false" type="xsd:string"
minOccurs="0"/>
</sequence>
</complexType>
<element name="authenticateToken">
<complexType>
<sequence>
<element name="userId" type="xsd:string" />
<element name="token" type="xsd:string" />
</sequence>
</complexType>
</element>
<element name="authenticateTokenResponse">
<complexType>
<sequence>
<element name="authenticateTokenReturn" type="tns:SSOSubject" />
</sequence>
</complexType>
</element>
<element name="removeLogin">
<complexType>
<sequence>
<element name="serviceId" type="xsd:string"/>
<element name="loginId" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="removeLoginResponse">
<complexType/>
</element>
<element name="getAllLogins">
<complexType>
<sequence>
<element name="userId" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="getAllLoginsResponse">
<complexType>
<sequence>
<element maxOccurs="unbounded" name="getAllLoginsReturn"
type="typens:WSLoginValue"/>
</sequence>
</complexType>
</element>

<element name="logout">
<complexType>
<sequence>
<element name="userId" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="logoutResponse">
<complexType/>
</element>
<element name="addLogin">
<complexType>
<sequence>
<element name="loginValue" type="typens:WSLoginValue"/>
</sequence>
</complexType>
</element>
<element name="addLoginResponse">
<complexType/>
</element>
<element name="updateLogin">
<complexType>
<sequence>
<element name="lv" type="typens:WSLoginValue"/>
</sequence>
</complexType>
</element>
<element name="updateLoginResponse">
<complexType/>
</element>
<element name="encrypt">
<complexType>
<sequence>
<element name="clearText" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="encryptResponse">
<complexType>
<sequence>
<element name="encryptReturn" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="decrypt">
<complexType>
<sequence>
<element name="token" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="decryptResponse">
<complexType>
<sequence>
<element name="decryptReturn" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>

<!-- message -->
<wsdl:message name="authenticateMsg">
<wsdl:part element="typens:authenticate" name="parameters"/>
</wsdl:message>
<wsdl:message name="authenticateResponseMsg">
<wsdl:part element="typens:authenticateResponse"
name="parameters"/>
</wsdl:message>
<wsdl:message name="authenticateTokenMsg">
<wsdl:part element="typens:authenticateToken" name="parameters"/>
</wsdl:message>
<wsdl:message name="authenticateTokenResponseMsg">
<wsdl:part element="typens:authenticateTokenResponse"
name="parameters"/>
</wsdl:message>

<wsdl:message name="getLoginMsg">
<wsdl:part element="typens:getLogin" name="parameters"/>
</wsdl:message>
<wsdl:message name="getLoginResponseMsg">
<wsdl:part element="typens:getLoginResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="logoutMsg">
<wsdl:part element="typens:logout" name="parameters"/>
</wsdl:message>
<wsdl:message name="logoutResponseMsg">
<wsdl:part element="typens:logoutResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="autoResetPasswordMsg">
<wsdl:part element="typens:autoResetPassword" name="parameters"/>
</wsdl:message>
<wsdl:message name="autoResetPasswordResponseMsg">
<wsdl:part element="typens:autoResetPasswordResponse"
name="parameters"/>
</wsdl:message>
<wsdl:message name="getUserIdMsg">
<wsdl:part element="typens:getUserId" name="parameters"/>
</wsdl:message>

<wsdl:message name="getUserIdResponseMsg">
<wsdl:part element="typens:getUserIdResponse" name="parameters"/>
</wsdl:message>

<wsdl:message name="removeLoginMsg">
<wsdl:part element="typens:removeLogin" name="parameters"/>
</wsdl:message>
<wsdl:message name="removeLoginResponseMsg">
<wsdl:part element="tns:removeLoginResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="updateLoginMsg">
<wsdl:part element="typens:updateLogin" name="parameters"/>
</wsdl:message>
<wsdl:message name="updateLoginResponseMsg">
<wsdl:part element="typens:updateLoginResponse"
name="parameters"/>
</wsdl:message>
<wsdl:message name="addLoginMsg">
<wsdl:part element="typens:addLogin" name="parameters"/>
</wsdl:message>
<wsdl:message name="addLoginResponseMsg">
<wsdl:part element="typens:addLoginResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="getAllLoginsMsg">
<wsdl:part element="typens:getAllLogins" name="parameters"/>
</wsdl:message>
<wsdl:message name="getAllLoginsResponseMsg">
<wsdl:part element="typens:getAllLoginsResponse"
name="parameters"/>
</wsdl:message>
<wsdl:message name="encryptMsg">
<wsdl:part element="typens:encrypt" name="parameters"/>
</wsdl:message>
<wsdl:message name="encryptResponseMsg">
<wsdl:part element="typens:encryptResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="decryptMsg">
<wsdl:part element="typens:decrypt" name="parameters"/>
</wsdl:message>
<wsdl:message name="decryptResponseMsg">
<wsdl:part element="typens:decryptResponse" name="parameters"/>
</wsdl:message>

<!-- port type -->
<wsdl:portType name="AuthLogin">
<wsdl:operation name="authenticate">
<wsdl:input message="tns:authenticateMsg"
name="authenticateRequest"/>
<wsdl:output message="tns:authenticateResponseMsg"
name="authenticateResponse"/>
</wsdl:operation>
<wsdl:operation name="authenticateToken">
<wsdl:input message="tns:authenticateTokenMsg"
name="authenticateTokenRequest"/>
<wsdl:output message="tns:authenticateTokenResponseMsg"
name="authenticateTokenResponse"/>
</wsdl:operation>
<wsdl:operation name="getUserId">
<wsdl:input message="tns:getUserIdMsg"
name="getUserIdRequest"/>
<wsdl:output message="tns:getUserIdResponseMsg"
name="getUserIdResponse"/>
</wsdl:operation>
<wsdl:operation name="autoResetPassword">
<wsdl:input message="tns:autoResetPasswordMsg"
name="autoResetPasswordRequest"/>
<wsdl:output message="tns:autoResetPasswordResponseMsg"
name="autoResetPasswordResponse"/>
</wsdl:operation>
<wsdl:operation name="getLogin">
<wsdl:input message="tns:getLoginMsg" name="getLoginRequest"/>
<wsdl:output message="tns:getLoginResponseMsg"
name="getLoginResponse"/>
</wsdl:operation>
<wsdl:operation name="removeLogin">
<wsdl:input message="tns:removeLoginMsg"
name="removeLoginRequest"/>
<wsdl:output message="tns:removeLoginResponseMsg"
name="removeLoginResponse"/>
</wsdl:operation>
<wsdl:operation name="getAllLogins">
<wsdl:input message="tns:getAllLoginsMsg"
name="getAllLoginsRequest"/>
<wsdl:output message="tns:getAllLoginsResponseMsg"
name="getAllLoginsResponse"/>
</wsdl:operation>

<wsdl:operation name="logout">
<wsdl:input message="tns:logoutMsg" name="logoutRequest"/>
<wsdl:output message="tns:logoutResponseMsg"
name="logoutResponse"/>
</wsdl:operation>
<wsdl:operation name="addLogin">
<wsdl:input message="tns:addLoginMsg" name="addLoginRequest"/>
<wsdl:output message="tns:addLoginResponseMsg"
name="addLoginResponse"/>
</wsdl:operation>
<wsdl:operation name="updateLogin">
<wsdl:input message="tns:updateLoginMsg"
name="updateLoginRequest"/>
<wsdl:output message="tns:updateLoginResponseMsg"
name="updateLoginResponse"/>
</wsdl:operation>
<wsdl:operation name="encrypt">
<wsdl:input message="tns:encryptMsg" name="encryptRequest"/>
<wsdl:output message="tns:encryptResponseMsg"
name="encryptResponse"/>
</wsdl:operation>
<wsdl:operation name="decrypt">
<wsdl:input message="tns:decryptMsg" name="decryptRequest"/>
<wsdl:output message="tns:decryptResponseMsg"
name="decryptResponse"/>
</wsdl:operation>
</wsdl:portType>

<!-- binding -->
<wsdl:binding name="AuthLoginSoapBinding" type="tns:AuthLogin">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>

<wsdl:operation name="authenticate">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="authenticateRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="authenticateResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="authenticateToken">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="authenticateTokenRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="authenticateTokenResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>

<wsdl:operation name="getUserId">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getUserIdRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getUserIdResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="autoResetPassword">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="autoResetPasswordRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="autoResetPasswordResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getLogin">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getLoginRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getLoginResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="removeLogin">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="removeLoginRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="removeLoginResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getAllLogins">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getAllLoginsRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getAllLoginsResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>

<wsdl:operation name="logout">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="logoutRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="logoutResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="addLogin">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="addLoginRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="addLoginResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="updateLogin">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="updateLoginRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="updateLoginResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="encrypt">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="encryptRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="encryptResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="decrypt">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="decryptRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="decryptResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AuthLoginService">
<wsdl:port binding="tns:AuthLoginSoapBinding" name="AuthLogin">
<wsdlsoap:address
location="http://localhost:9082/axis/services/AuthLogin"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

Nov 23 '05 #1
4 1955
Hi Leslie

There are some stuff that I discovered in the past, that was nice to
know about .NET Java interop regarding webservices.

- Use the "wrapped" convention when generating your WSDL from Axis. It
is default for .NET.
- Conform to the Basic Profile, I think there's a switch for that on the
commandline
- Never expose Java specific types, always convert subclasses of
Collection to plain arrays before making them arguments or return types
for web service methods.

Maybe you know all this, if so, forget.

Abviously the .NET proxy does not know how to deserialize the xml
representing the object your are sending over the wire.

Regards

Henrik
http://websolver.blogspot.com
Nov 23 '05 #2
Hi henrik,

Thanks for your reply. Would you have an example that I could use as
reference to trouble shoot my problem?

Thanks
leslie

Nov 23 '05 #3
le**********@yahoo.com wrote:
Hi henrik,

Thanks for your reply. Would you have an example that I could use as
reference to trouble shoot my problem?


An example of what?

The topics I wrote about was merely common WS interop guidelines between
J2EE and .NET.
Do you have access to the Axis web service? Are you in control of this
(ie. developing it)?
If so, try to set up the wrapped convention. From what I gather from
your previously posted it seems like the WSDL is generated with the
document style convention.
The wrapped convention will "wrap" your parameters (input) into a single
element, instead of passing each parameter one at a time.

You could also check the Axis doc on apache.org searching for the
"wrapped" word.

Also, I remembering seeing a quite like topic on the Axis mailing list.
it was referred to as "the target namespace problem". .NET (and other WS
implementations) use the namespace to identify the exact type being sent
over the wire, thus how to serialize/deserialize it.

HTH

Henrik
Nov 23 '05 #4
Hi Leslie,

You can use J-Integra Espresso to access any J2EE web service from any
..NET client such as VB.NET client. Some of J-Integra Espresso features
include:

* Pure .NET implementation in C#, 100% managed code
* Several times faster than Web Services
* Bi-directional: ".NET to Java", "Java to .NET", ".NET to CORBA" and
"CORBA to .NET"
* Enables interoperability with any J2EE or CORBA infrastructure that
is IIOP-compliant such as VisiBroker, Orbix, JacORB, JBoss, WebLogic,
and WebSphere
* Support for IIOP transport protocols including SSL and TLS over IIOP
(SSLIOP)
* Marshalling objects by reference or by value
* One-sided deployment (no touch on J2EE AppServer)

For a free evaluation, visit http://j-integra.intrinsyc.com/
Regards,

Raymond HE
Intrinsyc Software International, Inc.
J-Integra Interoperability Solutions
http://j-integra.intrinsyc.com/
When Web Services are not enough

Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Programatix | last post by:
Hi, I'm working on a project which includes WebServices and Windows Form application. The Windows Form application will call the WebServices to retrieve data from database. The data will be...
1
by: bob | last post by:
I have created a simple Windows service in VB.Net which installs fine using InstallUtil.exe to install it to, for example "c:\test", or "c:\Windows\YellowBanana", but if I install it to "c:\Program...
0
by: stefan | last post by:
hello everybody, I want to call a method on a SAP WAS. For testing purposes, I do have the same method on two WASs. One of them has been updated recently. The wsdl-files of both are not...
7
by: Frank Maxey | last post by:
I am fairly new to VB.Net and am having a curious problem. I have an entry dialog form called from a main form. The calling form needs to check the DialogResult field for an OK response. In...
4
by: JLJ | last post by:
I have a very simple webservice written in Java/Axis. It takes in a complexType with 2 string elements, userid and password. The response is a complexType containing two complexTypes each having...
3
by: Merav Orion via .NET 247 | last post by:
I have a problem calling webservice from client side javascript. The javascript call the settimeout() method. when the user press submit button it ignore the press and keep refreshing the page. it...
0
by: Bob Davies | last post by:
Hi I have a webservice that retrieves data from a database, this is then returned to the calling client application built in windows forms within a dataset, however upon attempting to create...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
3
by: Mike | last post by:
I have created a web service for a client to consume. The element I am having trouble with is, as described in their WSDL: <xsd:element minOccurs="0" ref="LocalData" maxOccurs="1" /> ...
3
by: bilosta | last post by:
Hello to everybody I'm new in win apllications and C#. I have a problem with Threading. Here is my problem: I have a form with button named: BupisiStudente, when I click on it a call next...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.