473,395 Members | 1,815 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,395 software developers and data experts.

Web service from java WSDL

I created a Web Service from a WSDL that come from Java (apache soap).
It contains the definition of Vector as complex type:

<schema targetNamespace="http://xml.apache.org/xml-soap"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="Vector">
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="item"
type="xsd:anyType"/>
</sequence>
</complexType>
</schema>

..Net generate the following (wrong) class:

<System.Xml.Serialization.SoapTypeAttribute("Vecto r",
"http://xml.apache.org/xml-soap")> _
Public Class Vector
Public item() As Object
End Class

I changed it in:

<System.Xml.Serialization.SoapTypeAttribute("Vecto r",
"http://xml.apache.org/xml-soap")> _
Public Class Vector
Inherits ArrayList
End Class

There is a method XX with a parameter in0 of type Vector.
The problem is: The Soap request is:

<in0 xmlns:ns2="http://xml.apache.org/xml-soap" xsi:type="ns2:Vector">
....
</in0>
My Web Service wants:

<soapenc:Array id="id2" soapenc:arrayType="type[2]">
....
</soapenc:Array>

I can't change the request message!!
Anyone knows a solution??

Thanks in advance,

Emanuele
Nov 21 '05 #1
1 5351
> I can't change the request message!!
Anyone knows a solution??

yes!
Don't use Apache SOAP. It isn't WS-I compliant and it has poor
interoperability.
Also, don't send platform specific datatypes (such as Java Vector) across a
webservice interface.

(more below)

"Emanuele Parati" <ep*****@libero.it> wrote in message
news:3f**************************@posting.google.c om...I created a Web Service from a WSDL that come from Java (apache soap).
It contains the definition of Vector as complex type:

<schema targetNamespace="http://xml.apache.org/xml-soap"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="Vector">
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="item"
type="xsd:anyType"/>
</sequence>
</complexType>
</schema>

.Net generate the following (wrong) class:

<System.Xml.Serialization.SoapTypeAttribute("Vecto r",
"http://xml.apache.org/xml-soap")> _
Public Class Vector
Public item() As Object
End Class


This seems to be correct from my point of view! the schema specifically
says xsd:anyType, which .NET (correctly) translates to an array of Object.
This is the danger in including types such as Java Vector in an interface -
it is not easily translatable into and out of XML Schema without some loss
of information. Instead, start with XSD Schema, and generate the interface
from it. Generate the server skeleton from the WSDL and XSD.

-Dino

Nov 21 '05 #2

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

Similar topics

0
by: umhlali | last post by:
I get the following exception when my VB.NET app calls a Java web service that returns an array of objects. The same call works for a single object though. So looks like there is no problem...
3
by: JL | last post by:
I have a VB.NET desktop program that reads/writes data to a server using a Java-based Web Service. This web service, in identical formats, is located on several servers with each server being a...
3
by: Jerome Cohen | last post by:
AI am trying to call a third-party web service. this service expects an XML fragment that contains the request plus other parameter. adding the web reference created the syntax below(reference.vb)....
7
by: Jorgen Haukland, Norway | last post by:
Hi, I have created a Java webservice which runs in IBM WebSphere appserver. I take the WSDL-file and create a VS.NET WinForm application and calls the service running on my PC and everything...
7
by: David Laub | last post by:
I've also posted this issue to a Sun/java formum, but since it appears to be an integration issue, this may be the better place to posr: I have written a dot net/c# Web Services doesn't fully...
0
by: leslie_tighe | last post by:
Hello, I have a set of web services running on Java server that are exposed through axis 1.2.1. I can invoke these services in browser and through a java test client. However, when I try to...
1
by: William | last post by:
I have a few questions. First, I have a java webservice, which was developed using the Java Webserices Developer Pack 1.3. Here is the wsdl for the service. (Note: That this service is not exposed...
5
by: Nate | last post by:
We are attempting to make a request to a web service (we will refer to it as XXXServices) hosted on a Web Logic server from a C# SOAP client. The server responds with a 401 Unauthorized error...
2
by: BluNuit | last post by:
I have a simple c# app that calls a Java (AXIS) web service to perform some operations. The call works fine (the java code fires and the operations are executed), but the response is always null. ...
4
by: Kevin Burton | last post by:
I found an article on calling a .NET web service from Java but it seemed to rely on GLUE and I was unable to find out how to download that software. There seems to be alot written on the Sun site,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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,...

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.