This week's giveaway is in the Spring forum.
We're giving away four copies of liveProject: Protecting User Data with Spring Security and OAuth2 and have Laurentiu Spilca on-line!
See this thread for details.
Win a copy of liveProject: Protecting User Data with Spring Security and OAuth2 this week in the Spring forum!

harbeer kadian

Greenhorn
+ Follow
since Jul 07, 2009
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 harbeer kadian

Hi,

I got following problem when parsing wsdl using WOM and XSOM api.
I have used apache CXF stack to generate the wsdl file.

The schemas in the wsdl are defined in following way



The special thing here is that the first schema defined in wsdl:types is importing
xsd which is just defined below it.
As the imported xsd is inlined, hence there is no schemaLocation attribute defined
for it.
The XSOM parser calls the NGCCRunTimeEx.importSchema() method.
This in turn uses the schemaLocation attribute.
As schemaLocation is null, it is not able to find the InputSource for this inline xsd.
and hence it gives error saying "not able to find ns1:abcCType"

Please provide information to tackle this issue.

With Regards
Harbeer Kadian
Thanks paul

I got the solution.
I passed the url of the file and now this api is able to find out imported documents.
Thanks a lot, you saved my day
The above code does not give any problem if the wsdl parsed in the code is not importing any other xsd or wsdl file.
Hi,

I tried to use the org.jvnet.wom api to parse a wsdl.
Here is the snippet of code i used

String tempLocation = "D:/harbeer/Documents/HWE-Connect/TeamCener_WebService/ExportDataFromPDMService.wsdl";
WOMParser womParser = new WOMParser();
womParser.parse(new FileReader(new File(tempLocation)));
WSDLSet wsdlSet = womParser.getResult();
System.out.println("WSDLSet -> "+wsdlSet);

The application is getting a null instance of WSDLSet.

The wsdl used here is importing an xsd, where the input and output message structure is defined.


With Regards
Harbeer Kadian
Hi,
I used the XSOM api to parse a xsd file.
When my xsd file was not importing any other xsd file, code was working fine
Snippet of code
XSOMParser xsomParser = new XSOMParser();
xsomParser.parse(reader);
XSSchemaSet xsSchemaSet = xsomParser.getResult();
XSSchema xsSchema = xsSchemaSet.getSchema(targetNamespace); //targetNamespace attribute //specified in the xsd file

When i used the same snippet of code for a xsd file which is importing other xsd files, i got null pointer exception.
The instance of XSSchemaSet is setting to null.

Please reply, if you have any idea about it.

With Regards
Harbeer kadian
This will be some thing like this:

The client will invoke an operation on the server web service (Some thing like getInuputMessageStructureForOperation()).
The client will pass the name of wsdl with which he wants to communicate.
The server web service here is acting as a transportation layer, which intercepts client soap messages, and after reading the
information inside soap message, create another soap message and parses the appropriate wsdl file to know what is the valid
input xml structure required to invoke an operation.
In my case Apache ServiceMix Enterprise Service Bus is acting as the server web service.
The other web service may exist on a tom cat server.

The ServiceMix has the wsdl to talk to the webservice existing on the tom cat server.
Now I am thinking some thing like this, tell me if it has flaws
The serviceMix will parse the wsdl, when the client will invoke the method getInuputMessageStructureForOperation() in which client
will pass the name of operation and the name of wsdl.

Now I have to parse the wsdl and have to send the input message structure(which is defined as xsd) back to the client.
For ex:

<schema elementFormDefault="qualified" targetNamespace="http://tutorial.com" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="sayHello">
<complexType>
<sequence>
<element name="name" type="xsd:string"/>
</sequence>
</complexType>
</element>
</schema>
<wsdl:message name="sayHelloRequest">
<wsdl:part element="impl:sayHello" name="parameters"/>
</wsdl:message
<wsdl:operation name="sayHello">
<wsdl:input message="impl:sayHelloRequest" name="sayHelloRequest"/>
<wsdl:output message="impl:sayHelloResponse" name="sayHelloResponse"/>
</wsdl:operation>

So that next time when he want to invoke that operation, he can use the xsd input message structure to create valid xml.

As the server web service is independent of the webservice residing on tom cat.
Hence I thought that I will pass the soap message required for tom cat inside a xml tag defined for server web service.
Some thing like content tag.
So that at server web service, i will invoke getContent() method which will give me an xml.
Change the xml to a soap message and communicate it to the web service on tom cat.

As i have never done this type of programming, hence I have no clue regarding how to send the xsd structure back to the client.
Please help.
Hi,

I have got a requirement, where a client has to send a XML inside another xml tag to a web service.
For ex:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tut="http://tutorial.com">
<soapenv:Header/>
<soapenv:Body>
<tut:sayHello>
<tut:name>
<![CDATA[
<Details>
<FirstName>Harbeer</FirstName>
<LastName>Kadian</LastName>
<Details>
]]>
</tut:name>
</tut:sayHello>
</soapenv:Body>
</soapenv:Envelope>

The information inside CDATA will be used to create another soap message. The server will create the another soap message and will use it to invoke another
web service which may exist on some other server.

The problem here is that the xsd for xml given in CDATA is not known to the client.
Now I need my server to pass this information to the client. The server has the required xsd for the xml inside CDATA.
The communication between client and server is through java web service.

Please tell how we can pass this information to the client.

With Regards
Harbeer kadian
Hi,

I created one webservice in the OSGI format and installed it in the servicemix.
The webservice worked fine and i was able to send and receive requests through SoapUI software.

I tried to add some apache camel code inside this so that i can send a string to a file.

The implementation is as follows
This is my webservice implementation class.



Please help if i am missing some thing.

With Regards
Harbeer Kadian
Hi all,

I downloaded binary version of Service Mix version 4.0.0 from apache website.
I am able to start the servicemix successfully.

I tried to install certain service assemblies as guided by the following link.
http://servicemix.apache.org/kernel/1-quick-start.html

Here under Deploy a sample application heading, certain maven commands are given to install the service assemblies.
When i ran these commands, i got following exception.

smx@root:/> osgi/install -s mvn:org.apache.geronimo.specs/geronimo-activation_1.
1_spec/1.0.2
java.lang.RuntimeException: URL [mvn:org.apache.geronimo.specs/geronimo-activati
on_1.1_spec/1.0.2] could not be resolved. (enable TRACE logging for details)

smx@root:/>

Please reply if any one knows how to debug this problem.

With Regards
Harbeer Kadian

Hi all,

I created a Service assembly to poll a file in a particular directory and send it to some other directory
The content of xbean.xml file is as follows

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xbean.org/schemas/spring/1.0"
xmlns:file="http://servicemix.apache.org/file/1.0"
xmlns:esb="http://opensourceesb/XmlConvertor/">

<file:poller service="esb:filePoller"
endpoint="simpleToJmsPoller"
targetService="esb:fileSender"
targetEndPoint="simpleFromJMSSender"
file="file:///D:/harbeer/EsbInAction/workspace/workspace-servicemix/servicemix/resources/chapter3/in"
period="10000">


</file:poller>

<file:sender service="esb:fileSender"
endpoint="simpleFromJMSSender"
directory="file:///D:/harbeer/EsbInAction/workspace/workspace-servicemix/servicemix/resources/chapter3/out">


</file:sender>

</beans>

When I am adding this service assembly in the hotdeploy directory of servicemix, i am getting following exception.

java.io.IOException: Cannot build parent directory: D:\harbeer\EsbInAction\esb\a

pache-servicemix-3.2.1\data\smx\service-assemblies\

XmlConvertor



at org.apache.servicemix.jbi.util.FileVersionUtil.getNewVersionDirectory

(FileVersionUtil.java:119)

at org.apache.servicemix.jbi.container.EnvironmentContext.getNewServiceA

ssemblyEnvironment(EnvironmentContext.java:329)

at org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAs

sembly(DeploymentService.java:458)

at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServi

ceAssembly(AutoDeploymentService.java:350)

at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchi

ve(AutoDeploymentService.java:253)

at org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDire

ctory(AutoDeploymentService.java:647)

at org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(

AutoDeploymentService.java:60)

at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoD

eploymentService.java:611)

at java.util.TimerThread.mainLoop(Timer.java:512)

at java.util.TimerThread.run(Timer.java:462)

WARN - AutoDeploymentService - Directory: hotdeploy: Automatic install

of D:\harbeer\EsbInAction\esb\apache-servicemix-3.2.1\hotdeploy\XmlConvertor-sa

.zip failed

javax.jbi.management.DeploymentException: Failed to update Service Assembly:

XmlConvertor



at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServi

ceAssembly(AutoDeploymentService.java:365)

at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchi

ve(AutoDeploymentService.java:253)

at org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDire

ctory(AutoDeploymentService.java:647)

at org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(

AutoDeploymentService.java:60)

at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoD

eploymentService.java:611)

at java.util.TimerThread.mainLoop(Timer.java:512)

at java.util.TimerThread.run(Timer.java:462)

Caused by: java.io.IOException: Cannot build parent directory: D:\harbeer\EsbInA

ction\esb\apache-servicemix-3.2.1\data\smx\service-assemblies\

XmlConvertor



at org.apache.servicemix.jbi.util.FileVersionUtil.getNewVersionDirectory

(FileVersionUtil.java:119)

at org.apache.servicemix.jbi.container.EnvironmentContext.getNewServiceA

ssemblyEnvironment(EnvironmentContext.java:329)

at org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAs

sembly(DeploymentService.java:458)

at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServi

ceAssembly(AutoDeploymentService.java:350)

... 6 more


If any one has previously worked on Service Mix, please help me out.

With Regards
Harbeer Kadian

I have a JTable. The JTable has cells inside it.
If i double click on the cell(makes it editable cell) and presses tab key, the key listener is not notifying about the tab key, but the control goes to the next row.

Please give some information regarding it
11 years ago
Hi,

I am writing a Stateless Session bean.
I created a JAR file having following contents.

ejb.ejbHello.Hello.class
ejb.ejbHello.HelloHome.class
ejb.ejbHello.HelloBean.class
META-INF.ejb-jar.xml
META-INF.jboss.xml

Content of xml files are as follows

ejb-jar.xml


<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0 //EN" " http://java.sun.com/dtd/ejb-jar_2_0.dtd">

<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>Hello</ejb-name>
<home>ejb.ejbHello.HelloHome</home>
<remote>ejb.ejbHello.Hello</remote>
<ejb-class>ejb.ejbHello.HelloBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>




jboss.xml

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN"
"http://www.jboss.org/j2ee/dtd/jboss.dtd">
<jboss>
<enterprise-beans>
<session>
<ejb-name>Hello</ejb-name>
<jndi-name>HelloHome</jndi-name>
</session>
</enterprise-beans>
</jboss>


I kept the above mentioned jar in following location
C:\jboss-3.2.8.SP1\server\default\deploy

After this i started the JBoss Server.
The JBoss Server is not able to deploy the above mentioned jar and is displaying following error in JBoss console




12:37:08,828 INFO [JmsXA] Bound connection factory for resource adapter for Con
nectionManager 'jboss.jca:service=TxCM,name=JmsXA to JNDI name 'java:/JmsXA'
12:37:10,171 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-3.
2.8.SP1/server/default/deploy/HelloWorld.jar
org.jboss.deployment.DeploymentException: Connection refused: connect; - nested
throwable: (java.net.ConnectException: Connection refused: connect)
at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:331)
at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:262)
at org.jboss.metadata.XmlFileLoader.getDocumentFromURL(XmlFileLoader.jav
a:234)
at org.jboss.metadata.XmlFileLoader.load(XmlFileLoader.java:152)
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:476)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:795)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:652)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:616)
at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
java:74)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:76)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:68)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:96)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:213)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:184)
at $Proxy7.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
tScanner.java:316)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
canner.java:490)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
doScan(AbstractDeploymentScanner.java:213)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
bstractDeploymentScanner.java:286)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
upport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
eanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
java:74)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:76)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:68)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:96)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:213)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
ler.java:968)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:404)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
java:74)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:76)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:68)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:96)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:213)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:184)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:263)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:841)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:653)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:616)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:600)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.
java:74)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:76)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:68)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:96)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:213)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:484)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:184)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:462)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:353)
at org.jboss.Main.boot(Main.java:201)
at org.jboss.Main$1.run(Main.java:459)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.Socket.connect(Socket.java:516)
at java.net.Socket.connect(Socket.java:466)
at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
at sun.net.www.http.HttpClient.New(HttpClient.java:287)
at sun.net.www.http.HttpClient.New(HttpClient.java:299)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLC
onnection.java:796)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne
ction.java:748)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection
.java:673)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:917)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown So
urce)
at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source
)
at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Sourc
e)
at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(
Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
known Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:308)
... 69 more



Please help me if any one knows about this problem


With Regards
Harbeer Kadian