sulbha walawalkar

Greenhorn
+ Follow
since Jan 09, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by sulbha walawalkar

Hi,

Is anyone working in JSF on Websphere6.1?
I am migrating the app from WAS5.1 to 6.1 and it has .wdo-connection file for DB2 connection.
What changes should be done in WAS6.1 in .wdo-connection file?

If someone can provide sample file which is similar in WAS6.1 it will be great.

Thanks,
Sulabha
16 years ago
JSF

code:
---------------------------------------------------------------------------
Web serviceRequest Response=========== ==========JAXB ^^^^^^^^^^XML to Obj JAXB Use external bindings to map Objects to and from XML (Schema)vvvvvvvvvv Obj to XML============ =========== Domain Logic Objects============ =========== Object-based SQL Server facadeObj to XML ^^^^^^^^^^translators XML to Obj JAXB assisted marshalling/unmarshallingvvvvvvvvvv translators possibly using your own XML Schemas========== ==========XML-based SQL Server API

---------------------------------------------------------------------------




How can I implement the jaxb marshalling/unmarshalling using adapter pattern? or any other pattern?
16 years ago


External binding happens during compile time with the xjc compiler - so I don't see that having any impact on the deployment settings.



Yeah..I have used xjc to bind xsd file (with contract first approach for spring) to java objects (i'll call them as schema objects).
I am using domain objects (DTO) to be used by service layer, as I have mentioned in my previous post. And creating them in end points with the data from schema objects...
Were you suggesting external binding for mapping the xsd to domain objects?

There will be 2 different xsd sets that will be used. One for request/response from client to spring web service.
Another is schema definition for the request/response for 3rd party application from service layer.
So there will be
- schema objects (for marshalling/unmarshalling) soap message
- domain objects (dto) that will be used in service layer
- schema objects (for marshalling/unmarshalling) java to plain xml for 3rd party api


It may be worth looking at "pre-processing" those redefines out the schemas (people having to deal with them don't seem too fond of them) for JAXB - i.e. replacing the redefines with an "include" to a new schema file that is generated from the "original redefined" schema with all the redefinitions applied. JAXB won't care as long as the fully qualified names aren't affected.



I could create the objects with Jaxb2. I didnt like jaxb1 as it creates too many classes.
But when in tried to bing schema with Castor, it was pain. It needs many packages..and finally it gave me xml excpetion while parsing. The same schema I could parse with jaxb2..strange!


Originally posted by Peer Reynders:
[QB]

Performance wise Castor is inferior to both versions of JAXB. It is also unclear how long Castor will be supported with JAXB being part of the JDK. The current non-JAXB favorite seems to be JiBX and it is supported by Axis 2. With JiBX you can sidestep the JAXB upgrade issue and possibly use Axis 2 as your front end. JiBX seems to have the best performance characteristics.



okay..I'll chk this too.
Thanks.

Sulabha
16 years ago

Originally posted by Peer Reynders:
[QB]
You should be able to do most of the XML/Java conversion through the use of external binding files. Then it is simply a matter of layering the responsibilities appropriately.



Thanks for thr reply. As of now I'm doing the 2nd option to created DTOs from schema objects. I'll look at the external binding option for jaxb. Is there any binding mapping that I need to configure in spring servlet xml file or while binding schema? Could not find any example for that.

About the converting the java objects to xml, yes I can use Adapter to translate the data in xml.
I tried to create the java objects with jaxb1, but the xsd file has <xs:redefine> tags which are not supported by jaxb1. Jaxb2 does support, but we have jaxb1 marshalling/unmarshalling jars being used by other applications. Not sure when they will upgrade to jaxb2. So I cant use jaxb2 as of now.

I'll be implementing castor for soap message & converting java to xml as another approach to test the performance.

Is there any better option to transalte java to xml (with jaxb1 for marhalling/unmarshalling soap message)?

Also if I have <xsd:redefine> in xsd file, the code generator doesn't generate java class with the name of xsd file. Instead it generates java classes for as many xsd files I have in <xsd:redefine> tag. Not sure how to generate xml out of so many classes. I believe any marshal method accepts xml file name & java class containing the data.

Thanks,
Sulabha

16 years ago
well...I have looked at the thread that you hv referred..but my problem is different..
I am using Jaxb marshaller in spring w/s..so end point implementation class gets the java object representing the soap request.
I have written facade as interface to business methods.
To get the data requested by client, w/s will call the other application which accpets xml message (schema provided in xsd format) and returns the response the xml.
Now since my end point has request data in java objects, I need to form the xml message.

I have couple of queries here....

1. while using marshaller, I have created request objects from xsd file (contract-first) which are exposed to client in wsdl.
Should I use/pass the same request objects to servic layer?
Or create diffrent domian objects in servic layer and pass thar to facade/service?

2. Application will also write some of the data to DB2..for which I have written DAO. since no business logic should be kept in facade, I have written that bit of code in DAO. Does that sounds logical?

3. To read/write data in xml from java objects, I think I need to again map the xsd file (provided by third party) to java objects and use apis (from jaxb/xml beans or any other xml tech) to translate the data into xml and vice versa...
I am not sure which pattern would be good to implement this bit of code.

Thanks in advance,
Sulabha
[ February 25, 2008: Message edited by: sulbha walawalkar ]
16 years ago
Peer,

Thanks for the pointers..it was very helpful.

I am now using spring web services for my application with facade as a interface for web service. The service will send the data in xml format to a third party application to read/write the data to SQL server.

Which design pattern can be used with facade to keep business logic to form xml and call 3rd party api to read/write data to SQL server?

Also in the spring f/w, am using jaxb as marshaller and thinking of using the same to form xml message to send to 3rd party api.
Is there any other good way of forming xml from xsd?

Thanks,
Sulabha
16 years ago
Hi,

Has anyone developed spring web service in RAD? I wanted to know how to start with...
any pointers will be helpful.

Thanks,
Sulabha
Thanks for the reply..

My requirement is to provide a interface to java and .net clients.
This interface will inturn call another web service or just java/ejb class thats containing the acutal biz logic.
Facade can handle other stuff like logging/security, integrating calsl to other services.

Can you suggest some good link to read abt the design pattern & abt the preformance issues in web services?

Thanks,
Sulabha
16 years ago
I am using Calendar as data type to pass date in soap message.
when i invoke web service from java client, getting error is as below:

java.lang.NumberFormatException: WSWS3045E: Error: Invalid date: Sun Feb 10 10:00:00 GMT 2008 Message being parsed:
at com.ibm.ws.webservices.engine.WebServicesFault.makeFault(WebServicesFault.java:206)
at com.ibm.ws.webservices.engine.SOAPPart._getSOAPEnvelope(SOAPPart.java:1062)
at com.ibm.ws.webservices.engine.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:604)
at com.ibm.ws.webservices.engine.SOAPPart.getEnvelope(SOAPPart.java:632)


I am using RAD7 as dev environment and the app is deployed on WAS6.

Has anyone come across this kind of error?
Any pointers will be helpful.

Thanks,
Sulabha
[ January 16, 2008: Message edited by: sulbha walawalkar ]
16 years ago
Can someone give me some pointers about how to use facade pattern in web services? I am using websphere 6 & RAD 7 as runtime environment.
I am pretty new to web services...so any pointers will be helpful.

Thanks,
Sulabha
16 years ago