473,395 Members | 1,516 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.

how to read ArrayOfAnyType from .Net web service using JAVA code

i am try to read an object from .Net Webservice i got this type
ArrayOfAnyType
as in this lines of code:

public class NewClass {



try { // Call Web Service Operation
org.tempuri.CountryWS service = new org.tempuri.CountryWS();
org.tempuri.CountryWSSoap port = service.getCountryWSSoap();
// TODO process result here
org.tempuri.ArrayOfAnyType result = port.countryGetAll();
System.out.println("Result = "+result);
} catch (Exception ex) {
// TODO handle custom exceptions here
}

}

how to extract data from this Object (ArrayOfAnyType) ???

this Object is a collection return from .Net webservice
Feb 22 '10 #1
4 5806
ThatThatGuy
449 Expert 256MB
So whats the problem in it .... it would generally return an array...

suppose it returns an array of strings so it will appear as

Expand|Select|Wrap|Line Numbers
  1. <string>
  2. A
  3. B
  4. C
  5. D
  6. </string>
  7.  
parse it through Xml classes provided by java
Feb 23 '10 #2
Thanks for your reply "ThatThatGuy"
but the problem is that the web method which is "port.countryGetAll();" returns a collection (list) and in the java client i recieve this list object as a ArrayOfAnyType object and i couldn't extract the data from this object.
I tried to cast the arrayofanytype:
try { // Call Web Service Operation
// org.tempuri.ReservationWS service = new org.tempuri.ReservationWS();
// org.tempuri.ReservationWSSoap port = service.getReservationWSSoap();
// // TODO process result here
// org.tempuri.ArrayOfAnyType result = port.reservationGetAll();
//
// List<Object> list = result.getAnyType();
// _reservation[] array = (_reservation[])list.toArray(new _reservation[list.size()]);
// for(int i=0;i<array.length;i++){
//// _reservation res = (_reservation)list.get(i);
// System.out.println(array[i].getRESERVATIONIDs());
//// System.out.println(res.getRESERVATIONIDs());
// }
//
//
// } catch (Exception ex) {
// // TODO handle custom exceptions here
// ex.printStackTrace();
// }
but it throws an exception, so i suppose its the wrong way to cast it.
kindly give me the java code which parses it through Xml classes provided by java.
Thanks.
Feb 23 '10 #3
ThatThatGuy
449 Expert 256MB
you can checkout this article
http://www.cafeconleche.org/books/xmljava/
for reading xml with java
Feb 23 '10 #4
Ok now i know how to read from an xml file with java classes. The question now is how could i access the xml file (SOAP Response).

what is the path of XML files in .Net webservices is it on the server or where?
Feb 23 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: raman.p123 | last post by:
Hi. Friends Plz can u helps me in this regard Currently I am using VB.net & SQl 2000 in my project. Using ASP.net/VB.net programming. Is it possible to import Excel sheet using DTS Import...
5
by: sang | last post by:
How to read the .doc file into the printable format(ie without ascii code). It's urgent pls anyone help me Thanks Sang
1
by: keyjen2017 | last post by:
i am trying to read the table in DB2 using JAVA code. then it is supposed to be copied in .txt file. how can i do this? other thing, i m passing date in dddd-mm-yy format from JAVA codeto call a ...
1
by: JagPeram | last post by:
Is it possible to return a xml object from a jsp using java code? here is my code: <html> <head><title>Page Title</title></head> <body> <table width="100%"> <tr> <td>
3
by: shoby | last post by:
Hi, I need to execute an exe from a java application.The exe follows a partticular format when it is executed from command line. The format is as below: ( exe-name < input.txt ) > output.txt...
4
AR Ratheesh
by: AR Ratheesh | last post by:
Dear all, I am in a Internet cafe administration project using Access.I really dont know,how stop the service when the scheduled time ends. Please give me a suggestion....
1
EntryTeam
by: EntryTeam | last post by:
Will i be able to read SMS programmatically by using Java midlet at Nokia 5800XM (which is Symbian-based handset including Java virtual machine) ?
0
by: netri | last post by:
I need to write a java program in which i need to access a computer in my network using IP address but system is password protected.so how can i access a password protected system to fetch a file...
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
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...

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.