Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Amer Seifeddine

Ranch Hand
+ Follow
since Apr 25, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Amer Seifeddine

HI Brock,

I know that was 4 years ago.. Do you still have time to volunteer?
9 years ago
Hello,

Do you know what is the fastest way to find the caller class and method/ Line?

I know two approaches:
- Printing the thread trace
- New throwable then getting info from it..

Is there another way? What is the best from performance point of view?

Thanks
9 years ago
I have a concern on how to deal with the situation which I have..

I want to consume/send soap messages for any given wsdl file, in a generic approach without having to import packages for every wsdl's generated code. I think this is logically possible since we have the wsdl document and we know how to construct the message based on the given input.. For example,

Input:
Add Object WORKORDER (wonum, description ,location) + wsdl file
Add Object LOCATION (location, description )+ wsdl file
Add Object ASSET (assetnum, description)+ wsdl file

etc..

Process:
Generic XMLBeans processor to send soap messages. I am looking for a process or approach which allows me to use wsdl information which can be used to navigate through the xmlbean object without really importing the real package of the generated source.. Something like reflection..

Output:
SOAP message with below format .. Tags will be taken from the wsdl file:

***************
<WORKORDER>

<wonum>
<description>
<location>

*****************

<LOCATION>
<location>
<description>

******************

Thank you for guiding me on this..
9 years ago
Why not using the power of xmlbeans.. It has cursor which can be moved up down and can insert delete and much more.
Hey,

You have the option to skip the validation from the class as option or using the command line.. If you are using a class to generate your schema:

XmlOptions opts = new XmlOptions();
opts.setCompileNoValidation();

Otherwise, skip the validation using the scomp option.

Hope this helps.
Never mind.. I am switching to xmlbeans.. I ve never gotten a quick good answer anyway!

Thanks
Hi Again,

I have other question.. Here is my requirement:
Want to build POJOs from a servlet and then use XML binding to construct my xml to be sent via web service. Also, I want to receive xml data using an http client to consume xml data then bind them to POJOs.

Performance is an important issue.. I would like to convert xsd schema to Java classes so that it can be used for binding. Xsd can be changed from time to time and this should be dynamically detected.

Thanks.
Hi there,

I am trying to generate classes from xsd file using below code:
URL url = new URL("http://url/OSWOService.xsd");
SourceGenerator srcGen = new SourceGenerator();
srcGen.setVerbose(true);
srcGen.generateSource(new InputSource(url.openStream()), "test");

Any idea (check below details)?
Also I have seen this interesting info on:
http://www.oreillynet.com/onjava/blog/2005/07/castor_xml_on_a_realworld_proj.html

Do you know if there is any sample example for this?

Error:
NullPinterException
at java.util.Hashtable.put(Unknown Source)
at org.exolab.castor.builder.BuilderConfiguration.setLocationPackageMapping(BuilderConfiguration.java:618)
at org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:702)
at org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:651)

xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://url1" elementFormDefault="qualified" attributeFormDefault="unqualified" targetNamespace="http://www.ibm.com/maximo">
<xsd:include schemaLocation="http://url2/MXMeta.xsd" />
<xsd:include schemaLocation="http://url2/OSWO.xsd" />
<xsd:include schemaLocation="http://url2/workorder.xsd" />
<xsd:complexType name="CreateOSWOType">
<xsd:sequence>
<xsd:element ref="OSWOSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="InvokeOSWOType">
<xsd:sequence>
<xsd:element ref="OSWOSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="QueryOSWOType">
<xsd:sequence>
<xsd:element ref="OSWOQuery" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
<xsd:attributeGroup ref="QueryContentGroup" />
</xsd:complexType>
<xsd:complexType name="SyncOSWOType">
<xsd:sequence>
<xsd:element ref="OSWOSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="PublishOSWOType">
<xsd:sequence>
<xsd:element ref="OSWOSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
<xsd:attributeGroup ref="PublishingContentGroup" />
</xsd:complexType>
<xsd:complexType name="UpdateOSWOType">
<xsd:sequence>
<xsd:element ref="OSWOSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="DeleteOSWOType">
<xsd:sequence>
<xsd:element ref="OSWOSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="InvokeOSWOResponseType">
<xsd:sequence>
<xsd:element ref="OSWOSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="CreateOSWOResponseType">
<xsd:sequence>
<xsd:element ref="WORKORDERMboKeySet" minOccurs="0" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="QueryOSWOResponseType">
<xsd:sequence>
<xsd:element ref="OSWOSet" />
</xsd:sequence>
<xsd:attributeGroup ref="CommonContentGroup" />
<xsd:attributeGroup ref="ResponseContentGroup" />
</xsd:complexType>
<xsd:complexType name="SyncOSWOResponseType">
<xsd:sequence />
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="DeleteOSWOResponseType">
<xsd:sequence />
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:complexType name="UpdateOSWOResponseType">
<xsd:sequence />
<xsd:attributeGroup ref="CommonContentGroup" />
</xsd:complexType>
<xsd:element name="UpdateOSWO" type="UpdateOSWOType" />
<xsd:element name="QueryOSWO" type="QueryOSWOType" />
<xsd:element name="CreateOSWO" type="CreateOSWOType" />
<xsd:element name="SyncOSWO" type="SyncOSWOType" />
<xsd:element name="DeleteOSWO" type="DeleteOSWOType" />
<xsd:element name="PublishOSWO" type="PublishOSWOType" />
<xsd:element name="InvokeOSWO" type="InvokeOSWOType" />
<xsd:element name="InvokeOSWOResponse" type="InvokeOSWOResponseType" />
<xsd:element name="QueryOSWOResponse" type="QueryOSWOResponseType" />
<xsd:element name="CreateOSWOResponse" type="CreateOSWOResponseType" />
<xsd:element name="SyncOSWOResponse" type="SyncOSWOResponseType" />
<xsd:element name="UpdateOSWOResponse" type="UpdateOSWOResponseType" />
<xsd:element name="DeleteOSWOResponse" type="DeleteOSWOResponseType" />
</xsd:schema>
Is my question weird or very difficult?

Basically, I want to dynamically parse the document/literal soap response into Java classes since the schema can be changed. Also, I want to use classes to build up the document/liertal request.. Is there a technology to help resolving this?

Thanks..
9 years ago
Hello,

I need to write the client part of a web service to consume a document/literal xml file. However, I need to be able to validate my variables against nillable,types of the xml element. also, important to mention that the xml content may change from time to time based on administration decision on the server side.. What shall I use.. DII or Dynamic proxy ?
9 years ago
Folks- I need to know what would be the best approach to resolve this situation ..

the server side webservice sends and receives soap messages for adding/querying records in this format:

<TableService action="Add, update or delete">
<Table1>
<Field1> Value1 </Field1>
<Field2> Value2 </Field2>
<Field3> Value3 </Field3>
<relationshipTable>
<Field3> Value3 </Field3>
</relationshipTable>
<Table1>
</TableService>

There is a special wsdl for every table (or service). There are xsd files to define every field based on database configuration.. those xsd files are automatically generated along with wsdl files based on the service configuration on the server side.. This is what I want to do:
Client side JAX-RPC to parse all those xml documents into Objects to be passed to the browser using javascript (DWR) so that they can be fetched, queried and updated then send them back to the server.

Since the wsdl can be changed depending on the service configuration on server side and since fields can be removed or added based on administration decisions and since I want to use generic JAX-RPC client to parse any such xml and not only for specific table.. I am thinking to use DII but what would be the best approach to attack this situation.

I beleive that this forum is the best on the net and I hope you can help me taking the best decision.. please and thanks in advance.

Examples or links are welcome..

[ November 05, 2008: Message edited by: Amer Seifeddine ]
[ November 05, 2008: Message edited by: Amer Seifeddine ]
9 years ago
Hello All,

I know that EJB is using the multithreading feature to manage EJB sessions and manage the lifecycle.. That is well understood. What I need to know:

which thread is used to fetch records from the database? If EJB thread is the answer, then what the jsp thread will be doing at this time? waiting/sleeping ?

In Other words, when an incoming request (including rmi) is initiated, which container's thread is executing the code in the ejb session (including the datastore fetch/update or delete).. Thanks!
I am trying to build my own framework along with the business application.
Hello,

I am wondering which design would be better than the second for a business appliation managing user sessions (active/inactive etc):

1- Leave incoming threads to interact with sessions/database
2- Have internal threads managing incoming threads and serve their requests? How would I do that?
3- Any other idea is welcome.

Thanks!
Thanks. This is usefull to persist user session in memory if inactive instead of writing it to a file.
10 years ago