Web Service with Complex Results and Flex
I have created a Enterprise Java Bean that has one "test" method that returns a String[]. I have compiled, deployed and registered this bean in Sun's Application Server 8.1. I am using NetBeans 5.0 to develop this project.
I try to load this web service into Flex and I get a fault thrown: TypeError: Error #1034: Type Coercion failed: cannot convert []@29e5d06 to XMLList. I have set the returnType in Flex as "e4X.". Do I need to do this in my webservice.
Any help would be appreciated.
HI Andrea,
I think with present netweaver developer studio , we can create Web services with end points as simple data types in java and the array of that simple data types.
not sure whether it support our own custom developed classes as end points.
just go through these links.
http://help.sap.com/saphelp_nw2004s/helpdata/en/f7/af60f2e04d0848888675a800623a81/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/f7/af60f2e04d0848888675a800623a81/frameset.htm
from this we will get Restrictions for WS Endpoints.
Regards
Kishor Gopinathan
Similar Messages
-
How to create web services with complex objects as parameters
Hi,
Not sure if this is the right place, but...
I'm using Netbeans 5.5 and trying to learn web services.
Creating a simple web service with simple parameters like strings and integers is nice and easy. I'm now trying to take the next step, and create a web service with a more complex schema as a parameter.
I've tried two approaches, and hit dead ends on both:
(1) Define my complex schema as an xsd file, and then create a WSDL file. Creating the schema and saving it in my EFB project works fine; when I try to create a new WSDL file, the IDE gives me a button to import external schemas - which is where the problem is: the Browse simply won't find my newly created schema file.
(2) Define a Java class (in this case, it's a fairly simple example containing a single ArrayList), and then use the IDE to generate a web service from Java. The IDE does this fine, but I now have no idea how to consume or test the web service - I don't know where to look for the WSDL that has presumably been generated, and I'm also a bit iffy over what answers to give the WSDL creator about port names etc.
Ideally, I'd prefer to get approach 1 to work - can someone point me in the direction of a sensible tutorial for these things?
(Happy to carry on using Netbeans 5.5 or to revert to Sun Studio Enterprise, which I was playing with before.)
All help appreciated, Thanks- For NetBeans related questions, nbusers mailing list is more suited. It is often visited by NetBeans experts.
http://www.netbeans.org/community/lists/top.html
...[email protected]
The NetBeans users mailing list. General discussion of NetBeans use, this is the place to ask for help and to help others.... (There is a 'Subscribe' button next to the above that you can use to subscribe to the list).
Can you try posting this question on nbusers list?
- SJSE 8.1 is based on an older version of NB (NB5.0).
You should definitely continue with NetBeans, since all development is now being done in NetBeans; all the major JSE modules have been moved to opensource at netbeans.org and are all being developed there. There are as yet no future plans to work on further releases for JSE.
Please check out http://www.netbeans.org for more details. -
Web service with complex java type
Hi,
I create a web service method with String o with Array of Strings without problem. Now I nedd to create a ws that return a table, so I create a class like this:
public class User {
private String Name;
private String.Surname;
public void setName(String setName){
Name= setName;
public void setSurname(String setSurname){
Surname=setSurname;
In my ws class I use this object:
public User[] getUser(String a){
User[] user = new User[10];
for (int i=0;i<10;i++){
User<i>.setName("aaa");
User<i>.setSurname("bbb");
return user;
When in WebService Perspective I try to create my ws in wizard mode I see method getUser but I can't check it
Where is error?
Thanks
AndreaHI Andrea,
I think with present netweaver developer studio , we can create Web services with end points as simple data types in java and the array of that simple data types.
not sure whether it support our own custom developed classes as end points.
just go through these links.
http://help.sap.com/saphelp_nw2004s/helpdata/en/f7/af60f2e04d0848888675a800623a81/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/f7/af60f2e04d0848888675a800623a81/frameset.htm
from this we will get Restrictions for WS Endpoints.
Regards
Kishor Gopinathan -
Web Services with REST, SOAP and JAX-RPC
Hi,
Can somebody who has developed web services extensively comment/suggest a java development environment that works best for developing web services mainly with REST. I've found that Eclipse with Axis2 and Tomcat works well. But I would like to get your opinion on it and some other alternatives.Hi,
Please help me its urgent.
can u give me a detail example how to do Web services
with REST.
Here is my id [email protected]
Thanks in advance.You can do this in many ways. It depends on how heavy your service is. You can write a simple servlet that will take a REST (I'm assuming you know what REST is) request and parses it out, calls a server-side method and generates a REST response.
Another way is to use a web-service container such as AXIS. You can read some examples and documentation on their website. AXIS2 has REST support as well. -
Accessing a web service with complex types
Hi I have been struggling with this web service for a while
now....
I am trying to send input parameters that are composed by :
applicant name( name, surname, .....) and applicant input address(
hse no, street, postcode...) Applicant dob(dob)....I am using
<cfscript> tag to pass these parameters...Now my problem is
do i need to put each complex type inside its own <cfscript>
tag???
ie:
stName = structNew();
stName.Title = "#Mr#";
stName.forename = "Man";
stName.othernames = " NA";
stName.Applicant = "Yellow";
stName.suffix="";
stName.dob = createDate(1972,06,05);
and do this for applicant address? or could i enclose this in
under the same cfscript tag??
Any help would be appreciated...thanks
criticalCheck out
http://hcc.musc.edu/research/shared_resources/xml_complex_types_to_cf_structure_notes.cfm
The last part of that link is .cfm - not sure why its getting
cut off. -
Web Services with Complex Data Types in ADF 11g
Shay Shmeltzer's following blogpost can answer my questions but all the links there
http://blogs.oracle.com/shay/2009/09/web_services_with_complex_data.html
Can you please point us to the correct links for the following documents?
http://www.oracle.com/technology/tech/fmw4apps/agile/pdf/adf11g-agile.pdf
http://www.oracle.com/technology/products/jdev/tips/fnimphius/wsdccomplexinputtype/index.htmlThanks. We are using a Java Proxy to consume the web service as we need to use JAX-WS handlers. We created data control from the service stub that was created by the proxy. Our issue is with the response XML which comes as a complex type. Also, the data control is understanding the complex type and is creating the structure right. The problem is when we drag that control on a JSF page. No data is displayed. We think that we are not traversing the complex object properly which is creating the issue.
I understand that you answer related to the input is applicable to output as well. We can change the structure by flattening it but we thought that in 11G there is some new features where we can use the complex types out of the box without any change. Is that true? Also, any luck in finding the documents (broken links) on your blog page? -
EJB3 Creating Web Services with Complex Return Types
Hi
Not sure if this is the right place, but hoping someone can help!
I have an entity bean that has a collection (list<Address>) of sub-entities. I have then created a session bean to retrieve the Business and populate it's children.
I then expose this as a web service and although it works and I get appropriate XML out, the WSDL of the deployed service is not as I would like.
For example:
The return type is
<complextype name="Business">
<sequence>
<element name="id" type="int"/>
<element name="addresses" type="ns1:list"/>
</sequence>
</complextype>
<complextype name="Address">
<sequence>
<element name="id" type="int"/>
<element name="addresses1" type="string"/>
<element name="addresses2" type="string"/>
<element name="addresses3" type="string"/>
</sequence>
</complextype>
ns1:list is included as a separate schema as a complex extension of the base "collection"
So, even though the Address type is there it is not referenced from Business.
So, when I'm calling the Web Service from BPEL or ESB, I have not got the ability to map adequately back from the response.
I have tried a whole bunch of ways of getting this to work, but so far to no avail...
Has anyone seen this before, or can I somehow override the mapping from the Entity to the WSDL?
Any help would be most appreciated.
Thanks
ChrisThanks. We are using a Java Proxy to consume the web service as we need to use JAX-WS handlers. We created data control from the service stub that was created by the proxy. Our issue is with the response XML which comes as a complex type. Also, the data control is understanding the complex type and is creating the structure right. The problem is when we drag that control on a JSF page. No data is displayed. We think that we are not traversing the complex object properly which is creating the issue.
I understand that you answer related to the input is applicable to output as well. We can change the structure by flattening it but we thought that in 11G there is some new features where we can use the complex types out of the box without any change. Is that true? Also, any luck in finding the documents (broken links) on your blog page? -
Web Services with Large Result Sets
Hi,
We have an application where in a call to a web service could potentially yield a large result set. For the sake of argument, lets say that we cannot limit the result set size, i.e., by criteria narrowing or some other means.
Have any of you handled paging when using Web Services? If so can you please share your experiences considering Web Services are stateless? Any patterns that have worked? I am aware of the Value List pattern but am looking for previous experiences here.
ThanksJoseph Weinstein wrote:
Aswin Dinakar wrote:
I ran the test again and I removed the ResultSet.Fetch_Forward and it
still gave me the same error OutOfMemory.
The problem to me is similar to what Slava has described. I am parsing
the result set in memory storing the results in a hash map and then
emptying the post processed results into a table.
The hash map turns out to be very big and jvm throws a OutOfMemory
Exception.
I am not sure how I can turn this around -
I can partition my query so that it returns smaller chunks or "blocks"
of data each time(say a page of data or two pages of data). Then I can
store a page of data in the table. The problem with this approach is
that it is not exactly transactional. Recovery would be very difficult
in this approach.
I could do this in a try catch block page by page and then the catch
could go ahead and delete the rows that got committed. The question then
becomes what if that transaction fails ?It sounds like you're committing the 'cardinal performance sin of DBMS processing',
of shovelling lots of raw data out of the DBMS, processing it in some small way,
and sending it (or some of it) back. You should instead do this processing in
a stored procedure or procedures, so the data is manipulated where it is. The
DBMS was written from the ground up to be a fast efficient set-based processor.
Using clever SQL will pay off greatly. Build your saw-mills where the trees are.
JoeYes we did think of stored procedures. Like I mentioned yesterday some of the post
processing depends on unicode and specific character sets. Java seemed ideally suited
to this since it handles these unicode characters very well and has all these libraries
we can use. Moving this to DBMS would mean we would make that proprietary (not that we
wont do it if it became absolutely essential) but its one of the reasons why the post
processing happens in java. Now that you mention it stored procedures seem the best
option. -
Using web services with flash cs3 and actionscript 3.0
Hi,
I want to use web services under flash cs 3 and by using as
3.0.
It was possible with as 2.0 to do it easily thanks to the
webservice Connector.
But I can't find how to use web services under flash and as
3.0.
I thought web services took part of the many improvements
flash cs 3.0 contain, but obviously it does not:(
Can anybody help me to use webservices with flash cs 3 and as
3.0?
Thanks in advance,
PascalDark Armor, You mentioned the book Adobe Flash CS4 Professional Classroom in a Book, which I have. I could not find anything in there. Did you mean to say Actionscript 3.0 for Adobe Flash CS4 Professional? I do have that book and it looks like there is information there. Just wanting to make sure that you meant what you said. Thanks!
-
Pl Help......Web services with complex types
Hi,
I have deployed a web service on OC4J (9.02) having a complex type input and a complex type return. The web service is implemented as a stateless session bean and
the relevant web.xml for the deployment is:
<servlet>
<servlet-name>ZipLookupManager</servlet-name>
<servlet-class>oracle.j2ee.ws.SessionBeanWebService</servlet-class>
<init-param>
<param-name>jndi-name</param-name>
<param-value>ZipLookupManagerBean</param-value>
</init-param>
<init-param>
<param-name>class-name</param-name>
<param-value>com.indus.banner.components.cdyne.ZipLookupManagerBean</param-va
lue>
</init-param>
<init-param>
<param-name>interface-name</param-name>
<param-value>com.indus.banner.components.cdyne.IZipLookupManager</param-value
>
</init-param>
<init-param>
<param-name>custom-bean-qname</param-name>
<param-value>
com.indus.banner.components.cdyne.LatLongReturn,
http://cdyne.components.banner.indus.com,
LatLongReturn,
org.apache.soap.encoding.soapenc.BeanSerializer,
org.apache.soap.encoding.soapenc.BeanSerializer
</param-value>
</init-param>
<init-param>
<param-name>custom-bean-qname</param-name>
<param-value>
com.indus.banner.components.cdyne.ZipState,
http://cdyne.components.banner.indus.com,
ZipState,
org.apache.soap.encoding.soapenc.BeanSerializer,
org.apache.soap.encoding.soapenc.BeanSerializer
</param-value>
</init-param>
</servlet>
The web service deploys correct. I have all the relevant jars in the %J2EE_HOME%\lib folder. However, when I call the web service from a standalone client I get the following error:
java.lang.ClassNotFoundException:
org.apache.soap.encoding.soapenc.BeanSerializer
at
oracle.j2ee.ws.GeneratedClassLoader.findClass(GeneratedClassLoader.ja
va:48)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at oracle.j2ee.ws.BaseWebService.initQnameMap(BaseWebService.java:602)
at oracle.j2ee.ws.RpcWebService.init(RpcWebService.java:453)
at
oracle.j2ee.ws.SessionBeanRpcWebService.init(SessionBeanRpcWebService
.java:54)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.
java:1956)
at
com.evermind.server.http.HttpApplication.findServlet(HttpApplication.
java:4355)
at
com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApp
lication.java:2484)
Please advise!
RizwanHi all,
I haven't heard back from anyone. Is this forum alive still? I have entered a TAR on metalink on this issue but they say that apparently this was a defect under 9.02 and has been fixed under 9.04.
Please help.
Many thanks in advance.
Rizwan -
Consuming Java Web Service with complex return types
Hi,
I'm consuming a Java Web Service and the return I get in
ColdFusion is a typed Java Object (with custom Java classes like
com.company.project.JavaClass ...)
Within this object I don't get direct accessible properties
as when I'm consuming ColdFusion Web Services, instead I get a
getPROPERTYNAME and setPROPERTYNAME method for each property.
How can I handle this? I don't want to call this methods for
each property (and there are nested objects with arrays of custom
classes below, which would really make this complicated).
What's the best way to cope up with this?
Thanks a lot,
FritzThe web service is actually the function, not the cfc and you
didn't show a function.
My own opinion is that since webservices by definition should
be available to any calling app (cold fusion, .net, flash, etc),
whatever gets returned from the method should be as universally
recognizable as possible. This generally means text, numbers,
boolean, or xml. -
Problem with a web service with Jbuilder 2005 and Weblogic 8.1
Hi,
i�m trying to create a web-service using Jbuilder 2005 Enterprise and Weblogic 8.1. It is a very simple web-service, come kinda "Hello World".
In the last step, after deploying my "ApplicatioModule1", i get this error:
"Unable to connect to server t3://localhost:7001 as user weblogic.
Reason: javax.naming.CommunicationException. Root exception is java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available router to destination
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:199)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:125)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:291)
at weblogic.jndi.Environment.getContext(Environment.java:164)
at weblogic.jndi.Environment.getInitialContext(Environment.java:143)
at weblogic.management.deploy.utils.MBeanHomeTool.getMBeanHome(MBeanHomeTool.java:157)
at weblogic.Deployer.runBody(Deployer.java:555)
at weblogic.utils.compiler.Tool.run(Tool.java:146)
at weblogic.utils.compiler.Tool.run(Tool.java:103)
at weblogic.Deployer.main(Deployer.java:399)
Check option -adminurl, -username and -password. "
I dont know why i get this error. I think the weblogic server is properly configured and running.
Anybody can help me?? Thx.i have found the solution to the problem myself. I only had to execute this command file startWebLogic.cmd which is placed in this default installation directory C:\bea\user_projects\domains\mydomain in order to put the server listening to ports.
i hope anybody with the same problem could fix it by reading this post. -
Publish ColdFusion Web Service with Complex Return Type
Hi,
I am working on a project to publish couple ColdFusion
webservices. The cosumer of those webservices is a Java
application.
One of my webservice need return an object. Here are demo
codes:
The returned ojbect is AddressRespond
AddressRespond.cfc:
<cfcomponent>
<cfproperty name="addresses" type="Address[]" />
<cfproperty name="myLearnException" type="MyException"
/>
</cfcomponent>
Address.cfc:
<cfcomponent>
<cfproperty name="city" type="string" />
<cfproperty name="state" type="string" />
</cfcomponent>
MyException.cfc:
<cfcomponent>
<cfproperty name="code" type="string" />
<cfproperty name="reason" type="string" />
</cfcomponent>
If the webservice "cosumer" is a ColdFusion application,
there is no any problems. But the Java application doesn't
understand the type of addresses in the WSDL file which is
gernerated by ColdFusion:
<complexType name="Address">
<sequence>
<element name="city" nillable="true"
type="xsd:string"/>
<element name="state" nillable="true"
type="xsd:string"/>
</sequence>
</complexType>
<complexType name="MyException">
<sequence>
<element name="code" nillable="true"
type="xsd:string"/>
<element name="reason" nillable="true"
type="xsd:string"/>
</sequence>
</complexType>
<complexType name="AddressRespond">
<sequence>
<element name="addresses" nillable="true"
type="tns1:ArrayOf_xsd_anyType"/>
<element name="MyException" nillable="true"
type="impl:MyException"/>
</sequence>
</complexType>
Could anybody give me any idea on how to resolve this
problem?
Thanks!The web service is actually the function, not the cfc and you
didn't show a function.
My own opinion is that since webservices by definition should
be available to any calling app (cold fusion, .net, flash, etc),
whatever gets returned from the method should be as universally
recognizable as possible. This generally means text, numbers,
boolean, or xml. -
Web Services with Complex Objects (Urgent !!)
Hi,
My last post was on a problem using IBM-RAD (Service) and AXIS2 (Client) in "New to Java" Forum. That is one of the trial scenarios I'm working on nowadays. Hope, I'll get some useful reply soon.
Now, I need a suggestion about the application I'm working upon. It is as follows:
(i) The application (i.e. Service Class) takes some primitive,String and/or some bean object as input
(ii) It returns a bean object [or an array (can use collection class also if possible) of bean objects].
(iii) The bean properties are primitive,String , other bean objects, and/or some collection object(Vector / ArrayList etc.) i.e. it should handle complex objects.
(iv) The Service should run on Websphere and Client on Tomcat.
A pictorial representation is given below:
[primitive/String/bean object (Input arg)]
[(Contains primitive/String/other bean objects/collection class)] Bean <---------> Service <----------------------- Client
[Calls bean] |===============> Client
[Returns bean (or array of beans / collection object)]
I'm now trying (by building test applications) a combination of IBM-RAD (Service) and AXIS2 (Client), but facing problems in handling array of beans and/or collection classes either on Service or on the Client side.
So, I need some suggestions on whether I'm going the right way, or need to change my approach (or technology). Any suggestion would be appreciated.
Please reply ASAP, it is urgent.
Thanks in advance,
Sumanno problem for me, so it's not urgent.
Request for help denied. -
Hello,
<br>
<br>
We need to build a web service with a predefined message in our ERP (ABAP), without PI or WebAS JAVA.
<br>
<br>
We thought it should be a simple task, because we had no problem with many other applications and systems when building the same service, but were not able to build it with SAP ABAP, probably as a consequence of our lack of knowledge on ABAP SOAP runtime.
<br>
<br>
We have an external asynchronous process that delivers information to many other systems using web services (information diffusion). Concecuently, the web service call's structure is determined by the caller, so we have to fulfill this structure if we want to receive the info.
<br>
<br>
The owner of the process defined a very simple service call, in which one kind of "record" can be repeated 1 to n times:
<br>
<br>
<br>
<br>
<br>
<br>
<reglasSuscripcion>
<br>
<!Zero or more repetitions:>
<br>
<nombre>?</nombre>
<br>
<valor>?</valor>
<br>
<nombre>?</nombre>
<br>
<valor>?</valor>
<br>
<nombre>?</nombre>
<br>
<valor>?</valor>
<br>
<br>
<nombre>?</nombre>
<br>
<valor>?</valor>
<br>
</reglasSuscripcion>
<br>
<br>
<br>
In order to receive this info, we have to implement an abap web service handler to accept this kind of call, the same way other applications/systems have already done.
<br>
<br>
We tried to build a RFC function call and create a web service with the wizard and it resulted in a web service with the following WSDL:
<br>
<br>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sap-com:document:sap:soap:functions:mc-style">
<br>
<br>
<br>
<br>
<reglasSuscripcion>
<br>
<!Zero or more repetitions:>
<br>
<item>
<br>
<nombre>?</nombre>
<br>
<valor>?</valor>
<br>
</item>
<br>
<br>
<br>
<br>
<item>
<br>
<nombre>?</nombre>
<br>
<valor>?</valor>
<br>
</item>
<br>
</reglasSuscripcion>
<br>
<br>
<br>
<br>
We found two main problems:
<br>
<br>
1.- When "wrapping" the RFC as a WS with the wizard, for a table datatype it automatically includes the <item></item> tag, so we break the predefined calling rules.
<br>
<br>
2.- The namespace is fixed by the wizard, and we would like to use a common namespace for all the "susbscribers", logically, the namespace fixed by the information diffusion service.
<br>
<br>
We also tried to find info on the outside-in approach for building a web service from the WSDL, but all the info we found required the ESR and we have no PI, just the ERP.
<br>
<br>
Any ideas on how to proceed?
<br>
<br>
Thanks in advance,
<br>
<br>
Joseba M. Iturbe
<br>
<br>
Edited by: Soporte Desarrollo on Mar 5, 2010 10:56 AM#2. I've recently had to "zap" some namespaces in an ECC5 system because the calling (TIBCO) system didn't appreciate the default SAP "urn" default - something to do with multiple colons in the address. There were, I think, just three table this affected, all VEP* ones. I think I should have been able to change these via the virtual interface in SE80 except that the ECC5 code was a bit "light" in this respect, so you may be able to do this now in SOAMANAGER in ECC6 (btw, I also had to re-save the WS definition within WSCONFIG and re-activate the virtual interfaces after this "zap" to generated the associated handler class again).
#1. Given your "name / value" pairs represent a complex type, then it might be better practice to have them as "item" which is probably why SAP proposes it this way... what does your custom function module parameter list look like?
Jonathan
Maybe you are looking for
-
My Mac won't print a pdf from the web
My iMac will not print any pdf from the web. The printer (an ho Photosmart plus) will only print a blank shet of paper.
-
One of my mail accounts has stuff that can go to my junk folder, but the other account has stuff that I do not want marked in any way as junk and for it to stay in my inbox! How do I do that?
-
Backing up computer with Time Machine
! was trying to do a backup for my Mac OS 10.6.8 so I can upgrade to OS 10.7. I was using Time Machine. After 12 hours, it still hadn't finished, so I canceled it. I have thousands of documents and pictures. Could it just be slow, or do I have to do
-
TRs are not being generated in Movement Type 261/262
Hi Gurus, I am perfoming several material documents with movement type 261/262 and I don t know why in some cases the WM tab is generated without TR with only a storage bin.....so we don t have the possibility to take the TR and transform it into a T
-
Help:how to use addAttachment method in NormalizedMessage
i have a problem about the NormalizedMessage's addAttachment method ,it is below: public void addAttachment(java.lang.String id, javax.activation.DataHandler content) throws MessagingException i have a string .i want to transfer it to a certain SE as