Soap and Applets? Is it possible?

Is it possible to use SOAP in a java applet, without having a massive
JAR file that the user is required to download? With my current applet,
I keep on getting the following exception:
java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException
What I'm trying to do is have an applet that gets downloaded to the
client that gets some page info via SOAP from a .Net web service with
a SQLserver database. Any ideas? Is this possible? It should be, as
it SHOULD be just XML over the wire. Or should I try something other
than SAAJ?
This is my current applet. Anyone see any bugs that would prevent
this from running as an applet?
import javax.swing.*;
import java.awt.*;
import javax.xml.soap.*;
import java.net.URL;
import java.util.Enumeration;
import java.util.Iterator;
public class BApplet extends JApplet
     private String heightStr;
     private String widthStr;
     private String pageNameStr;
     private JTextArea tArea;
     public void init()
          heightStr = getParameter( "height" );
          widthStr = getParameter( "width" );
          pageNameStr = getParameter( "pageName" );
          tArea = new JTextArea();
          tArea.append("testing\n testing\n testing" );
          JScrollPane sPane = new JScrollPane( tArea );
          Container cp = getContentPane();
          cp.add( sPane );
          try
          SOAPConnectionFactory scFactory =     
          SOAPConnectionFactory.newInstance();     
          SOAPConnection con = scFactory.createConnection();
          MessageFactory factory = MessageFactory.newInstance();     
          SOAPMessage message = factory.createMessage();
          SOAPPart soapPart = message.getSOAPPart();
          SOAPEnvelope envelope = soapPart.getEnvelope();
          SOAPBody body = envelope.getBody();
          Name bodyName = envelope.createName( "getPageData", "PageData",
                     "http://www.blah.com/BService");
          SOAPBodyElement bodyElem = body.addBodyElement( bodyName );
          Name name = envelope.createName("pageName");
          SOAPElement symbol = bodyElem.addChildElement(name);
          symbol.addTextNode("Home");
          URL endpoint =
               new URL( "http://www.blah.com/BService");
          SOAPMessage response = con.call(message, endpoint);
          con.close();
          SOAPPart sp = response.getSOAPPart();
          SOAPEnvelope se = sp.getEnvelope();
          SOAPBody sb = se.getBody();
          Iterator it = sb.getChildElements(bodyName);
          SOAPBodyElement bodyElement = (SOAPBodyElement)it.next();
          String lastPrice = bodyElement.getValue();
          tArea.append(lastPrice);
          catch( java.net.MalformedURLException mEx )
               tArea.append( mEx.getLocalizedMessage());
          catch( javax.xml.soap.SOAPException sEx )
               tArea.append( sEx.getLocalizedMessage());
the html file is as follows:
<html>
<head>
</head>
<body>
     <applet code="BApplet" width="310" height="310">
     <param name="pageName" value="home">
     </applet>
</body>

Consider this article (Applet to Servlet communication) hope this will help to solve Applet to SOAP communication problem.
Applet File (TestApplet.java )
import java.applet.*;
import java.net.*;
import java.io.*;
import java.awt.*;
public class TestApplet extends Applet{
private String line;
public void init () {
try {
URL url = new URL(
     "http://127.0.0.1/servlets/test?name=TestApplet");
BufferedReader in = new BufferedReader(
     new InputStreamReader(url.openStream()));
line = in.readLine();
in.close();
}catch (Exception e){
e.printStackTrace();
public void paint (Graphics g) {
g.drawString (line, 20, 40);
Servlet (TestServlet.java)
import java.io.*;
import java.util.*;
import javax.servlet.http.*;
import javax.servlet.*;
public class TestServlet extends HttpServlet {
public void doGet(HttpServletRequest req,
          HttpServletResponse res)
          throws ServletException, IOException{
res.setContentType ("text/plain");
PrintWriter out = res.getWriter();
out.println ("Hello " +
          req.getParameter("name") +
          ", servlet talking!");
out.close();
(web.xml)
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>
test
</servlet-name>
<servlet-class>
TestServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>test</servlet-name>
<url-pattern>/servlets/test</url-pattern>
</servlet-mapping>
</web-app>
for a full expalnation pls go to http://java.sun.com/developer/qow/archive/53/index.html

Similar Messages

  • Is in PI7.1 possible asynchronous communication between SOAP and ABAPProxy?

    Hi,
    when method execute_asynchronous has disapeared since XI/PI 7.1, is
    there still way how to use ABAP proxy in asynchronous way?
    We need to build asynchronous connection SOAP->PI->ABAP_Proxy.
    In PI, both interfaces are defined as asynchronous (outbound for SOAP and
    inbound for ABAP Proxy).
    Despite of this fact, when message is sent, it is processed
    synchronous way.
    I have set breakpoint in my implementation of method for ABAP Proxy
    message processing. When message is sent and breakpoint is reached,
    whole connection stays open (between SOAP and PI and between PI and
    ABAP Proxy) and waits for processing method (the breakpointed one) to
    return. Only when processing method returns, is connection finelly
    closed.
    If i understand it correctly, this is synchronous behavior. In
    asynchronous behavior, as i understand it, should be connection
    between PI and ABAP Proxy of application server closed immediately
    after message has been delivered. This mean before my processing
    method is even called.
    The same could be said about SOAP and PI communication. Connection
    should be closed immediately after PI has received message. From
    definition of asynchronous communication of PI is obvious, that PI
    should receive message correctly and close connection to sender system
    even when receiver is unreachable. It should deliver message later
    when, receiver system is back on line. So why it keeps connection to
    sender system open while it waits for receiver?
    Why is this happening, when both interfaces are defined as
    asynchronous? Could be the reason for this, if APPLICATION
    ACKNOWLEDGEMENT is set on by default? If so, how can i change it
    to SYSTEM ACKNOWLEDGEMENT, or disable it at all?
    Or is this kind of asynchronous communication even possible since
    XI/PI 7.1 ?
    Processing of message we are sending can take some time, so we dont
    want connection pending open while waiting for finish of
    processing. Thats the reason why we have chose asynchronous model to
    use.

    Quote from How to Use the J2EE SOAP Adapter:
    "If you select Best Effort, the Web service client will receive a response
    message in the SOAP body. Otherwise, the Web service client will not receive a
    response message if no error occurs."
    "if no error occurs" - that is the problem. In either case he still
    waits if some error occure or not. I dont want it. Once PI has
    received message, I want the connection with sender to be closed. If
    there will be error in communication between PI and reciever, I want
    to see it only in PI log. That mean no notification to sender to be
    send about that error.
    Is that possible?

  • Is it possible to run a website built in Java and applet from Safari browser in iPad

    Is it possible to run a website built in Java and applet from Safari browser in iPad?

    Java isn't supported on the iPad

  • I am currently running a trial version of indesign. i am trying to make a cd booklet. when i open a new document and try to find 'compact disc' in the document presets, it isn't there. all i have for options are 'default and custom'. is it possible to ope

    i am currently running a trial version of indesign. i am trying to make a cd booklet. when i open a new document and try to find 'compact disc' in the document presets, it isn't there. all i have for options are 'default and custom'. is it possible to open the 'compact disc' preset from a trial version?

    Are you sure, Eugene? I have this option:

  • HT204053 I have 4 iphones on the same Apple ID, but would like 4 different accounts and iCloud is this possible?

    I have 4 iphones on the same Apple ID, but would like 4 different accounts and iCloud is this possible?

    Create a new Apple ID for the one you want to change.

  • I need help authenticating my outgoing server settings in setting up my work email on my Galaxy S5.  It says unable to authenticate or connect to server and I even called helpdesk at my email support and they tried every possible port (80, 25, 3535 or 465

    I need help authenticating my outgoing server settings in setting up my work email on my Galaxy S5.  It says unable to authenticate or connect to server and I even called helpdesk at my email support and they tried every possible port (80, 25, 3535 or 465 SSL) and none of them work. Please help!

    You will need to get the required info to create/access the account with an email client from your school.
    Are you currently accessing the account with an email client on your computer - if you have a Mac with the Mail.app, or if you have a PC with Outlook Express, etc.? If so, you can get the required account settings there.

  • Https for SOAP and HTTP Receiver adapters in PI 7.1

    Hi,
    We need HTTPS Transport protocol is required to send the message to receiver systems.
    Currently we are using below procedures for https:
    1)     HTTP with SSL (= HTTPS) without client authentication
    2)      HTTP with SSL (= HTTPS) with client authentication
    But client donu2019t want this procedure.
    Here my question is How to enable the https Transport protocol in SOAP and HTTP Receiver adapters.

    >>Here my question is How to enable the https Transport protocol in SOAP and HTTP Receiver adapters.
    What I see is your client wants PI to send communication via HTTPS transport protocol. That means you have to apply for trusted certificate and import that certificate root node in Netweaver keystore.
    Then change the transport protocol from http to https in soap and http receiver communication channel and communicate to client via certificate authentication.
    Plenty of documents available in sdn about https certificate authentication. Please go through those links.
    check this thread.. might be helpful
    Client Certificate for PI authentication when Web Dispatcher terminates SSL

  • File to SOAP and SOAP to File (Synchronous)

    Hi,
    Can anybody advice me how to do the File to SOAP and SOAP to File with Synchronous call.
    Thanks,
    Naidu.

    Hi,
    Use this blog
    RFC -> XI -> WebService - A Complete Walkthrough (Part 1)
    and create an inbound synchronous interface for soap receiver structure. provide request and response structure in it.
    Thanks!

  • I would like to delete emails on my PC when I delete them on my Ipad (and vice versa, if possible).  How do I set this up?  Thanks.

    I would like to delete emails from my PC when I delete them from my Ipad (and vice versa, is possible).  How do I set this up?  Thanks in advance.

    The ability to do that would depend on the type of email account that you have. If it is a POP account, it cannot be done. If it is an IMAP account, it should sync across devices automatically. If you are not sure what type of account it is, who is your email provider?

  • JDev3.0's JSP and Applet works on NT but doesn't work on Win98, why?

    JDeveloper3.0 works fine on WindowNT machine when I run JSP files and Applet, but at home the JDeveloper3.0 cannot trigger the browser to display the result on my Windows98 machine when I run the JSP files or Applet. Why? How can I make it works for me at home. Other tools, such as J++6.0 and JBuilder work with Applet on the same machine. Who can help me?

    James,
    The JDeveloper 3.0 design time environment is not supported on Windows98. Some functions might work under Win98 but they are not supported.
    Sorry!
    Regards,
    Arun

  • Regarding communication between JSF and applet.

    Hi all,
    I have to send a array of int value from JSF to the applet method and vice versa,
    so how can I do that?
    Is there any straight forward way is there?
    Or I need to use javascript in between applet and JSF for communicating.
    If this is case can give some links so that I can go through it.
    What I need is, I have jsf table(grid) when I select a row from table, for the selected row I have to display selected row ID in applet and vice versa.
    Any suggestion or links will be appreciated, thanks in advance.
    Thanks
    daya

    thanks and sorry for late reply, let me go through the link,
    i have tried with JavaScript, i got stuck, i need to call a JavaScript method for JSF component event listener. I searched in Google but no help regarding same.
    Actually what I need is, I have JSF Component i.e. GridView(Table) and applet in a page. And for each row selection in GridView(table) I need to call a javascript method (with column value), and vice versa.
    Can you give suggestion or any link so that can proceed further.
    and i am able to communicate between applet which are included in the page
    Thanks
    Daya

  • RFC- XI -SOAP and response back to RFC

    Hi,
    I am doing RFC-XI-SOAP and get response back from SOAP to RFC.
    if I am not check the "Do Not Use SOAP Envelop" then it gives error in SXMB_MONI says  - NO SOAP envelop.
    "No SOAP Envelope but 1 {}RESPONSES; HTTP 200 OK"
    if I check thet  check bos ""Do Not Use SOAP Envelop" then it gives no error in SXMB_MONI , but message is not giving response back from webservice in SXMB_MONI it shows only
    <?xml version="1.0" encoding="UTF-8" ?>
      <ns1:MYRFC.Response xmlns:ns1="urn:sap-com:document:sap:rfc:functions" />
    gurus ...Pl. reply asap

    hi, all
    you are right the XML sp/tcpgateway response structure is different than what I used earlier,
    now I build the same structure,but then also some problem occures it is giving only one element from structure in response.
    it is giving
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:MYRFC.Response xmlns:ns1="urn:sap-com:document:sap:rfc:functions">
      <STATUS>Success</STATUS>
      </ns1:MYRFC.Response>
    while actual inbound from WS is ...
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Inbound Message   -->
    - <ns0:testrequestResponse xmlns:ns0="conversion" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" Status="Success" DbgCmd_="testrequest" DbgTag_="REQUEST">
    - <ns0:SAP_OUTPUT>
      <ns0:E1 Value="3000194" />
      <ns0:E2 Value="300"/>
      <ns0:E3  Value="3"/>
      </ns0:E4 Value="94">
      </ns0:testrequestResponse>

  • How do I resize the window of pages in the new version? It takes up most of my desktop. I would like to make it tall and narrow, which was possible in the old pages, but I cannot seem to do it in the new version.

    How do I resize the window of pages in the new version? It takes up most of my desktop. I would like to make it tall and narrow, which was possible in the old pages, but I cannot seem to do it in the new version.

    I agree it is a very bad and wasteful design especially for users on small laptop screens.
    You can drag it to whatever shape you want from the bottom left corner.
    Click on the paintbrush to make the Format side panel disappear. However you will need to use that side panel for most formatting.
    Peter

  • I have a problem choosing artist from my artist list when I will put music on my iPad from my iMac. I can only see the 25 first artis and it is not possible to scroll down the list

    have a problem choosing artist from my artist list when I will put music on my iPad from my iMac. I can only see the 25 first artis and it is not possible to scroll down the list

    Hi stig68,
    If you are having grouping issues with compilation albums in iTunes, you may find the following article helpful:
    Apple Support: Why aren't songs with the same album art grouped together?
    http://support.apple.com/kb/TS1468
    Regards,
    - Brenden

  • Adf faces table and applet in jsf page navSubmit not working in IE

    Hi
    I have a jsf page with adf faces table and applet , previous / next navigation is not working for my table when i add the applet to the same page , it is working in firefox but not in IE .
    I have no clue what to change , can any one help. below is the sample code for my jsf page
    Best regards
    Srinivas
    Code follows, not sure how to format the code here
    <h:form>
    <af:panelPage title="Test Adf faces table and applet">
    <af:panelHeader text="Orders">
    <af:table value="#{bindings.Orders.collectionModel}" var="row"
    rows="#{bindings.Orders.rangeSize}"
    first="#{bindings.Orders.rangeStart}"
    emptyText="#{bindings.Orders.viewable ? 'No rows yet.' : 'Access Denied.'}"
    id="orders" >
    <af:column sortProperty="order"
    headerText="#{bindings.Orders.labels.order}">
    <af:commandLink text="#{row.order}"
    id="orderNumber"
    onclick="showOrder(#{row.order})"
    disabled="false"/>
    </af:column>
                   </af:table>
    </af:panelHeader>
    <af:objectSpacer width="10" height="10"/>
    <af:panelBox>
    <f:verbatim>
    <div id="appletDiv">
                        <applet here />
                        </div>
    </f:verbatim>
    </af:panelBox>
    </af:panelHorizontal>
    </af:panelPage>
    </h:form>

    Sorry about the format, it looked okay when i previewed it , now it looks like terrible

Maybe you are looking for

  • I have to have my external hard drive on to listen to songs , how do I transfer the songs?

    All the songs appear in my library, but I have to have the external hardrive on to listen, I have a WD external.

  • Error in using XI-SOAP adapter, but no error  with SAP-BC

    Hi, I am working on RFC->XI->Webmethod (.asp) scenatio. I am using SOAP adapter. Whin I am not using "Do not use SOAP Envelop". I am getting "com.sap.aii.af.ra.ms.api.DeliveryException: invalid content type for SOAP: TEXT/HTML" Error in SXMB_MONI. Bu

  • WLC, Bonjour, Airprint in diffrent SSID

    Hi, I have two wlc 5508 version 7.5.102.0. one foreign and one anchor. the APs are connectet to the foreign wlc.foreign wlc has a tunnel to anchor wlc. On Anchor, I creat the SSIDs and there are breakout to internet. I use an apple iPad and HP MFP 27

  • How data is reflectng to dashoard..........

    Hi, I am new to xcelsius dashboard doing..... I  am using the normal excel as a data source and prepared the dashboard.......... after the SWF was done. now i am changing my data  in excel and added new rows. how it will be reflect to  dashboard.....

  • Firmware upgrade on Zen Sl

    I would like to install the new firmware on my Zen Sleek to upgrade to <SPAN>2.0.03. <SPAN>Unfortunately, both the skinny paper manual, and the more detailed CD-ROM manual don't explain how to do this. <SPAN>I did try to reset the Sleek by pushing a