3 Replies Latest reply on Dec 1, 2014 2:31 AM by Niyaz Ahmad Imam

    SOAP based JAVA Object in CF


      I am currently developing a JAVA based object to be accessed using <cfobject>. The Java object is using the RPC web service based on Java WSDP 2.0. The class that the cfobject is creating can function properly when it is executed as a standalone object through a Java based application but as an object in Cold Fusion it gives errors. I have placed all the appropriate libraries in the correct folder, "...wwwroot\WEB-INF\lib".

      When my page attempts to access the method in the object that performs an RPC call then it throws the following error:

      Couldn't create SOAP message factory due to exception: javax.xml.soap.SOAPException: Unable to create message factory for SOAP: org.apache.axis.soap.MessageFactoryImpl; nested exception is:
      Couldn't create SOAP message factory due to exception: javax.xml.soap.SOAPException: Unable to create message factory for SOAP: org.apache.axis.soap.MessageFactoryImpl

      Can anyone give me some input as to what this error means and if anyone has seen it before in a ColdFusion environment (specifically using JWSDP)? If you need the code then i'll post it but i have to censor out some static info. Just need some leads for now...

      Thank you!
        • 1. Re: SOAP based JAVA Object in CF
          <newbie /> Level 1

          From the errors you are describing, it looks like CFMX uses apache axis but
          your program uses JWSDP which does not use apache axis.

          I'm not sure if these engines are interchangeable?

          However, I have to imagine that the API's are very close and may only require
          minor tweaking.

          Perhaps you should download apache axis and develop your java program
          based on that?

          Good luck!
          • 2. Re: SOAP based JAVA Object in CF
            ITA-GeNo Level 1
            Thanx for the reply! I'm going recode the class file to see if I can use Apache Axis' libraries in place of the JWSDP libraries for the SOAP requests and hopefully CF will be agreeable with that. It's just that part of the class uses libraries from Novell who's SOAP requests were tailored for JWSDP hence the errors but I'll see if I can get them to work together.

            Otherwise I'll see if I can get away with the orginal class working under a J2EE/CF environment and treat it like a bean. I'll repost if it works with a better description of the code and stuff so that anybody else with the same/similar error/situation can give it a try. Searching the net with regards to this problem didn't reap much information for me.

            Thanks again for the tip and i'll let you know!!
            • 3. Re: SOAP based JAVA Object in CF
              Niyaz Ahmad Imam Level 1

              Dear All Technology Expert's,

              I have a query related to Coldfusion SOAP services, that is most commonly asked in all the forum's but NONE of them has got answer.

              If there is NO solution so I think Adobe has to come up with some patches so developer can able to do some customization.

              I like to share with you all, in all other language ( PHP, JAVA, .NET etc) this option is available and you can customize the error.



              Ok let me again explain the very basic error:



              SOAP Request:



              <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">








              SOAP Response:

                <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">




                       <faultstring>java.lang.Exception: Body not found.</faultstring>


                          <ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">java.lang.Exception: Body not found.

                at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:121)...</ns1:s tackTrace>

                          <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">Coldfusion Error</ns2:hostname>







              HOW we can customize the error, in all other languages you can simple customize the error like



              Other languages SOAP response:

                <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">




                       <faultstring>Body is missing in your request</faultstring>







              But the same is NOT possible in Coldfusion, right?



              AS you know it is vulnerability to display exception messages in the response.

              We are developing this web service to access  from other language website (PHP, .NET).



              We are also planning to upgrade server the Coldfusion 11, but do you think there is any solution with latest Coldfusion version.



              Please response only if you know about these issue's or solution.