how to refer xsd file in registry in wsdl - wso2

I wish to r=read a xsd file available in registry in my WSDL (this is also in registry)
<xsd:schema targetNamespace="http://www.example.org/SearchMember/">
<xsd:import namespace="http://www.memsrch.com/req"
schemaLocation="**./MemberSearchReq.xsd**" />
<xsd:import namespace="http://www.memsrch.com/resp"
schemaLocation="**./MemberSearchRep.xsd**" />
</xsd:schema>
This is erroring as shown below
Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema): faultCode=PARSER_ERROR: Problem parsing './MemberSearchRep.xsd'.: java.io.FileNotFoundException: C:\wso2esb-4.0.3\wso2esb-4.0.3\MemberSearchRep.xsd (The system cannot find the file specified)
at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2166)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:845)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(WSDLReaderImpl.java:669)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(WSDLReaderImpl.java:630)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:342)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2320)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2284)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2337)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2358)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2390)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.readInTheWSDLFile(WSDL11ToAxisServiceBuilder.java:2318)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.setup(WSDL11ToAxisServiceBuilder.java:922)
at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:309)
... 22 more
Caused by: java.io.FileNotFoundException: C:\wso2esb-4.0.3\wso2esb-4.0.3\MemberSearchRep.xsd (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:120)
at java.io.FileInputStream.(FileInputStream.java:79)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown 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 com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2156)
... 34 more

I'm not sure if you solved this, if not please refer to this blog post how to setup wsdl's in the registry that import XSD's: http://madhukaudantha.blogspot.nl/2012/07/wso2-esb-proxy-from-registry.html.
Regards, nidkil

Try removing the "./" and make sure the XSD is in the same resource collection in the registry as the WSDL. The name of the resource should be the same as the name used in schemaLocation.
One note of caution, ensure you do not nest XSD's as this is currently not supported by the registry.
Regard, nidkil

Related

Caused by: org.apache.cxf.binding.soap.SoapFault: [ISS.0088.9166] Binder not found for soapAction

Good day,
My java application need to call a third party web service by using soap call.
As per usual, the third party give me the wsdl files and I generate client code base on the those wsdl files.
so far all of the call is success, except 1. This one I am hitting the error as folow:
Caused by: java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.host.JaxwsPortCachingProxyBuilder$JaxwsInvocationHandler.invoke(JaxwsPortCachingProxyBuilder.java:224)
... 33 common frames omitted
Caused by: javax.xml.ws.soap.SOAPFaultException: [ISS.0088.9166] Binder not found for soapAction = RACER_SOAP_webservices_mySvc_Binder_correction
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:161)
at com.sun.proxy.$Proxy99.myservice(Unknown Source)
... 38 common frames omitted
Caused by: org.apache.cxf.binding.soap.SoapFault: [ISS.0088.9166] Binder not found for soapAction = RACER_SOAP_webservices_mySvc_Binder_correction
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:86)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:52)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:41)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:112)
at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:140)
at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInterceptor.handleMessage(SOAPHandlerInterceptor.java:71)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:801)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1672)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1551)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1348)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:651)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)
... 39 common frames omitted
However, if I am using SoapUI tool to fire the request, then its working fine. I tried check with the third party but they didnt found anything wrong in their site.
And I tried to google on this, also cant get any matching result.
Anyone can advise what is happening? May I know is this means third party there need some changes? If yes, may I know what I should tell the third party?

Getting ClassNotFoundException: org.eclipse.jetty.server.Server

I'm using the class "org.eclipse.jetty.server.Server" in XML file to intialize it with various parameters(Please note this is an OSGi environment). However my bundle which is using the class "org.eclipse.jetty.server.Server" is not starting and throwing the following exception:
java.lang.ClassNotFoundException: org.eclipse.jetty.server.Server
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.core.runtime.internal.adaptor.ContextFinder.loadClass(ContextFinder.java:129)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.jetty.util.Loader.loadClass(Loader.java:92)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.nodeClass(XmlConfiguration.java:349)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:327)
I've made sure that the jetty server bundle is up and running and also I've made sure that I've given proper version in the "Imported-Packages" section of my manifest file. Please help.
If you want to use Jetty in the way that
Jetty is initialized based on XML configuration
It is used within an OSGi environment
I recommend that you should use jetty-osgi-boot bundle. You can find more information about its usage in the documentation of Jetty.
In case you want to develop a custom solution based on jetty-xml, you should check how jetty-boot does it.
Some tips:
The configuration is read from the XML file in the end of ServerInstanceWrapper.configure() function.
That is called from DefaultJettyAtJettyHomeHelper.startJettyAtJettyHome(...)
There you will find the trick that the Thread Context Classloader is overridden until the Server is configured from the XML.
ClassLoader contextCl = Thread.currentThread().getContextClassLoader();
try
{
Thread.currentThread().setContextClassLoader(JettyBootstrapActivator.class.getClassLoader());
...
Server server = ServerInstanceWrapper.configure(null, configURLs, properties);
...
return server;
}
...
finally
{
Thread.currentThread().setContextClassLoader(contextCl);
}
Please note that the links and example is from Jetty 9.2.9 as the code is a bit nicer there, but you can find the same or similar logic in the jetty-osgi-boot of your Jetty version.
It is not a good thing to play around with the Thread Context ClassLoader, but sometimes it is necessary, when code is called that use TCL. The best would be if the XMLConfiguration class of Jetty accepted a ClassLoader as a parameter.

Error when creating Web Service Client Test on Eclipse Luna

I've created a Dynamic Web Project and tried to add a Web Client from a WSDL.
I'm using Eclipse Luna for Java EE and JDK 1.7.
On the final screen for adding a Web Service Client, when I click on Finish I get the following warning messages:
IWAB0182W The Sample JSP client does not support the following type: {0} org.csapi.www.schema.parlayx.cloudmovil.v1_0.NamedParameter[]
IWAB0237W The Sample JSP client does not support arrays: {0}operatorUser
IWAB0189W The Sample JSP client omitted some methods because they contained unsupported types.
And finally I get an error message:
java.lang.NullPointerException
at org.eclipse.jst.ws.internal.consumption.sampleapp.codegen.InputFileAttributeGenerator.visit(InputFileAttributeGenerator.java:57)
at org.eclipse.jst.ws.internal.consumption.codegen.RelVisitor.run(RelVisitor.java:83)
at org.eclipse.jst.ws.internal.consumption.sampleapp.codegen.InputFileTypeGenerator.visit(InputFileTypeGenerator.java:294)
at org.eclipse.jst.ws.internal.consumption.codegen.RelVisitor.run(RelVisitor.java:83)
at org.eclipse.jst.ws.internal.consumption.sampleapp.codegen.InputFileHelp2Generator.visit(InputFileHelp2Generator.java:82)
at org.eclipse.jst.ws.internal.consumption.codegen.RelVisitor.run(RelVisitor.java:83)
at org.eclipse.jst.ws.internal.consumption.sampleapp.codegen.InputFileHelp1Generator.visit(InputFileHelp1Generator.java:78)
at org.eclipse.jst.ws.internal.consumption.codegen.RelVisitor.run(RelVisitor.java:83)
at org.eclipse.jst.ws.internal.consumption.sampleapp.codegen.InputFileGenerator.visit(InputFileGenerator.java:93)
at org.eclipse.jst.ws.internal.consumption.sampleapp.command.GeneratePageCommand.execute(GeneratePageCommand.java:82)
at org.eclipse.jst.ws.internal.consumption.ui.widgets.test.wssample.GSTCGenerateCommand.generatePages(GSTCGenerateCommand.java:144)
at org.eclipse.jst.ws.internal.consumption.ui.widgets.test.wssample.GSTCGenerateCommand.execute(GSTCGenerateCommand.java:71)
at org.eclipse.jst.ws.internal.consumption.ui.widgets.test.ClientTestDelegateCommand.commandFactoryExecution(ClientTestDelegateCommand.java:126)
at org.eclipse.jst.ws.internal.consumption.ui.widgets.test.ClientTestDelegateCommand.execute(ClientTestDelegateCommand.java:99)
at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.runCommand(CommandFragmentEngine.java:419)
at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.visitTop(CommandFragmentEngine.java:359)
at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.moveForwardToNextStop(CommandFragmentEngine.java:254)
at org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager$6.run(SimpleCommandEngineManager.java:294)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:466)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:374)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1059)
at org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager.runForwardToNextStop(SimpleCommandEngineManager.java:264)
at org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager.runForwardToNextStop(WizardPageManager.java:91)
at org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager.performFinish(WizardPageManager.java:262)
at org.eclipse.wst.command.internal.env.ui.widgets.DynamicWizard.performFinish(DynamicWizard.java:382)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:853)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:438)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:619)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:832)
at org.eclipse.jface.window.Window.open(Window.java:808)
at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:269)
at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:290)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:294)
at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247)
at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:149)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:343)
at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:159)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
The WSDL is for a web service that I will have to access through my own endpoints. I was just trying to create a test client to start building my endpoints on top of it. Will these warnings cause me any trouble to access to this web service?
Change Settings of your Eclipse :
To generate the Web service client without errors, you must make the following settings.
1. Choose Window → Preferences → Web Services.
2. Under Axis Emitter specify: Wsdl2Java.
3. Select Prefers Building Beans to Straight Arrays for Wrapped XML Array Types.
If you leave this step out, then two-dimensional arrays are created during generation for the GenericPropertyTable type.

webservice WSDL import error

I need help creating a webservice. Basically the company whom im trying to connect with has provided me with a wsdl and xsd files. But when I try to create the web service using the rad webservice widget I get the error below. please help. If you think I need to explain more just ask me dont down vote please! HELP!
ERROR:
Errors occurred during wsimport.
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.ibm.ast.ws.jaxws.emitter.jdk6.jws22.command.WsImportCommand.execute(Unknown Source)
at com.ibm.ast.ws.jaxws.emitter.command.WsImportCommand.execute(Unknown Source)
at com.ibm.ast.ws.jaxws.creation.command.WsimportNonUIThreadCommand$RunCmdInNonUIThread.run(Unknown Source)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(Unknown Source)
Caused by: java.lang.InternalError: unresolved reference
at com.ibm.jtc.jax.xml.xsom.impl.parser.DelayedRef._get(Unknown Source)
at com.ibm.jtc.jax.xml.xsom.impl.parser.DelayedRef$Type.getType(Unknown Source)
at com.ibm.jtc.jax.xml.xsom.impl.ElementDecl.getType(Unknown Source)
at com.ibm.jtc.jax.xml.xsom.impl.ElementDecl.updateSubstitutabilityMap(Unknown Source)
at com.ibm.jtc.jax.xml.xsom.impl.parser.ParserContext.getResult(Unknown Source)
at com.ibm.jtc.jax.xml.xsom.parser.XSOMParser.getResult(Unknown Source)
at com.ibm.jtc.jax.tools.xjc.ModelLoader.createXSOM(Unknown Source)
at com.ibm.jtc.jax.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(Unknown Source)
at com.ibm.jtc.jax.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(Unknown Source)
at com.ibm.jtc.jax.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(Unknown Source)
at com.ibm.jtc.jax.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(Unknown Source)
at com.ibm.jtc.jax.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(Unknown Source)
at com.ibm.jtc.jax.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(Unknown Source)
at com.ibm.jtc.jax.tools.ws.wscompile.WsimportTool.run(Unknown Source)
at com.ibm.ast.ws.jaxws.emitter.jdk6.jws22.command.WsimportToolWrapper.run(Unknown Source)
... 8 more
Have you tried using Java JAX-WS api for webservice skeleton generation insteed of IBM solution you are using right now? There is even ant task for such generations, and as far as i know i works quite well (I have used such solutions in my previous workplace). Here you have
Oracles documentation describing how to use WSIMPORT tools
or blog post showing simple usage of WSIMPORT
For your needs, I'd look at using Maven (since you're using vanilla JAX-WS) with Metro: http://www.jroller.com/gmazza/entry/web_service_tutorial. Try to stay out of the IDE when creating the JAX-WS artifacts, you'll find most of the headaches are with the IDE rather than the wsimport tool.

Apple Push Notification using Coldfusion

I want to send Push notification using Coldfusion. I couldn't find much help on google. I could find only one article that discusses this topic. But unfortunately I am getting exceptions while following that method. As that method uses a JAR file, I am not able to debug the exception. Even I cannot see the exceptions.
I just want to know is there a simple way to send Push Notifications? Like there is one for Android. In Android you just have to send an http request and you're done. But I can see things are so complicated in case of Apple.
But I am sure that someone would have definitely achieved this. Can anyone please help me on this?
Finally from suggestions, I implemented onError in my Application.cfc and got the following error:
Could not initialize class com.rsa.jcm.c.br
ava.lang.NoClassDefFoundError: Could not initialize class com.rsa.jcm.c.br at
com.rsa.jcm.c.ch.g(Unknown Source) at com.rsa.jcm.c.ch.h(Unknown Source) at
com.rsa.jcm.c.ch.f(Unknown Source) at com.rsa.jcm.c.jt.newSymmetricCipher(Unknown Source) at
com.rsa.cryptoj.o.mu.newSymmetricCipher(Unknown Source) at com.rsa.cryptoj.o.an.d(Unknown Source) at com.rsa.cryptoj.o.li.<init>(Unknown Source) at com.rsa.cryptoj.o.hh.<init>(Unknown Source) at com.rsa.cryptoj.o.gu.<init>(Unknown Source) at com.rsa.cryptoj.o.cc$240.a(Unknown Source) at com.rsa.cryptoj.o.da.a(Unknown Source) at com.rsa.cryptoj.o.da.a(Unknown Source) at
com.rsa.cryptoj.o.gx.b(Unknown Source) at com.rsa.cryptoj.o.gx.a(Unknown Source) at
com.rsa.cryptoj.o.gx.a(Unknown Source) at com.rsa.cryptoj.o.gx.a(Unknown Source) at
com.rsa.cryptoj.o.gx.a(Unknown Source) at com.rsa.cryptoj.o.gx.engineLoad(Unknown Source) at java.security.KeyStore.load(KeyStore.java:1185) at
com.notnoop.apns.internal.Utilities.newSSLContext(Utilities.java:87) at
com.notnoop.apns.ApnsServiceBuilder.withCert(ApnsServiceBuilder.java:139) at
com.notnoop.apns.ApnsServiceBuilder.withCert(ApnsServiceBuilder.java:114) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at
java.lang.reflect.Method.invoke(Method.java:597) at
coldfusion.runtime.StructBean.invoke(StructBean.java:508) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2465) at
Edit:
CF Code:
<cfset APNSService = createObject( "java", "com.notnoop.apns.APNS" ).newService()
.withCert("E:\WEB\mysite.com\login\JAR\DevPushCertificates.p12", "")
.withSandboxDestination()
.build() />
<!--- I get the exception here and the code bellow is not executed --->
<cfset payload = createObject( "java", "com.notnoop.apns.APNS" ).newPayload()
.badge(3)
.alertBody("Hello, world.")
.sound("PushNotification.caf")
.build()/>
<cfset APNSService.push('#deviceToken#', payload) />
I am using this JAR file: https://github.com/notnoop/java-apns/downloads
I got it from this blog: http://www.raymondcamden.com/index.cfm/2010/9/13/Guest-Post-Apple-Push-Notifications-From-ColdFusion-in-Ten-Minutes-or-Less#c843ED990-C791-2A3E-1E9FD9B78ECADFF7
If you post that question at several location please add a link to the other copies of the questions.
Have a look at my answer to your java-apns issue on github.
(Updated with response from link)
This looks like a problem with ColdFusion. In the above stack dump you
see:
com.notnoop.apns.internal.Utilities.newSSLContext(Utilities.java:87)
calls into
java.security.KeyStore.load(KeyStore.java:1185)
which in turn fails after some ruminations in the com.rsa.cryptoj
library. So obviously something doesn't work with accessing the java
key store in ColdFusion.
Googling for one of the classes in the error yields some
interesting results:
Diagnosing a CFHTTP issue - peer not authenticated which
links in turn to
OpenID And ColdFusion which lists some
things you can try (disable Crypto-J in Cold Fusion)
As my server is on shared hosting. So, for every single change, I had to submit a ticket to the hosting site. It was causing headache. Finally, I had the php server setup placed the push notification code (easily available in PHP on google) on PHP server. Then I called that php file from the Coldfusion code. This worked for me.