"Expected end of line, etc. but found end of script." HELP!!

When I try to run my script, it say "(null.)" When I try to compile it or save it as an application, it says "Expected end of line, etc. but found end of script." HELP!!!
Here is my script:
display dialog "WARNING! a virus has been detected and the system is crashing" buttons {"shut down computor to preserve contents", "burn virus file"} default button 2
if the button returned of the result is "burn virus file" then
say "warning the virus has reacted to its deletion and has activated itself"
say "virus is now in control of the users computor"
say "if you try to stop the virus it will delete all user data"
tell application "Safari"
activate
open location "http://www.facebook.com"
open location "http://www.yahoo.com"
open location "http://www.gmail.com"
open location "http://www.youtube.com"
end tell
tell application "iTunes"
activate
play
end tell
tell application "iCal"
activate
end tell
tell application "Terminal"
activate
end tell
tell application "Finder"
quit
end tell
if the button returned of the result is "shut down computor to preserve contents" then
say "your computor will shut to protect your files."
say "shut down in t-3"
say "2."
say "1."
say "goodbye"
say "it appears that there is a problem"
say "the virus is starting to take over your system"
beep 17
display dialog "how DARE you try to delete me. I am now going to take over your computer." buttons {"**** YOU GET OUTTA MY COMPUTER", "OK, have fun!!"} default button "OK, have fun!!"
if the button returned of the result is "OK, have fun!!" then
say "thank you!!"
say "watch this!"
Tell application "iChat"
quit
end tell
Tell application "Finder"
quit
end tell
if the button returned of the result is "**** YOU GET OUTTA MY COMPUTER" then
say "That attitude will not be tollerated."
say "Dum dum dum dum dum dum dum he he he ho ho ho fa lah lah lah lah lah lah fa lah full hoo hoo hoo" using "Cellos"
display dialog "A virus has been detected going through your files. Would you like to try to stop this?" buttons {"OK"} default button "OK"
if the button returned of the result is "OK" then
beep 5
display dialog "there has been an error. Do you want to try to force quit?" buttons "Yes" default button "Yes"
if the button returned of the result is "Yes" then
say "Well, thats just too bad!"
beep 2
say "Sorry about that."
say "The virus has been purged from your system."
say "Your computer will now restart to make sure that all traces of the virus have been removed."
say "shut down in t-3"
say "2"
say "1"
say "goodbye"
tell application "Finder"
restart
end tell
end if

You need to complete compound if statements with an end if - see the AppleScript Language Guide for a description of the various kinds of if statements.
Although I don't think it is going to do what you expect, your script would look something like:
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
font-weight: normal;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px; height: 340px;
color: #000000;
background-color: #DAFFB6;
overflow: auto;"
title="this text can be pasted into the AppleScript Editor">
display dialog "WARNING! a virus has been detected and the system is crashing" buttons {"shut down computor to preserve contents", "burn virus file"} default button 2
if the button returned of the result is "burn virus file" then
say "warning the virus has reacted to its deletion and has activated itself"
say "virus is now in control of the users computor"
say "if you try to stop the virus it will delete all user data"
tell application "Safari"
activate
open location "http://www.facebook.com"
open location "http://www.yahoo.com"
open location "http://www.gmail.com"
open location "http://www.youtube.com"
end tell
tell application "iTunes"
activate
play
end tell
tell application "iCal"
activate
end tell
tell application "Terminal"
activate
end tell
tell application "Finder"
quit
end tell
else if the button returned of the result is "shut down computor to preserve contents" then
say "your computor will shut to protect your files."
say "shut down in t-3"
say "2."
say "1."
say "goodbye"
say "it appears that there is a problem"
say "the virus is starting to take over your system"
beep 17
end if
display dialog "how DARE you try to delete me. I am now going to take over your computer." buttons {"**** YOU GET OUTTA MY COMPUTER", "OK, have fun!!"} default button "OK, have fun!!"
if the button returned of the result is "OK, have fun!!" then
say "thank you!!"
say "watch this!"
tell application "iChat"
quit
end tell
tell application "Finder"
quit
end tell
else if the button returned of the result is "**** YOU GET OUTTA MY COMPUTER" then
say "That attitude will not be tollerated."
say "Dum dum dum dum dum dum dum he he he ho ho ho fa lah lah lah lah lah lah fa lah full hoo hoo hoo" using "Cellos"
end if
display dialog "A virus has been detected going through your files. Would you like to try to stop this?" buttons {"OK"} default button "OK"
if the button returned of the result is "OK" then
beep 5
display dialog "there has been an error. Do you want to try to force quit?" buttons "Yes" default button "Yes"
else if the button returned of the result is "Yes" then
say "Well, thats just too bad!"
beep 2
say "Sorry about that."
say "The virus has been purged from your system."
say "Your computer will now restart to make sure that all traces of the virus have been removed."
say "shut down in t-3"
say "2"
say "1"
say "goodbye"
tell application "Finder"
restart
end tell
end if
</pre>

Similar Messages

  • How to fix Syntax Error: Expected end of line, etc. but found end of script. in applescript?

    I am making an applescript for my modding tool for Minecraft. It used to use multiple apps and I am now trying to make one app for all the tasks.
    Here is the code:
    say "You are running iCraft version one point one for minecraft version 1.2.5"
    display dialog "Which tool do you want to use?" buttons {"Mod Installer", "Backup", "Restore"} default button 3
    set the button_pressed to the button returned of the result
    if the button_pressed is "Mod Installer" then
    do shell script "~/desktop/iCraft/iCraft.app/contents/re…
    display dialog "Insert all mod files into the Mods folder."
    display dialog "Have you inserted all Mod files into the Mods folder?" buttons {"Yes", "No"} default button 2
    if the button_pressed is "Yes" then
    do shell script "~/desktop/iCraft/iCraft.app/contents/re…
    display dialog "Finished"
    else
    display dialog "Insert mod files into the Mods folder and restart iCraft.app."
    end if
    if the button_pressed is "Backup" then
    display dialog "Are you sure you want to backup your Minecraft.jar in it's current state?" buttons {"Yes", "No"} default button 2
    if the button_pressed is "Yes" then
    do shell script "~/desktop/iCraft/iCraft.app/contents/re…
    display dialog "Finished, find it in your Backups directory in the iCraft folder"
    else
    display dialog "Backup aborted"
    end if
    if the button_pressed is "Restore" then
    display dialog "Are you sure you want to restore your Minecraft.jar with your backup?" buttons {"Yes", "No"} default button 2
    if the button_pressed is "Yes" then
    do shell script "~/desktop/iCraft/iCraft.app/resources/s…
    else
    display dialog "Restore aborted"
    end if
    end
    When I try to compile/run it gives me Syntax Error: Expected end of line, etc. but found end of script.

    Your script got mangled when pasting it into your message, but the main problem looks like you are missing a bunch of end if statements.  Unless your if statements are contained on one line, you need to terminate them with a matching end if statement - for example, the following are equivalent:
    if someString is "whatever" then display dialog "foo"
    if someString is "whatever" then
      display dialog "foo"
    end if

  • Applescript compile fails with "Expected end of line, etc. but found identifier"

    Hi,
    I've written my first applescript to move messages in Micorosoft Outlook to a specific folder.  It is based on existing scripts I found on the internet.  However my version keeps failing to compile with the error "Expected end of line, etc. but found identifier".  I tried the exact same script on another Mac and it works.  I created a very simple version of the script to show the error.  All I am trying to do is get the current selected messages so I can move them:
    on run {}
        tell application "Microsoft Outlook"       
            set selectedMessages to current messages
        end tell
    end run
    and I still get the same errors on the word "messages" above.
    MAC is running OSX 10.9.4
    Microsoft Outlook for Mac 2011 - version 14.4.3 (140616)
    Since the script works on other computers the only thing I can assume is something wrong with the setup.
    Any help is greatly appreciated.
    - Ben

    Frank Caggiano wrote:
    twtwtw
    Any reason that the parens would be needed on some cases and not in others? As you can see the code the OP posted compiled fine on my system with no need of the parens. Also the OP mentioned that the code did work on one machine but not another so I would assume again the parens were not needed in that case.
    JUst curious
    regards
    Parentheses have the same function here as they do in mathematical equations. They are cues to the compiler about the order in which different parts of the statement should be processed. The problem here, I think, is that the word current is part of a lot of applescript nouns: current date, current application, current messages, current user, current track, current location, etc. That's exacerbated by the fact that message is also a noun in its own right in Outlook, creating an ambiguous bit of grammar. Applescript has to interpret the presence of that word in context, and several factors - different versions of the OS or of the relevant applications, the presence of different osaxen, runtime issues that alter how the Applescript system reads in the scriptability information - could affect how that interpretation plays out.
    Context is (apparently) everything, sometimes.

  • Workaround for "Expected expression but found end of line" error

    I have the following code
    tell application "Mail"
    set mymailList to {"[email protected]", "[email protected]", "[email protected]"}
    set myattachmentList to {"Macintosh HD:Users:SAM:Desktop:A1.xls", "Macintosh HD:Users:SAM:Desktop:A2.xls", "Macintosh HD:Users:SAM:Desktop:A3.xls"}
    set n to count items in mymailList
    set i to 0
    repeat n times
    set i to i + 1
    set var1 to item i of mymailList
    set var2 to item i of myattachmentList as alias
    set newmessage to make new outgoing message with properties {visible:true, subject:"Report", content:"Blah Blah Blah"}
    tell newmessage
    set sender to "Sam <[email protected]>"
    set visible to true
    make new to recipient at end of to recipients with properties {address:var1}
    tell content to make new attachment with properties {file name:var2} at after last paragraph
    end tell
    activate
    send newmessage
    end repeat
    end tell
    I would like to be able to paste the MailList and MailAttatchmentList values from a spreadsheet so that it would look something like this:
    tell application "Mail"
    set mymailList to {
    "[email protected]",
    "[email protected]",
    "[email protected]"
    set myattachmentList to {
    "Macintosh HD:Users:SAM:Desktop:A1.xls",
    "Macintosh HD:Users:SAM:Desktop:A2.xls",
    "Macintosh HD:Users:SAM:Desktop:A3.xls"
    set n to count items in mymailList
    set i to 0
    repeat n times
    set i to i + 1
    set var1 to item i of mymailList
    set var2 to item i of myattachmentList as alias
    set newmessage to make new outgoing message with properties {visible:true, subject:"Report", content:"Blah Blah Blah"}
    tell newmessage
    set sender to "Sam <[email protected]>"
    set visible to true
    make new to recipient at end of to recipients with properties {address:var1}
    tell content to make new attachment with properties {file name:var2} at after last paragraph
    end tell
    activate
    send newmessage
    end repeat
    end tell
    Is there something that I can put at the end of each value so that I avoid the "Expected expression but found end of line" error?
    Thanks!
    Sam

    You didn't need to post the entire script - just an example of the list format would have done
    Anyway, AppleScript uses option-return as a 'soft' return/line continuation character, so:
    set mymailList to {¬
    "[email protected]",¬
    "[email protected]",¬
    "[email protected]
    (where ¬ indicates an option-return) will work. I'm just not sure off hand how you'd automatically insert option-return characters coming out of Excel...

  • Syntax Error: Expected end of line but found end of script.

    display dialog "Are you awesome" buttons {"Yes", "No"} default button 1
    if the button returned of the result is "Yes" then
    tell application "Finder"
    display dialog "You Passed the Test" buttons {"YAY", "Poop nugets"} default button 1
    end tell
    display dialog "Cool" buttons {"Ok", "More Info"} default button 1
    if the button returned of the result is "More Info" then
    tell application "Finder"
    display dialog "You are obviously are awesome,
    100% Cool" buttons {"Ok"} default button 1
    end tell
    Then it says:
    Syntax error: Expected end of line but found end of script.

    can somebody fix this scrip becasue i am having the exact same problems
    tell application "SpeechRecognitionServer"
              set theResponse to listen for {"yes", "no"} with prompt "Hello Michael, Would you like the internet?"
              if theResponse is "yes" then
                        launch application "Google Chrome"
                        tell application "SpeechRecognitionServer"
                                  set theResponse to listen for {"yes", "no"} with prompt "What about a Calander?"
              if theResponse is "yes" then
                        launch application "ical"
                        tell application "SpeechRecognitionServer"
                                  set theResponse to listen for {"yes", "no"} with prompt "How about some iTunes Music?"
              if theResponse is "yes" then
                        launch application "itunes"
                        tell application "SpeechRecognitionServer"
                                  set theResponse to listen for {"yes","no"} with prompt "Would you like me to stop?"
              if theResponse is "no" then
                                  say "ok"
    else
              if theResponse is "no" then
                        exit repeat
    else
                                  exit repeat
    end
    end if
    end
    end if
    end
    end if
    end tell 

  • Expected "else", etc. but found "on".

    I'm trying to make an app in Applescript, and then this happened:
    display dialog "What version of Minecraft do you have?" buttons {"-1.5", "1.6+", "Cancel"} with icon note
    if the button returned of the result is "-1.5" then
    display dialog "Opening the game in 3" buttons {"Cancel"} default button 1 with icon note giving up after 1
    display dialog "Opening the game in 2" buttons {"Cancel"} default button 1 with icon note giving up after 1
    display dialog "Opening the game in 1" buttons {"Cancel"} default button 1 with icon note giving up after 1
              try
      -- Below is very scary, but actually is just debugging the code
                        set MineLog to do shell script "cd ~/Library/Application\\ Support/minecraft/bin; java -Xms512M -Xmx1024M -Xincgc -cp \"minecraft.jar:jinput.jar:lwjgl.jar:lwjgl_util.jar\" -Dorg.lwjgl.librarypath=\"$(pwd)/natives\" -Dnet.java.games.input.librarypath=\"$(pwd)/natives\" net.minecraft.client.Minecraft"
      -- Above is very scary, but actually is just debugging the code
                        my write_mine_log(the MineLog)
              end try
    error>      on write_mine_log(this_minelog)
              set the mining_log to ((path to desktop) as text) & "MineLog.txt"
              try
                        open for access file the mining_log with write permission
                        write (this_minelog & return) to file the mining_log starting at eof
                        close access file the mining_log
              on error
                        try
                                  close access file the mining_log
                        end try
              end try
    another error> end write_mine_log
    else if the button returned of the result is "1.6+" then
    -- action for 2nd button goes here
    else
    -- action for quit button goes here
    end if
    how to fix>

    Now I get another error:
                       error VV                                error VV
    set MineLog to (tell application "Terminal" to do script "cd ~/Library/Application\\ Support/minecraft/bin; java -Xms512M -Xmx1024M -Xincgc -cp \"minecraft.jar:jinput.jar:lwjgl.jar:lwjgl_util.jar\" -Dorg.lwjgl.librarypath=\"$(pwd)/natives\" -Dnet.java.games.input.librarypath=\"$(pwd)/natives\" net.minecraft.client.Minecraft")
    Expected expression, “)”, etc. but found “tell”.
    and
    A to:do can’t go after this application Terminal.
    fix?

  • How do I transfer my checked songs from one computer to another - tried exporting library playlist etc but no luck! Please help! I have 26,000 songs - 17,000 are selected and I can't run down the list on my new computer and re-check 17,000 songs! Thanks!

    How do I transfer my checked songs from one computer to another - tried exporting library playlist etc but no luck! Please help! I have 26,000 songs - 17,000 are selected and I can't run down the list on my new computer and re-check 17,000 songs! Thanks!

    Make a smart playlist of your whole library but only checked songs - #4 on  http://support.apple.com/kb/ht1801
    Highlight all files in that playlist, then drag to the other drive.  This isn't preserving any playlists or whatever, just copying files from one drive to another.
    You might want to delete the smart playlist this once you are done because it will probably gobble up resources with that many files.

  • Does anyone know where the iWeb data files are located or what they are called?  I can't find them.  I looked in Finder for files named the same as my website, but found nothing.  Any help would be appreciated.

    Does anyone know where the iWeb data files are located or what they are called?  I can't find them.  I looked in Finder for files named the same as my website, but found nothing.  Any help would be appreciated.

    If you erased or replaced your hard drive since iWeb was cancelled, then they are gone. Otherwise, if you have maintained backups then check those.
    Usually such files are in the /Home/Library/ folder or a sub-folder.
    Exposing the /Home/Library/ Folder
    Pick one of the following methods:
    A. This method will make the folder visible permanently. Open the Terminal application in your Utilities folder and paste the following at the command prompt:
    chflags nohidden ~/Library
    Press RETURN.
    B. Click on the Desktop, press the OPTION (⌥) button, select Library from the Finder's Go menu.
    C. Select Go To Folder from the Finder's Go menu. Paste the following in the path field:
    ~/Library
    Press the Go button.

  • Apple Script Editor, "Expected end of line but found identifier" Error

    Hello, I'm trying to automate an Application I have, called Self Control, since I have ADD and easily get distracted, and what I want to do is for my computer to automatically set the application up, but to do this, I need a script, which I have already done, but get this error, can someone help me fix this script?
    (the error happens once I click on "run", it tells me as follows: "Syntax Error", followed by, "Expected end of line but found identifier".
    on run argv
    set defaultTime to 1440
    try
      set myTime to item 1 of argv as number
    on error
      set myTime to defaultTime
    end try
    tell application "Usable Keychain Scripting"
      tell current keychain
       set myPass to (password of first generic item ¬
        whose name contains "SelfControl")
       -- eliminate invisible characters, or "gremlins," from password
       set x to quoted form of myPass
       set myPass to do shell script "echo " & x & " | perl -pe 's/[^[:print:]]//g'"
      end tell
    end tell
    tell application "SelfControl" to activate
    tell application "System Events"
      tell process "SelfControl"
       tell slider of window "SelfControl" to set value to myTime
       click button "Start" of window "SelfControl"
      end tell
      tell window 1 of process "SecurityAgent"
       with timeout of 15 seconds
        repeat
         set tryAgain to false
         try
          set value of text field 2 of scroll area 1 of group 1 to myPass
         on error
          delay 1
          set tryAgain to true
         end try
         if not tryAgain then exit repeat
        end repeat
        click button 2 of group 2
       end timeout
      end tell
    end tell
    end run
    I'm no coding expert, but your help would be greatly appreciated. I know that once the script is done I can automate it with Calendar, or even Quicksilver, I just need help with the script.
    Thanks in advance!

    This is a pain with Applescript.
    Could  be a missing " or ' .  I didn't notice this problem.
    Use (* and *) to comment out lines to find where the problem lays. Start big then go smaller and smaller until you find the problem line.  Search internet for examples of the line in question.

  • Error "expected end of line but found identifier"?

    I downloaded the project files for Apple's iDVD Companion http://www.apple.com/applescript/idvd/companion.html because I wanted to make some changes to it and rebuild it using Xcode.
    However, even it its original state the build fails under 10.4.10 and the current version of Applescript. Error is "expected end of line but found identifier" in one of the scripts. See screenshot:
    I don't understand why this Applescript is not compiling - has there been syntax changes in Applescript which stop this compiling? What is the correct syntax?
    Appreciate any pointers... thanks...
    G5 Desktop PPC 1.6 GHz   Mac OS X (10.4.8)  

    Perform a 'Find, Find in Project...' menu item ('Command <shift> F') search for 'Abstract object', and replace such with 'item'.
    However, once this resolves the compiling problem, you will experience a slew of AppleScript errors, when utilizing the compiled application.
    Note: Even the downloadable (pre-complied) 'iDVD Companion' application file has its share of incompatibilities.
    A lot has changed (with MacOS X and AppleScript) since 27.11.2001 - the creation date of the 'iDVD Companion' project.
      Mac OS X (10.4.6)  

  • AppleScript Error: "Expected end of line but found identifier."

    Hi everyone,
    I'm new to applescript and can't seem to figure out the error here.
    Info: Using Hazel and iFlicks 2 Applications for this process.
    tell application "iFlicks 2" to launch
    delay 7
    tell application "iFlicks 2"
    update theFile dbID without gui
    end tell
    I get the error "Expected end of line but found identifier." for the red text.
    theFile reffers to the file that the actions are to be preformed on. This is a Hazel thing.
    Thank you!

    You need to look in the "iFlicks 2" dictionary.  This line isn't matching the syntax found in the dictionary.  I find reading a dictionary nearly impossible.
    update theFile dbID without gui

  • AppleScript -  Syntax Error: Expected end of line found """.

    The following AppleScript code works on Tiger and Snow Leopard but not on Leopard (10.5 > 10.5.8).
    tell application "FileMaker Pro"
    tell database "SomeDB.fp5"
    -- some code to execute
    end tell
    end tell
    In Leopard, the code won't compile and is complaining of a Syntax Error: Expected end of line found """. I click OK and then the quote symbol ( " ) to the left of SomeDB.fp5 is highlighted.
    Has anyone else experienced this and have resolved this in Leopard?
    Thanks

    If you copy/pasted the script from somewhere, the line endings in the source may not be translating. Try replacing the line endings (the return) on the lines around the one that is being highlighted.

  • Error: unexpected XML reader state. expected: END but found: START:

    I am getting following error while invoking method 'GetVersionInfo' (.net web service over dll) which takes one input parameter(string) and gives two output parameters(both short):
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: deserialization
    error: unexpected XML reader state. expected: END but found: START:
    {UPPLink}pnVersionMajor
    ORA-06512: at "SYS.UTL_DBWS", line 388
    ORA-06512: at "SYS.UTL_DBWS", line 385
    ORA-06512: at line 40
    Expected Request is as follows:
    POST /UPPLink/UPPLink.asmx HTTP/1.1
    Host: 172.16.1.38
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "UPPLink/GetVersionInfo"
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <GetVersionInfo xmlns="UPPLink">
    <ignore>string</ignore>
    </GetVersionInfo>
    </soap:Body>
    </soap:Envelope>
    EXpected Response is as follows:
    HTTP/1.1 200 OK
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <GetVersionInfoResponse xmlns="UPPLink">
    <GetVersionInfoResult>
    <pnVersionMajor>short</pnVersionMajor>
    <pnVersionMinor>short</pnVersionMinor>
    </GetVersionInfoResult>
    </GetVersionInfoResponse>
    </soap:Body>
    </soap:Envelope>
    The PL/SQL code I am using is as follows:
    DECLARE
    service_ sys.utl_dbws.SERVICE;
    call_ sys.UTL_DBWS.call;
    service_qname sys.utl_dbws.QNAME;
    port_qname sys.utl_dbws.QNAME;
    operation_qname sys.utl_dbws.QNAME;
    string_type_qname sys.utl_dbws.QNAME;
    number_type_qname sys.utl_dbws.QNAME;
    retx ANYDATA;
    strEntry VARCHAR2(100);
    retx_string VARCHAR2(100);
    majorVersion NUMBER;
    minorVersion NUMBER;
    params sys.utl_dbws.ANYDATA_LIST;
    v_outputs sys.utl_dbws.anydata_list;
    BEGIN
    dbms_output.put_line('Starting Function');
    service_qname := sys.utl_dbws.to_qname(null, 'UPPLink');
    strEntry := 'vab';
    dbms_output.put_line('Creating Service');
    service_ := sys.utl_dbws.create_service(HTTPURITYPE('http://172.16.1.38/UPPLink/UPPLink.asmx?WSDL'), service_qname);
    dbms_output.put_line('Creating Operation');
    operation_qname := sys.utl_dbws.to_qname(null, 'GetVersionInfo');
    dbms_output.put_line('Calling Service');
    call_ := sys.utl_dbws.create_call(service_, null, operation_qname);
    sys.utl_dbws.set_property(call_, 'SOAPACTION_USE', 'true');
    sys.utl_dbws.set_property(call_, 'SOAPACTION_URI', 'UPPLink/GetVersionInfo');
    sys.utl_dbws.set_property(call_, 'OPERATION_STYLE', 'rpc');
    string_type_qname := sys.utl_dbws.to_qname('http://www.w3.org/2001/XMLSchema', 'string');
    number_type_qname := sys.utl_dbws.to_qname('http://www.w3.org/2001/XMLSchema', 'short');
    sys.utl_dbws.add_parameter(call_, 'ignore', string_type_qname, 'ParameterMode.IN');
    sys.utl_dbws.add_parameter(call_, 'pnVersionMinor', number_type_qname, 'ParameterMode.OUT');
    sys.utl_dbws.set_return_type(call_, number_type_qname);
    params(0) := ANYDATA.convertvarchar2(strEntry);
    dbms_output.put('Invoking with Input Parameter: ');
    dbms_output.put_line(ANYDATA.ACCESSVARCHAR2(params(0)));
    retx := sys.utl_dbws.invoke(call_, params);
    dbms_output.put_line('Invoke complete');
    majorVersion := retx.accessnumber;
    dbms_output.put_line('Major Version ' || majorVersion);
    v_outputs := SYS.utl_dbws.get_output_values(call_);
    minorVersion := ANYDATA.AccessNumber(v_outputs(1));
    dbms_output.put_line('Minor Version ' || minorVersion);
    sys.utl_dbws.release_service(service_);
    END;
    /

    Actually, the name needs to match what is specified in the WSDL file.

  • Unexpected XML reader state. expected: END but found: START:

    Hi,
    I am wrote a web client using JWSDP-2.0 and JWSDP-1.4.
    When I run my client I get following error.
    java.rmi.RemoteException: Runtime exception; nested exception is:
    deserialization error: unexpected XML reader state. expected: END but found: START: m_dValue; nested e
    xception is:
    java.rmi.RemoteException: Runtime exception; nested exception is:
    deserialization error: unexpected XML reader state. expected: END but found: START: m_dValue
    at com.engagenet.protoObj.wizcon.TagServiceSoap_Stub.readTagValues(TagServiceSoap_Stub.java:92)
    at com.engagenet.protoObj.wizcon.TagService_Impl.main(TagService_Impl.java:78)
    Caused by: java.rmi.RemoteException: Runtime exception; nested exception is:
    deserialization error: unexpected XML reader state. expected: END but found: START: m_dValue
    at com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(StreamingSender.java:331)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:313)
    at com.engagenet.protoObj.wizcon.TagServiceSoap_Stub.readTagValues(TagServiceSoap_Stub.java:70)
    ... 1 more
    Caused by: deserialization error: unexpected XML reader state. expected: END but found: START: m_dValue
    at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:233)
    at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:1
    55)
    at com.sun.xml.rpc.encoding.ObjectArraySerializer.deserializeArrayInstance(ObjectArraySerializer.java:
    207)
    at com.sun.xml.rpc.encoding.ArraySerializerBase.deserialize(ArraySerializerBase.java:260)
    at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:1
    55)
    at com.engagenet.protoObj.wizcon.TagServiceSoap_ReadTagValues_ResponseStruct_SOAPSerializer.doDeserial
    ize(TagServiceSoap_ReadTagValues_ResponseStruct_SOAPSerializer.java:43)
    at com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:192)
    at com.sun.xml.rpc.encoding.ReferenceableSerializerImpl.deserialize(ReferenceableSerializerImpl.java:1
    55)
    at com.engagenet.protoObj.wizcon.TagServiceSoap_Stub._deserialize_ReadTagValues(TagServiceSoap_Stub.ja
    va:336)
    at com.engagenet.protoObj.wizcon.TagServiceSoap_Stub._readFirstBodyElement(TagServiceSoap_Stub.java:31
    1)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:228)
    ... 2 more
    Here is my wsdl file
    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:WizWebService" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="urn:WizWebService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    <wsdl:types>
    <s:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="urn:WizWebService">
    <s:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
    <s:complexType name="ReadTagValues_return_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="tns:TagValue[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="ReadTagValues_tagNames_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="s:string[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="ReadTagStringValues_return_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="tns:TagStringValue[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="ReadTagStringValues_tagNames_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="s:string[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="WriteTagValues_return_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="tns:QUALITY[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="WriteTagValues_tagNames_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="s:string[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="WriteTagValues_tagValues_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="s:double[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="WriteTagStringValues_return_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="tns:QUALITY[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="WriteTagStringValues_tagNames_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="s:string[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="WriteTagStringValues_tagValues_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="s:string[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:complexType name="GetTagNames_return_Array">
    <s:complexContent mixed="false">
    <s:restriction base="soapenc:Array">
    <s:attribute wsdl:arrayType="tns:TagName[]" ref="soapenc:arrayType" />
    </s:restriction>
    </s:complexContent>
    </s:complexType>
    <s:simpleType name="TAG_FORMAT">
    <s:restriction base="s:string">
    <s:enumeration value="F_STRING" />
    <s:enumeration value="F_NUMERIC" />
    </s:restriction>
    </s:simpleType>
    <s:simpleType name="QUALITY">
    <s:restriction base="s:string">
    <s:enumeration value="Q_ERR" />
    <s:enumeration value="Q_OK" />
    </s:restriction>
    </s:simpleType>
    <s:complexType name="TagStringValue">
    <s:sequence>
    <s:element name="m_bstrValue" type="s:string" />
    <s:element name="m_Quality" type="tns:QUALITY" />
    </s:sequence>
    </s:complexType>
    <s:complexType name="TagName">
    <s:sequence>
    <s:element name="m_bstrName" type="s:string" />
    <s:element name="m_Format" type="tns:TAG_FORMAT" />
    </s:sequence>
    </s:complexType>
    <s:complexType name="TagValue">
    <s:sequence>
    <s:element name="m_dValue" type="s:double" />
    <s:element name="m_Quality" type="tns:QUALITY" />
    </s:sequence>
    </s:complexType>
    </s:schema>
    </wsdl:types>
    <wsdl:message name="ReadTagValuesIn">
    <wsdl:part name="tagNames" type="tns:ReadTagValues_tagNames_Array" />
    </wsdl:message>
    <wsdl:message name="ReadTagValuesOut">
    <wsdl:part name="return" type="tns:ReadTagValues_return_Array" />
    </wsdl:message>
    <wsdl:message name="ReadTagStringValuesIn">
    <wsdl:part name="tagNames" type="tns:ReadTagStringValues_tagNames_Array" />
    </wsdl:message>
    <wsdl:message name="ReadTagStringValuesOut">
    <wsdl:part name="return" type="tns:ReadTagStringValues_return_Array" />
    </wsdl:message>
    <wsdl:message name="WriteTagValuesIn">
    <wsdl:part name="tagNames" type="tns:WriteTagValues_tagNames_Array" />
    <wsdl:part name="tagValues" type="tns:WriteTagValues_tagValues_Array" />
    </wsdl:message>
    <wsdl:message name="WriteTagValuesOut">
    <wsdl:part name="return" type="tns:WriteTagValues_return_Array" />
    </wsdl:message>
    <wsdl:message name="WriteTagStringValuesIn">
    <wsdl:part name="tagNames" type="tns:WriteTagStringValues_tagNames_Array" />
    <wsdl:part name="tagValues" type="tns:WriteTagStringValues_tagValues_Array" />
    </wsdl:message>
    <wsdl:message name="WriteTagStringValuesOut">
    <wsdl:part name="return" type="tns:WriteTagStringValues_return_Array" />
    </wsdl:message>
    <wsdl:message name="GetTagNamesIn">
    <wsdl:part name="bstrStnName" type="s:string" />
    </wsdl:message>
    <wsdl:message name="GetTagNamesOut">
    <wsdl:part name="return" type="tns:GetTagNames_return_Array" />
    </wsdl:message>
    <wsdl:portType name="TagServiceSoap">
    <wsdl:operation name="ReadTagValues">
    <wsdl:input message="tns:ReadTagValuesIn" />
    <wsdl:output message="tns:ReadTagValuesOut" />
    </wsdl:operation>
    <wsdl:operation name="ReadTagStringValues">
    <wsdl:input message="tns:ReadTagStringValuesIn" />
    <wsdl:output message="tns:ReadTagStringValuesOut" />
    </wsdl:operation>
    <wsdl:operation name="WriteTagValues">
    <wsdl:input message="tns:WriteTagValuesIn" />
    <wsdl:output message="tns:WriteTagValuesOut" />
    </wsdl:operation>
    <wsdl:operation name="WriteTagStringValues">
    <wsdl:input message="tns:WriteTagStringValuesIn" />
    <wsdl:output message="tns:WriteTagStringValuesOut" />
    </wsdl:operation>
    <wsdl:operation name="GetTagNames">
    <wsdl:input message="tns:GetTagNamesIn" />
    <wsdl:output message="tns:GetTagNamesOut" />
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="TagServiceSoap" type="tns:TagServiceSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
    <wsdl:operation name="ReadTagValues">
    <soap:operation soapAction="#ReadTagValues" style="rpc" />
    <wsdl:input>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:input>
    <wsdl:output>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="ReadTagStringValues">
    <soap:operation soapAction="#ReadTagStringValues" style="rpc" />
    <wsdl:input>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:input>
    <wsdl:output>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="WriteTagValues">
    <soap:operation soapAction="#WriteTagValues" style="rpc" />
    <wsdl:input>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:input>
    <wsdl:output>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="WriteTagStringValues">
    <soap:operation soapAction="#WriteTagStringValues" style="rpc" />
    <wsdl:input>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:input>
    <wsdl:output>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetTagNames">
    <soap:operation soapAction="#GetTagNames" style="rpc" />
    <wsdl:input>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:input>
    <wsdl:output>
    <soap:body use="encoded" namespace="urn:WizWebService" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="TagService">
    <wsdl:port name="TagServiceSoap" binding="tns:TagServiceSoap">
    <soap:address location="http://212.157.43.123:80/wiz_ws/wizws.dll?Handler=TagService" />
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    Here is my web client
    // This class was generated by the JAXRPC SI, do not edit.
    // Contents subject to change without notice.
    // JAX-RPC Standard Implementation (1.1.3, build R1)
    // Generated source version: 1.1.3
    package com.engagenet.protoObj.wizcon;
    import com.sun.xml.rpc.encoding.*;
    import com.sun.xml.rpc.client.ServiceExceptionImpl;
    import com.sun.xml.rpc.util.exception.*;
    import com.sun.xml.rpc.soap.SOAPVersion;
    import com.sun.xml.rpc.client.HandlerChainImpl;
    import javax.xml.rpc.*;
    import javax.xml.rpc.encoding.*;
    import javax.xml.rpc.handler.HandlerChain;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.namespace.QName;
    public class TagService_Impl extends com.sun.xml.rpc.client.BasicService implements TagService {
    private static final QName serviceName = new QName("urn:WizWebService", "TagService");
    private static final QName ns1_TagServiceSoap_QNAME = new QName("urn:WizWebService", "TagServiceSoap");
    private static final Class tagServiceSoap_PortClass = com.engagenet.protoObj.wizcon.TagServiceSoap.class;
    public TagService_Impl() {
    super(serviceName, new QName[] {
    ns1_TagServiceSoap_QNAME
    new com.engagenet.protoObj.wizcon.TagService_SerializerRegistry().getRegistry());
    public java.rmi.Remote getPort(javax.xml.namespace.QName portName, java.lang.Class serviceDefInterface) throws javax.xml.rpc.ServiceException {
    try {
    if (portName.equals(ns1_TagServiceSoap_QNAME) &&
    serviceDefInterface.equals(tagServiceSoap_PortClass)) {
    return getTagServiceSoap();
    } catch (Exception e) {
    throw new ServiceExceptionImpl(new LocalizableExceptionAdapter(e));
    return super.getPort(portName, serviceDefInterface);
    public java.rmi.Remote getPort(java.lang.Class serviceDefInterface) throws javax.xml.rpc.ServiceException {
    try {
    if (serviceDefInterface.equals(tagServiceSoap_PortClass)) {
    return getTagServiceSoap();
    } catch (Exception e) {
    throw new ServiceExceptionImpl(new LocalizableExceptionAdapter(e));
    return super.getPort(serviceDefInterface);
    public com.engagenet.protoObj.wizcon.TagServiceSoap getTagServiceSoap() {
    java.lang.String[] roles = new java.lang.String[] {};
    HandlerChainImpl handlerChain = new HandlerChainImpl(getHandlerRegistry().getHandlerChain(ns1_TagServiceSoap_QNAME));
    handlerChain.setRoles(roles);
    com.engagenet.protoObj.wizcon.TagServiceSoap_Stub stub = new com.engagenet.protoObj.wizcon.TagServiceSoap_Stub(handlerChain);
    try {
    stub._initialize(super.internalTypeRegistry);
    } catch (JAXRPCException e) {
    throw e;
    } catch (Exception e) {
    throw new JAXRPCException(e.getMessage(), e);
    return stub;
         public static void main(String []args)
    try
    TagService_Impl proto = new TagService_Impl();
    TagServiceSoap tSoap = proto.getTagServiceSoap();
    QUALITY Q_ERR = QUALITY.fromString("Q_ERR");
    String tagName[] = {"aem_opc", "aem_ws_test", "wizsys_minute"};
    TagValue[] tValue = tSoap.readTagValues(tagName);
    for(int i = 0; i < 3; ++i)
    if(tValue.getM_Quality().equals(Q_ERR))
    System.out.println("" + tagName[i] + " read failed " + tValue[i].getM_Quality());
    else
    System.out.println("" + tagName[i] + " read failed " + tValue[i].getM_dValue());
    catch(Exception e)
    e.printStackTrace();
    Am I doing any thing wrong. All java files I am using is generated as a result of this command.
    wscompile.bat -verbose -gen -d classes -s src -keep etc/config.xml
    I only add main method in TagService_Impl.java class which I highlighted above.
    Any help is apprecited.
    Thanks
    Shreey

    I stumbled upon this exception when I tried to send a complex type as a return parameter. The sequence in which the server sent the components of the complex type was different from the one the client artifacts expected. And because the deserializer generated by xrpcc can't survive this, it throws the exception that's bothering you.
    It may or may not be the same case with you, this is merely what I had to find out.

  • Help with error message: Expected end of line but got identifier

    The following is a calculated applescript step in a Filemaker script. It tells iCal to go to the date of an iCal event that the script has previously created from Filemaker. The code below keeps generating an error message: "Expected end of line but got identifier." Note: "ACTIVITY::Date" below is Filemaker's way of indicating the file name (ACTIVITY) and the field in question (date). Help appreciated.
    "tell application \" iCal\" ¶
    activate ¶
    switch view to month view ¶
    set theDate to date \"" & ACTIVITY::Date & "\" ¶
    view calendar at theDate ¶
    end tell"

    It's not clear exactly what you're aiming for here, so it's not easy to tell you how to fix it.
    At first glance I'd say you're missing a quote symbol or two, but even then it doesn't make a lot of sense without more context - for example, 'ACTIVITY::Date' isn't valid as an AppleScript variable name (you can't have a : in a variable name), and your code isn't within a Filemaker block, so it doesn't appear to relate to Filemaker, either.
    In either case the only thing that looks remotely valid to me would be:
    set theDate to date "\"" & ACTIVITY::date & "\""
    but without knowing the context of ACTIVITY::Date it's impossible to tell if this is valid, or how it differs from:
    set theDate to date ACTIVITY::Date
    (i.e., why the quotes are needed at all)

Maybe you are looking for