Home » Developer & Programmer » Forms » SOAPException when calling a webservice in a form (Forms 9i)
SOAPException when calling a webservice in a form [message #358227] Mon, 10 November 2008 03:42 Go to next message
jheronimus
Messages: 11
Registered: March 2007
Location: The Netherlands, Groninge...
Junior Member
Hello,

I'm trying to a Acces a webservices from a form(9i).

With Jdeveloper 9i I created a Web service stub?sketelton for the next URL:
http://www.omegahat.org/SSOAP/examples/CurrencyExchangeService.wsdl.xml

Here is a part of a package that's created by Jdeveloper
      package oracle.forms.demos.webservice;
      import oracle.soap.transport.http.OracleSOAPHTTPConnection;
      import java.net.URL;
      import org.apache.soap.Constants;
      import org.apache.soap.Fault;
      import org.apache.soap.SOAPException;
      import org.apache.soap.rpc.Call;
      import org.apache.soap.rpc.Parameter;
      import org.apache.soap.rpc.Response;
      import java.util.Vector;
      import java.util.Properties;
      /**
       * Generated by the Oracle9i JDeveloper Web Services Stub/Skeleton Generator.
       * Date Created: Mon Nov 10 09:33:25 CET 2008
       * WSDL URL: http://www.omegahat.org/SSOAP/examples/CurrencyExchangeService.wsdl.xml
       * 
       * Returns the exchange rate between the two currencies
       */

      public class CurrencyExchangeServiceStub 
      {
        public String endpoint = "http://services.xmethods.net:80/soap";
        private OracleSOAPHTTPConnection m_httpConnection = null;

        public CurrencyExchangeServiceStub()
        {
          m_httpConnection = new OracleSOAPHTTPConnection();
        }

        public Float getRate(String country1, String country2) throws Exception
        {
          Float returnVal = null;

          URL endpointURL = new URL(endpoint);
          Call call = new Call();
          call.setSOAPTransport(m_httpConnection);
          call.setTargetObjectURI("urn:xmethods-CurrencyExchange");
          call.setMethodName("getRate");


In my form I imported the java class.
The wrote the next routine to trigger the webservice:
   PROCEDURE wbpd 
   IS 
    jo ora_java.jobject;
    rv ora_java.jobject;
    ex ora_java.jobject;
    l_fout varchar2(2000);
   BEGIN
    jo := CurrencyExchangeServiceStub.new;
   --
   --This will get the exchange rate from US Dollars to UK Sterling.
   -- 
    rv := CurrencyExchangeServiceStub.getRate(jo,'USA','GBP');
    message (float_.floatValue(rv));
   EXCEPTION
    WHEN ORA_JAVA.JAVA_ERROR then 
     message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
    WHEN ORA_JAVA.EXCEPTION_THROWN then 
     ex := ORA_JAVA.LAST_EXCEPTION;
     l_fout := Exception_.toString(ex);  
     insert into my_error ( tekst )
     values
     ( l_fout  ); 
     commit;    
   END;

When I run the form excpetion ORA_JAVA.EXCEPTION_THROWN is raised.

The next error is discovered:

[ SOAPException: faultCode=SOAP-ENV:IOException;
msg=services.xmethods.net;
targetException=java.net.UnknownHostException: services.xmethods.net
]

I am behind a firewall.

Does anyone know why I get the error and what to do to solve the problem?

Thanx,
Jeroen de Jong @ OSA it
The Netherlands
Re: SOAPException when calling a webservice in a form [message #358537 is a reply to message #358227] Tue, 11 November 2008 18:33 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Searching this site for 'ORA_JAVA.EXCEPTION_THROWN' returned http://www.orafaq.com/forum/m/246269/67467/?srch=ORA_JAVA.EXCEPTION_THROWN#msg_246269 plus lots of others.

I suggest reading them all and seeing if you code is wildy different to the examples which worked.

Also consider using PM to contact those members who have succeeded in getting their code to work.

David
Previous Topic: what is the sql menu tool ?
Next Topic: How to get temporary internet files path
Goto Forum:
  


Current Time: Mon Dec 05 06:38:30 CST 2016

Total time taken to generate the page: 0.10928 seconds