Wanting to write a SOAP server.

I'm a Java programmer of 8 years experience, worked in J2EE, good knowledge of the usual XML APIs, the HTTP protocol etc, just so we know where we're starting...
I'd like to write a SOAP server to expose certain routines to a Java client. Obviously I'd be writing the client side which would be in a web app.
Now, the server side must be in this 3GL, non-OO proprietary language which my employer is wedded to (Synergy DBL). All the data are in that proprietary language's ISAM files. This is a requirement.
That language has an XML parser, and an HTTP API, so I can read, parse, generate and send XML documents.
Am I right in thinking that I don't need to write a WSDL description of the web service? That is generally used to generate Java sketeon/stub routines is it not?
There exists a proprietary form of exposing certain DBL methods, and the interface is described by an XML document, for example as a proof of concept, I am exposing this method:
<?xml version='1.0'?>
<component name="fclasp" repository="/usr2/fclenv/51A/DATA/SYS/FCLmain.ism" smc="/usr2/fclenv/51A/DATA/SYS/" >
  <structure name="Asp_wt_filters" size="126" >
    <field name="Buyer_name" type="alpha" size="35" />
    <field name="Buyer_ref" type="alpha" size="15" />
    <field name="Supplier_name" type="alpha" size="35" />
    <field name="Supplier_ref" type="alpha" size="15" />
    <field name="Country_code_1" type="alpha" size="2" />
    <field name="Country_code_2" type="alpha" size="2" />
    <field name="Country_code_3" type="alpha" size="2" />
    <field name="Country_code_4" type="alpha" size="2" />
    <field name="Start_status" type="decimal" size="1" />
    <field name="End_status" type="decimal" size="1" />
    <field name="Start_date" type="user" size="8" />
    <field name="End_date" type="user" size="8" />
  </structure>
  <interface name="asp">
    <method name="asp_wt_list" id="asp_wt_list" elb="ELB:ASPLIB" >
      <methodresult type="integer" size="4" />
      <param name="p_request_mode" type="integer" size="4" />
      <param name="asp_wt_filters" type="structure" structureName="Asp_wt_filters" />
      <param name="p_output_format" type="integer" size="4" />
      <param name="r_tracking_ref" type="alpha" size="7" dir="out" />
      <param name="r_desc_buffer" type="alpha" size="660" dir="out" />
      <param name="r_data_buffer" type="alpha" size="660" dir="out" />
      <param name="r_break_flag" type="integer" size="4" dir="out" />
      <param name="r_break_reason" type="alpha" size="100" dir="out" />
      <param name="r_no_fields" type="integer" size="4" required="no" dir="out" />
      <param name="r_field_positions" type="integer" size="4" dim="1" required="no" dir="out" />
      <param name="r_field_lengths" type="integer" size="4" dim="1" required="no" dir="out" />
    </method>
  </interface>
</component>You can see it is a very primitive WSDL descriptor - it describes compound data types, and the methods in an interface.
Could I use the SAAJ API to call that routine from the Java/web tier? The SAAJ API just looks like a simplified XML API, not much to do with SOAP, and SOAP looks like it just sends arbitrary XML documents inside the soap Body.
How, in SAAJ, do I create a standard SOAP message to represent an invocation of that method?
I plan to generate a Java proxy to implement the interface, but I need to know how to work SOAP with SAAJ, so then I can examine the generated XML, and parse it appropriately in a generated Synergy DBL skeleton at the server end.
Another consideration, is that in the current "RPC", a sessoni is established between client and server, and state is preserved between calls. The above method returns data from a query line by line in subsequent calls. Obviously this needs some kind of routing servlet to handle ths incoming SOAP packet and maintain correlation between client, and a specific instance of a DBL Synergy SOAP server to which it redirects requests..
If anyone can help with suggestions, tips, links, whatever I'd be very grateful. I'm finding this a bit of a steep learning curve - none of the online resources go into SOAP ni any meaningful way, it's all just a skim saying how it's a simple form of RPC. But I need to know how to drive it!

Would it help if you are shown how a SAAJ client can contact a WSDL Webservice.
>
How, in SAAJ, do I create a standard SOAP
message to represent an invocation of that method?Would it help if you are shown how a SAAJ client can contact a WSDL Webservice. You will have to download JWSDP 1.4 for that. And then i can provide more info on how to write the SAAJ client. Also look at JWSDP 1.4 Tutorial, it will give you a lot of useful information.
Another consideration, is that in the current "RPC", a
sessoni is established between client and server, and
state is preserved between calls. The above method
returns data from a query line by line in subsequent
calls. Obviously this needs some kind of routing
servlet to handle ths incoming SOAP packet and
maintain correlation between client, and a specific
instance of a DBL Synergy SOAP server to which it
redirects requests..Have you read the SOAP version 1.2 Part 0: Primer document. It gives useful insights into how to do such things.
http://www.w3.org/TR/soap12-part0/
>
If anyone can help with suggestions, tips, links,
whatever I'd be very grateful. I'm finding this a bit
of a steep learning curve - none of the online
resources go into SOAP ni any meaningful way, it's all
just a skim saying how it's a simple form of RPC. But
I need to know how to drive it!The SOAP 1.2 primer also explains how SOAP is a simple form of RPC (very nicely).

Similar Messages

  • I want to write a java program that can add a user to a role or sub role to the Profile Database in iPlanet Portal Server 3.0. Does anyone has any idea or a sample program do such thing. Thanks, Tommy

    I want to write a java program that can add a user to a role or sub role to the Profile Database in iPlanet Portal Server 3.0. Does anyone has any idea or a sample program do such thing? Thanks, Tommy

    // create the user profile, get the handle back,
    // and set the membership profile attributes.
    ProfileAdmin newProfile = null;
    try {
    // the users profile name is the domain      
    // he belongs to plus their userName
    // you will request.domain if your doing this from a servlet, domain_name is the domain_name the user belongs too
    String profileName = domain_name + "/" + user;
         if (debug.messageEnabled()) {
    debug.message("creating profile for " + profileName);
    // create the user profile object
    newProfile = ProfileManager.createProfile(
    getSession(), profileName ,Profile.USER);
    UserProfile userProfile = (UserProfile)newProfile;
         // set the role the user is a member of. Default is to set
         // the users to the default role of the domain they surfed to
         StringBuffer roleName = new StringBuffer(64);
    // request.domain instead of domain_name if your doing this from a servlet ..
    Profile dp = getDomainProfile(domain_name);
    roleName.append(dp.getAttributeString("iwtAuth-defaultRole"));
         if (debug.messageEnabled()) {
    debug.message("setting role for " + user + " = " + roleName);
    userProfile.setRole(roleName.toString());
    newProfile.store(false);
    } catch (ProfileException pe) {
         debug.error("profile exception occured: ",pe);
    return;
    } catch (ProfileException pe) {
         debug.error("login exception occured: ",le);
    return;
    HTH ..

  • SOAP server side ... how to ... ?

    Hi,
    I'm new to the soap technology.
    I want to write a java application that use SOAP.
    I've downloaded JAXM to implement the client side :
    SOAPMessage response = con.call(message,endpoint);
    But I don't know what I must do to the server side ?
    A servlet ? What must I invoke on the server ?
    (I have IIS with servletexec, but I don't know if a servlet is necessary???)
    I just want to implement a server side that answer the SOAP request.
    Please,
    any information about server side
    or a little "startpoint" to begin is welcome.
    Very thanks.

    A good place to start are the tutorials and sample code that are found at:
    http://www-106.ibm.com/developerworks/webservices/library/ws-peer1/?dwzone=ws
    http://www-106.ibm.com/developerworks/webservices/library/ws-peer2/?dwzone=ws
    http://www-106.ibm.com/developerworks/webservices/library/ws-peer3/?dwzone=ws
    http://www-106.ibm.com/developerworks/webservices/library/ws-peer4/?dwzone=ws
    The second and third parts were the best - best coding samples. Also you might want to check out the Apache SOAP website - have you got your SOAP API? It can be found on:
    http://xml.apache.org/soap/index.html
    Also, the Apache SOAP website has a good bunch of info:
    http://xml.apache.org/soap/docs/index.html
    You'll need to have the SOAP, xerces.jar, and a few other things to fully implement SOAP. I've put together several client/server apps using different types of requirements.
    Does this help??

  • How to write file at server end?

    Hi,
    I use a af:inputFile component to receive uploaded files. And want to write files to the directory of server. However, when execute java.io.File.createNewFile(), it throw exception. How to resolve it?
    import org.apache.myfaces.trinidad.model.UploadedFile;
    import javax.faces.event.ValueChangeEvent;
    import java.io.InputStream;
    import java.io.File;
    public class UploadFileHandler {
        public void doUpload(ValueChangeEvent event) throws IOException {
            File file = new File("C:\temp.txt");
            *file.createNewFile();* //Error happen here.
    }

    Hi Cheney,
    It is good practice to use System.getProperty("file.separator") instead of hardcoding "/" or "\" .
    Though your issue is resolved by using "//", you might want to consider changing to the above.
    -Arun

  • New to Java. Want to write a simple applet for a mobile phone.

    Hello,
    I want to write a simple java applet for a mobile phone. currently I am in the stage of thinking about whether this is possible in a timeframe of about a month. I have very little java experience from a while back so I'm pretty much starting from scratch.
    All I want is an applet that lets you send 2 or 3 variables to an online server. The server will then reposition telescopes.
    All i'm concerned with is the mobile phone part, which doesn't have to be secure or impressive. Just a simple interface.
    Ideally it should work on my nokia 6070, which occording to the official specs has the following java technology:
    MIDP 2.0
    CLDC 1.1
    JSR 120 Wireless Messaging API
    JSR 135 Mobile Media API
    Nokia UI API
    (I don't know what any of this means but am a good learner).
    Can anyone offer me any advice? Is this possible in my timeframe? where should I start? I need a editor and compiler also (I'm using windows XP).
    Many thanks and kind regards,
    Jason

    Actually it is working on my phone now.
    I changed the target platform in the wireless toolkit settings to MIDP 1.0
    Now to create the fields coordinate fields etc. I don't have much of a clue really.
    Current I have:
    import java.io.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    public class AtmosMIDlet extends MIDlet implements CommandListener
    Form WelcomeForm = new Form("AtmosMIDlet");
    StringItem WelcomeMes = new StringItem(null, "Please enter coordinates:");
    TextField Longitude = new TextField("Longitude", "", 3, TextField.NUMERIC);
    TextField Lattitude = new TextField("Lattitude", "", 3, TextField.NUMERIC);
    public AtmosMIDlet()
    try
    ImageItem logo = new ImageItem(Image.createImage("/logo.png"));
    WelcomeForm.append(logo);
    catch (java.io.IOException x)
    throw new RuntimeException ("Image not found");
    WelcomeForm.append(WelcomeMes);
    WelcomeForm.append(Longitude);
    WelcomeForm.append(Lattitude);
    WelcomeForm.addCommand(new Command("Exit", Command.EXIT, 0));
    WelcomeForm.setCommandListener(this);
    public void startApp()
    Display.getDisplay(this).setCurrent(WelcomeForm);
    public void pauseApp() {}
    public void destroyApp(boolean unconditional) {}
    public void commandAction(Command c, Displayable s)
    notifyDestroyed();
    I'm trying to get the image logo.png to display at the top but I get the error:
    C:\WTK25\apps\AtmosSpec\src\AtmosMIDlet.java:19: cannot find symbol
    symbol : constructor ImageItem(javax.microedition.lcdui.Image)
    location: class javax.microedition.lcdui.ImageItem
    ImageItem logo = new ImageItem(Image.createImage("/logo.png"));
    ^
    1 error
    com.sun.kvem.ktools.ExecutionException
    Build failed
    When I try to build.. Any help would be great.
    Ideally the image would be on a seperate screen for a couple of seconds.

  • PDF file write to application server

    Hi All,
    I want to write PDF file to application server while downloading its writing but in this manner
    %PDF-1.6#%####
    108 0 obj#<</First 17/Length 108/Filter/FlateDecode/N 3/Type/ObjStm>>stream
    xڲT0P04Q07W05#2,#ll##K#J*#R#C####Sbq#[^##GjNYjIfr##SN##kr~Jf#~xf#c^q&##Ҧ##agG#a####X###T##XR### ##b#
    Please let me know where i am doing wrong.
    Please see below my code .
    (the scenario is when i download the pdf file i want to write the same file in to app server )
      call function fm_name
        exporting
          /1bcdwb/docparams  = fp_docparams "
          ls_header          = ls_waste
          lt_item            = gt_rkpf
          aufnr              = lv_aufnr
        importing
          /1bcdwb/formoutput = fp_formoutput
        exceptions
          usage_error        = 1
          system_error       = 2
          internal_error     = 3
          others             = 4.
    concatenate 'D:\temp\PROCESSORDER_' ls_waste-rsnum   '.PDF' into lv_file.
        pr_file = lv_file.
      open dataset pr_file for output in binary mode."text mode encoding  NON-UNICODE.
      if sy-subrc  0.
        exit.
      endif.
      transfer fp_formoutput-pdf  to pr_file.
      close dataset pr_file.
      clear :fp_formoutput-pdf,lv_file.
    Please any one help me thanks,
    Thanks,
    Kumar

    You can't tranfer the whole PDF data with just one transfer statement, instead you have to loop that table and transfer the data to the file until you reach the last row.
      open dataset pr_file for output in binary mode."text mode encoding  NON-UNICODE.
      if sy-subrc  0.
        exit.
      endif.
      loop at fp_formoutput-pdf  *****************
        transfer fp_formoutput-pdf  to pr_file.
      endloop.
      close dataset pr_file.
      clear :fp_formoutput-pdf,lv_file.

  • PDF write to application server

    Hi All,
    I want to write PDF string to application server its writing but in this manner
    %PDF-1.6#%####
    108 0 obj#<</First 17/Length 108/Filter/FlateDecode/N 3/Type/ObjStm>>stream
    xڲT0P04Q07W05#2,#ll##K#J*#R#C####Sbq#[^##GjNYjIfr##SN##kr~Jf#~xf#c^q&##Ҧ##agG#a####X###T##XR### ##b#
    Please let me know where i am doing wrong.
    Please see below my code .
    (the scenario is when i download the pdf file i want to write the same file in to app server, there user changes the data and he will do upload )
      call function fm_name
        exporting
          /1bcdwb/docparams  = fp_docparams "
          ls_header          = ls_waste
          lt_item            = gt_rkpf
          aufnr              = lv_aufnr
        importing
          /1bcdwb/formoutput = fp_formoutput
        exceptions
          usage_error        = 1
          system_error       = 2
          internal_error     = 3
          others             = 4.
    concatenate 'D:\temp\PROCESSORDER_' ls_waste-rsnum   '.PDF' into lv_file.
        pr_file = lv_file.
      open dataset pr_file for output in binary mode."text mode encoding  NON-UNICODE.
      if sy-subrc <> 0.
        exit.
      endif.
      transfer fp_formoutput-pdf  to pr_file.
      close dataset pr_file.
      clear :fp_formoutput-pdf,lv_file.
    Please any one help me thanks,
    Thanks,
    Kumar

    You can't tranfer the whole PDF data with just one transfer statement, instead you have to loop that table and transfer the data to the file until you reach the last row.
      open dataset pr_file for output in binary mode."text mode encoding  NON-UNICODE.
      if sy-subrc  0.
        exit.
      endif.
      loop at fp_formoutput-pdf  *****************
        transfer fp_formoutput-pdf  to pr_file.
      endloop.
      close dataset pr_file.
      clear :fp_formoutput-pdf,lv_file.

  • Want to write my personal Arch_Install Script, help please..

    Hi, guys, I want to write a script to make my arch-installation automatic. The following is my personal procedures I follow to install my Arch.
    I am wondering is there any way I can make it automatic instead of input every command manually, for example starting from "Adduser" after reboot after the base installation, can I make the rest run automatically by a script?
    Will it work if I simply write all commands one by one in each line into a text file, and exec it after chmod +x ?
    Or any suggestions?
    Thanks. :)
    ARCHLICH INSTALLATION
          <=============================boot==============================>
    1. Install Base system from FTP/HTTP-USB
    2. Configure system:
       1)rc.conf (HOSTNAME="home")
       2)etc/hosts (".. localhost home")
       3)locale.gen
       4)Root password
    3. Grub Install, change waiting time from 5 to 0.
          >=============================Reboot==============================<
    1. Adduser (tty,disk,video,audio,optical,storage,wheel) seperat by a single ","
    2. Setup sudo
       1)pacman -S sudo
       2)nano /etc/sudoers (uncomment "%wheel  ALL=(ALL) ALL")
    3. Xorg, driver, xorg.conf
       1)pacman -Sy xorg-server xorg-xinit xf86-input-mouse xf86-input-keyboard
       2)pacman -Sy nvidia
       3)mkdir "/mnt/backup" and mount /dev/sdb1
       4)copy xorg.conf from /mnt/backup/linux-backup/arch to /etc/X11
    4. Fonts & Scim (scim is configured later)
       1)pacman -Sy ttf-dejavu
       2)pacman -Sy ttf-ms-fonts artwiz-fonts
       3)pamcna -Sy terminus-font
       4)pacman -Sy ttf-arphic-uming ttf-arphic-ukai ttf-fireflysung
       5)pacman -Sy scim scim-pinyin
    5. Install OpenBox and Thunar
       1)openbox, lxappearance, gtk2-themes-collection, openbox-themes, nitrogen
       2)gamin, thunar, unrar, unzip, xarchiver, thunar-archive-plugin
       3)mousepad, rxvt-unicode, gqview
       4)MODULES=(!soundcore)
       5)DAEMONS=(.. dbus hal)
    6. nano /etc/inittab
       1)id:5:initdefault:  (unmoment the one with 3)
       2)comment out agetty3-6
       3)add the following line to the bottom and uncomment others:
        x:5:once:/bin/su kevin -l -c "/bin/bash --login -c startx >/dev/null 2>&1"
    7. log into kevin
       1)mkdir .config and cp openbox into it from backup
       2)mkdir .themes and cp DarkFiber into it from backup
       3)nano .xinitrc add "exec openbox-session"
       4)cp .Xdefaults to  ~/ from backup
          >=============================Reboot==============================<
    0. Mount sdb1 as root and cp .bashrc_root to root's home as .bashrc
    1. Exit to kevin and cp .bashrc to kevin's home.
    2. Install cpu-frequency
       1)pacman -S cpufrequtils
       2)nano /etc/conf.d/cpufreq:
                           min_freq="2GHz"
                           max_freq="2.7GHz"
    3. lm_sensors
       1)pacman -Sy lm_sensors
       2)sensors-detect
    4. NumbLock
       1)pacman -S numlockx
       2)add it to ~/.xinitrc:
    numlockx &
    nitrogen --restore &
    #conky &
    exec openbox-session
    5. Install OSS
       1)pacman -S oss
    6. Install Openntpd to adjust your computer time.
       1)pacman -S openntpd
    7. Diable IPv6 Module, mousepad /etc/modprobe.conf, and add:
    # disable autoload of ipv6
    alias net-pf-10 off
    8. Copy PolicyKit.conf from backup to /etc/PolicyKit/, for USB to auto-mount.
    9. Edit MODULES and DAEMONS:
    MODULES=(!soundcore powernow-k8 cpufreq_ondemand)
    DAEMONS=(syslog-ng network netfs crond dbus hal cpufreq sensors oss)    [Optional: preload]
    10. Add /etc/sudoers.(!Remember to have a new line in the end!)
    %users   ALL=NOPASSWD:/sbin/shutdown
    11. Edit /etc/fstab,(copy the 2 lines from /arch/fstab in backup)
      1)use nitrogen to change wallpaper
          >=============================Reboot==============================<
                                 APPLICATION INSTALLATION
          >================================================================<
    0. obmenu, obconf, librsvg
    1. firefox, flashplugin
    2. mplayer, mplayer-plugin, codecs
    4. cd /backup/linux: pacman -U mpg123-oss-TAB [ossxmix to diable vmix]
    5. openoffice-base, jre
    6. emacs (copy .emacs .virc to ~/ to prevent *~ file)(M-x custmize-variable RET
       latex-run-command RET, then change latex into pdflatex)
    7. texlive-most
    8. conky [edit .xinitrc to auto-start conky]
       (cp .conkrc and .weather and chmod +x .weather)
    9. tuxguitar
    10. openssh, sshfs
       1)mkdir .ssh, then as root cp private key to .ssh
       2)mkdir /mnt/yzhao and chown kevin:users /yzhao
                          nano /etc/pacman.conf
    [kdemod-legacy]
    Server = http://mirror.rit.edu/kdemod/legacy/i686
           <=====================OR=======================>
    [kdemod-legacy]
    Server = http://mirror.rit.edu/kdemod/legacy/x86_64
    11. kdemod3-kdegraphics-kdvi, kdemod3-kdegraphics-kpdf
    12. kile, k3b
    13. Add ":/opt/kde/bin" to /etc/profile, to use kde applications.
    14. Configure Scim to be usable, add to /etc/profile:
    export XMODIFIERS=@im=SCIM
    export GTK_IM_MODULE="scim"
    export QT_IM_MODULE="scim"
    scim -d
    15. deluge, pidgin [diable system tray, ossplay %s]
          <=============================End==============================>
    Last edited by yingwuzhao (2009-04-04 21:12:20)

    Well if you want to do all that, you obviously need to learn about bash scripting.
    You can also have a look at the automatic procedure from aif, which is made exactly for automatic installations.  See http://bbs.archlinux.org/viewtopic.php?id=58110

  • SOAP Server - HTTP GET

    Good afternoon, I'm trying to test my class:
    public String getOperation(String methodName, String[] paramNames, Object[] paramValues) throws Exception
    int size = 0;
              int i = 0;
              // Crear el stub cuando no exista
              if (!estado)
         prepareStub();
    //Invoca un método de un servicio Web
              WebServiceMethod wsm = wsp.getMethod(methodName); //WebServiceProxy
              // Falta establecer los parámetros, aquí es donde se envían los parámetros
    size = paramNames.length;
              String[] inMsgPartNames = new String[size];
              Object[] inMsgPartValues = new Object[size];
              for(i = 0; i < size; i++)
                   inMsgPartNames[i] = paramNames;
                   inMsgPartValues[i] = paramValues[i];
              //Object objRet = wsm.invoke(inMsgPartNames,inMsgPartValues);
              //String resp = (String)objRet;
    String resp = "";
              return resp;
    I want to invoke dynamically a Web Service, but I get this SOAP message
    <html><head><title>SOAP Server</title></head>
    <body><h1>SOAP Server</h1>
    <p>Sorry, I don't speak via HTTP GET- you have to use
    HTTP POST to talk to me.</p></body></html>
    Could you tell me. how can I test my class, with a local Web Service?

    Hi Veronica,
    I had the same problem yesterday. The "magic" is getting the URL right. If you look at the deployment information you will see that the test URL is something like http://localhost:8888/Workspace1-ModelWebService-context-root/JavaClass1 (my test class was JavaClass1). You can change the URL relative address, but the default will be what is shown.
    Best,
    Joe

  • Specify URL in Soap Server Connection Wizard

    Simple question I hope.
    Im trying create a Web Service.
    I have built it, now I am trying to assign to connection.
    In the SOAP Server Connection Wizard it asks for
    SOAP Servlet URL:
    What am I suppossed to type in here?
    I want to run it from my local machine.
    I can run all the code samples fine from http://localhost:8888

    If you are using OC4J then try.
    http://127.0.0.1:8888/soap/servlet/soaprouter

  • Help to write the sql server 2012(business intelligence ) certification.

    Hi,
    I am planning to write the SQL SERVER 2012 certification exam.
    i want few more details...
    1. Examination code.
    2. how to prepare
    3. is there any dumps available.
    4. is there any books available for preparation.
    Please pass the details, it would be very help full for me..

    The Business Intelligence exams are:
    70-461: Querying Microsoft SQL Server 2012
    70-462: Administering Microsoft SQL Server 2012 Databases
    70-463: Implementing a Data Warehouse with Microsoft SQL Server 2012
    70-466: Implementing Data Models and Reports with Microsoft SQL Server 2012
    70-467: Designing Business Intelligence Solutions with Microsoft SQL Server 2012
    Ramesh Babu Vavilla MCTS,MSBI

  • Accessing SOAP server programatically with a client

    Hi!
    I have found lots of documentation on how to send messages to a SOAP server when the xml is already specified. A lot less is written how this should be done programatically, and I can't find the solution to my problem. (I think doing it programatically is more pretty....)
    So, I got my web server up and running (JBoss 4.0.5GA), and the web service is deployed as it should (I've tested it using hard-coded ws request, which succeed).
    I also got a bunch of java files generated using wsdl2java, which I am using to create my request. The first thing I want to do is a simple login.
    The code (stripped a bit for convenience):
    public void run()
                   throws AxisFault, InterruptedException {
              // set up some initial stuff
              SOAPFactory factory = new SOAP12Factory();
              Options options = new Options();
              options.setTo(mTargerEPR);
              // log in to the system
              SOAPEnvelope payload = createLoginDocument(factory);
              // set the action to use for this call
              options.setAction("CAI3G#Login");
              // Non-Blocking Invocation
              ServiceClient sender = new ServiceClient();
              sender.setOptions(options);
              process(payload, sender);
    private SOAPEnvelope createLoginDocument(SOAPFactory factory) {
              LoginDocument loginDocument = LoginDocument.Factory.newInstance();
              LoginDocument.Login login = loginDocument.addNewLogin();
              login.setUserId("admin");
              login.setPwd("admin");
              return toEnvelope(factory, loginDocument);
    private SOAPEnvelope toEnvelope(SOAPFactory factory, XmlObject document) {
              SOAPEnvelope envelope = factory.createSOAPEnvelope();
              // create the header, which must contain sequence id and session id
              factory.createSOAPHeader(envelope);
              if (document != null) {
                   // create the body and include the document provided
                   SOAPBody body = factory.createSOAPBody(envelope);
                   body.addChild(toOM(document));
              return envelope;
    private static void process(SOAPEnvelope payload, ServiceClient sender)
                   throws AxisFault, InterruptedException {
              Callback callback = new Callback() {
                   // currently just print it to test
                   public void onComplete(AsyncResult result) {
                        System.out.println(result.getResponseEnvelope());
                   public void onError(Exception e) {
                        e.printStackTrace();
               sender.sendReceiveNonBlocking(payload, callback);
              // Wait until the callback receives the response.
              while (!callback.isComplete()) {
                   Thread.sleep(1000);
         }The error I receive looks like this:
    2007-05-29 15:30:03,644 [INFO] Axis2 Task - I/O exception (org.apache.axis2.AxisFault) caught when processing request: Can not output XML declaration, after other output has already been done.
    2007-05-29 15:30:03,644 [INFO] Axis2 Task - Retrying request
    2007-05-29 15:30:03,644 [INFO] Axis2 Task - I/O exception (org.apache.axis2.AxisFault) caught when processing request: Can not output XML declaration, after other output has already been done.
    2007-05-29 15:30:03,644 [INFO] Axis2 Task - Retrying request
    2007-05-29 15:30:03,644 [INFO] Axis2 Task - I/O exception (org.apache.axis2.AxisFault) caught when processing request: Can not output XML declaration, after other output has already been done.
    2007-05-29 15:30:03,644 [INFO] Axis2 Task - Retrying request
    org.apache.axis2.AxisFault: Can not output XML declaration, after other output has already been done.
         at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:221)
         at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:452)
         at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:330)
         at org.apache.axis2.description.OutInAxisOperationClient$NonBlockingInvocationWorker.run(OutInAxisOperation.java:405)
         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: javax.xml.stream.XMLStreamException: Can not output XML declaration, after other output has already been done.
         at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1473)
         at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1502)
         at com.ctc.wstx.sw.BaseStreamWriter.doWriteStartDocument(BaseStreamWriter.java:699)
         at com.ctc.wstx.sw.BaseStreamWriter.writeStartDocument(BaseStreamWriter.java:687)
         at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:190)
         at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:808)
         at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:779)
         at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:808)
         at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:234)
         at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:222)
         at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:808)
         at org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:418)
         at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:55)
         ... 19 more
    In JBoss, I get this exception:
    15:30:04,285 ERROR [[localhost]] Exception Processing ErrorPage[errorCode=500, location=/axis2-web/Error/error500.jsp]
    org.apache.jasper.JasperException: getOutputStream() has already been called for this response
    Any idea/pointer, someone? All help is greatly appreciated!
    Best regards,
    Peter

    I thought it might be worth to give a printout of the generated xml and the hard-coded, working xml.
    The working one:
    <env:Envelope
         xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
         xmlns:xs="http://www.w3.org/1999/XMLSchema"
         xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
         xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
         env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <env:Header />
         <env:Body>
                 <cai3g:Login xmlns:cai3g="http://schemas.ericsson.com/cai3g1.1/">
                      <cai3g:userId>admin</cai3g:userId>
                      <cai3g:pwd>admin</cai3g:pwd>
                 </cai3g:Login>
         </env:Body>
    </env:Envelope>The one I've generated, when doing a System.out.println() on the variable payload:
    <?xml version='1.0' encoding='utf-8'?>
    <soapenv:Envelope
         xmlns:xs="http://www.w3.org/1999/XMLSchema"
         xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"
         xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
         xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
         <soapenv:Body>
              <Login xmlns="http://schemas.ericsson.com/cai3g1.1/">
                   <userId>admin</userId>
                   <pwd>admin</pwd>
              </Login>
         </soapenv:Body>
    </soapenv:Envelope>

  • Simple Standalone SOAP Server

    Hi all
    I would like to have a simple SOAP server that doesn't run on tomcat or any other webservers. This is because I want to package it with installAnywhere and simply run it without setting any classpath, Java_home or installing JRE. Is there such library available?
    Thanks!
    Edmond

    Hi all
    I still can't find the right tool for me. I have scanned the JWSTutorial and it is so complex and long that I don't want to spend too much time on reading. What I really want is to make one of the function in my application web enabled. As I know, in MS VS.Net it can be done by in few clicks and I was told that SOAP is great for auto-generation of stubs and proxies code. Is there somethings like this in Java? I am not a MS guy but I think it is really too complicated to use webservices in java after downloaded the JWSTutorial and compared with the VS.Net.
    Thanks!
    Best regards
    Edmond

  • Can I use SOAP calls to remotely access functions on a SOAP server?

    Hi,
    I've used JavaScript and SOAP with "regular Acrobat" (e.g. Acroforms) to connect to a SOAP server, followed by Acrobat automatically setting up functions that I can call from JavaScript that, courtesy of SOAP, are relayed to the SOAP server for execution.  For example, a SOAP server that implements a Temperature function.  After doing the Net.SOAP.connect, my JavaScript magically has access to the Temperature() function, which is then executed remotely on the SOAP server courtesy of SOAP protocol.
    My question is: With Livecycle Designer and it's XFA-based forms, do I have the same ability to programmatically connect to a SOAP server and automatically have JavaScript functions set up that I can call on the server?  From what I've read, there are LC Submit and Execute operations which interact (e.g. exchange data) with a specified SOAP server, but it isn't clear that LC provides the ability to end up with a set of functions that I can call from my JavaScript that are then executed on the SOAP server.
    Stated more simply: Does LiveCycle Designer have the ability to connect to a SOAP server and automatically set up JavaScript functions that I can call (that then get relayed to the SOAP server for execution, followed by the return of data to my XFA-based program)?
    Thanks.
    Dave

    Hi Varma_LC and pguerett,
    First, thank you both for your quick responses!  It sounds like I shouldn't have any trouble using XFA forms and SOAP together.
    Let me ask a related question (not about LiveCycle & SOAP, but just about SOAP).  I'm trying to return two values from one SOAP call.  http://www.avoka.com/blog/?p=998&cpage=1#comment-1692 describes how to do this.  Unfortunately, it's not working for me.
    I'm able to retrieve single values from my SOAP server just fine.  When I try to return two values, the Acrobat JavaScript debugger says both values are "UNDEFINED".  The key part of my code is:
       var IntValue =   // define an int
         soapType: "xsd:int",
         soapValue: "1"
       var NValue =
           n1: IntValue  // n1 is the parameter my SOAP server expects
       var GetTheData = service.GetAllData(NValue);  // Go get the data and populate the GetTheData object
       console.println("GetTheData = " + GetTheData.CmdError + GetTheData.CmdResults);
       Param_1V.value = GetTheData.CmdError;     // This is a text box to display the returned value
       Param_2V.value = GetTheData.CmdResults; // This is also a text box to display the returned value
    Both the console.println & the two text boxes (beginning with Param) print out the same results, namely "UNDEFINED".
    I ran my SOAP client and SOAP server on two different computers, and then used WireShark to look at the SOAP protocol.  The SOAP protocol looks fine, and contains CmdError and CmdResults XML opening/closing tags around the actual data I'm trying to read from the SOAP server. Plus there are GetAllDataResponse and GetAllDataResult XML opening/closing tags around the data XML tags.
    I'm using Acrobat 9 and I developed my SOAP server using Windows Communication Foundation (WCF) 3.5.  The same JavaScript program that is unable to retrieve two values returns one value just fine (a different service... call, of course).  In other words, it's being done in one program, not two separate programs.  So, my singular Net.SOAP.connect call seems to be working fine.
    When I do the Net.SOAP.connect, I display the returned services, and GetAllData is listed, so Acrobat JavaScript knows about this particular service.
    BTW, the WCF built-in client works fine in retrieving/displaying the two returned values, correctly detecting and displaying both returned values.  Of course, the WCF client may have different "rules" than Acrobat has in terms of processing SOAP messages.  I've seen differences before between the WCF client and Acrobat.
    Any insights either of you have or anyone else has would be *greatly* appreciated. I've never used try/catch to trap JavaScript errors, if there is some type of error I should logically be looking for, I would be interested in information on that as well.
    Thanks!
    Dave

  • I have made a book of my I Photo pictures. In certain layouts there is a textframe. How can I avoid the frame becoming visible in the print if I don't want to write anything? Should I just leave it or should I delete the text "Write your text here" ?

    I have made a book of my iPhoto pictures. In certain layouts there is a text frame. How can I avoid the frame becoming visible in the print if I don't want to write anything?  Should I just leave it untouched or should I delete the instructing text "Write your text here"?

    Most pages have layouts for pictures only or pictures with text boxes. Either select the same layout for that page but the one without the text box or put a space in the text box.
    Putting a space in the text box will avoid getting the warning when ordering that there's an unfilled text box in the book. The box will not be visible in the final product.  You can and should check the book before ordering by previewing it as described in this Apple document: iPhoto '11: Preview a book, card, or calendar before you order or print it
    Happy Holidays

Maybe you are looking for