Skip to main content

JIAN SLEE+WBSERVICES

10 replies [Last post]
saurabhbehl
Offline
Joined: 2008-01-21
Points: 0

Hi,

I am trying to make parlayx Resource adaptor that can communicate with the parlax Application. As parlax is using webservices(wsdl+endpoint), i am not able to understand How a resource adaptor can be integrated with j2ee/webservices project.

Please le me know

Regards
Saurabh Behl

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
saurabhbehl
Offline
Joined: 2008-01-21
Points: 0

Thanks Sabri,

Can u provide some sample code of that SOAP RA & Parlax Webservices.

Regards
Saurabh Behl

sskhirid
Offline
Joined: 2005-09-22
Points: 0

Saurabh,

Concerning Parlay X, you should develop a particular extension of your SOAP RA in order to process specifically your parlay X WS.
Or you can imagine to have a generic SOAP RA, which fire the parlay X SOAP requests to particular SBBs (as Parlay X server) which process the request and fire specific Parlay X event on the SLEE. There is more than one way to implement it on the SLEE.

Sabri.

PS : Our implementation of the SOAP RA is not public.

saurabhbehl
Offline
Joined: 2008-01-21
Points: 0

Hi sabri,

We took a approach of using HttpServletRA to handle the HttpRequest coming from Ericsson application & made a SBB that will handle the logic of parsing the request fired by HttpServletRA.
I am able to get the request, now the problem is to extract the SOAP messge from the request.
I have two options infront of me
1) I can use the MM7 SOAP parser & all with lotz of modifications
2) To use JAXWS/JAXB to extract the messge.--How we can do that.

Can you guide one this issue.

Regards
Saurabh Behl

sskhirid
Offline
Joined: 2005-09-22
Points: 0

Hi,
You have several options:
Let’s imagine that you select JAXB. You can write an SBB child which exposes a local interface such as:
Public MyParleyObject unMarshall(String soapBody);
Public String Marshall(MyParleyObjectResponse response);
This SBB child embeds the JAXB library needed to decode and encode the SOAP String message into your business data objects.
Then when you receive your HttpRequest, you have to extract the SOAP body, extract the and get your SOAP DATA request xml. Then you create your SBB child and ask for unmarshalling.
Now you have got the request translated into a JAVA object that you can fire as event on the SLEE.
JaxbParleyXLocal converterLocal = (JaxbParleyXLocal) this.sbb.getJaxbParleyrSbb().create();
converterLocal.unMarshall(soapData);

During our test load we noticed that JAXB is really good in term of performance, however, you must take care to the way you instantiate the marshaller and the unmarshaller. Indeed their instantiation takes a lot of CPU and time, then, you should carefully design your SBB child in order to avoid too long instantiation time when you create a new entity. Otherwise your application will be load resistant but not if the load increases fast.

Best regards,

Sabri.

saurabhbehl
Offline
Joined: 2008-01-21
Points: 0

Hi sabri,

I used HTTPRA, in SBB i extracted the messge sent by ericsson application & saved it in xml file.

Saurabh.xml----


xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="http://www.csapi.org/schema/parlayx/sms/send/v2_2/local"
xmlns:ns2="http://www.csapi.org/schema/parlayx/common/v2_1">


tel:123
tel:07123456789
Hello World!

My problem is when i try to extract this xml file by the code below

JAXBContext jc1 = null;
FileInputStream in=null;
jc1 = JAXBContext.newInstance("parlayx.sms");
Unmarshaller unmarshaller = jc1.createUnmarshaller();
try {
in = new FileInputStream(new File("c:/saurabh.xml"));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
SmsMessage collection= (SmsMessage)unmarshaller.unmarshal(in);

i get Exception-----
javax.xml.bind.UnmarshalException: unexpected element (uri:"http://schemas.xmlsoap.org/soap/envelope/", local:"Envelope"). Expected elements are (none)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:603)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:244)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:239)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:116)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:1009)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:446)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:427)
at com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:137)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:533)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:324)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:773)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1794)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:211)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:184)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:137)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:184)
at com.Sbb.aaaa.main(aaaa.java:78)

Can u plz look into that---Its a schema problem

sskhirid
Offline
Joined: 2005-09-22
Points: 0

Hello,

I think this forum is not suited to discuss about JAXB problem. However, your problem is that JAXB is made for decoding only your XML data model. It means that you have to remove the SOAP envelope and body which are not part of the data model.
From:

xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="http://www.csapi.org/schema/parlayx/sms/send/v2_2/local"
xmlns:ns2="http://www.csapi.org/schema/parlayx/common/v2_1">


tel:123
tel:07123456789
Hello World!


You have to extract:

tel:123
tel:07123456789
Hello World!

Your are likely to remove the ns1 as well but not sure, to test. Now this string represents your XML data model and JAXB is now able to unmarshall it.

Sabri.

saurabhbehl
Offline
Joined: 2008-01-21
Points: 0

Did anyone make or integrated Parlayx webservices with SLEE(Resource Adaptor)?

saurabhbehl
Offline
Joined: 2008-01-21
Points: 0

Did anyone make or integrated Parlayx webservices with SLEE(Resource Adaptor)

sskhirid
Offline
Joined: 2005-09-22
Points: 0

Hello Saurabh,

From my point of view, you can have multiple possibilities:
1. You can write a normal web service and deploy it in a standard web server and this service just forwards the request to the SLEE by the J2EE RA and the SLEE connection. This architecture was also proposed for integrating SIP servlet server and JAIN SLEE. This solution is the easiest but not the most flexible.
2. You can write your own SOAP resource adaptor, that is the choice we made in my company. In that case the JAIN SLEE becomes the SOAP server and SBBs who subscribe to the SOAP event, handle the service logic. This solution is pretty flexible, that means that a service provided and published by the SOAP ra is implemented by SBBs and then can interact with other RA and then other protocols. For instance with a SOAP request you return a user credit, sending an SMS or even initiate a 3rdparty call control.
In addition that means that the RA manage the HTTP session, timeout, etc.
But in this case the RA must implement what Axis does in apache and if possible in an efficient way, e.g., recieve the HTTP request, extracting the SOAP content, UnMarshalling the request and sending the event and the unmarshalled-object to the SLEE. Without forgetting all the class path problems you can have.

Is anybody has a different view of this issue ?

Sabri.

david_ferry
Offline
Joined: 2006-05-07
Points: 0

Hi ... what OC did here is similar to what Sabri mentions, so we have a similar view.

i.e. you can get a SOAP RA for Rhino where the HTTP layer and SOAP envelope handling, SOAP error code mappings to HTTP error codes etc are done by the SOAP RA,

Also the J2EE integration appendix is supported as per JSLEE 1.0