I want to generate custom package using wsdl2java(CXF) command.
My WSDL structure is:
wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:jms="http://www.tibco.com/namespaces/ws/2004/soap/binding/JMS"
xmlns:ns20="http://cdm.test.co.uk/marketing/Promotions/2.0"
xmlns:jndi="http://www.tibco.com/namespaces/ws/2004/soap/apis/jndi"
xmlns:ns16="http://cdm.test.co.uk/common/CrossRef/2.0"
xmlns:ns17="http://services.test.co.uk/service/CommonMessage/2.0"
xmlns:ns14="http://cdm.test.co.uk/banking/Wallet/2.0"
xmlns:ns15="http://cdm.test.co.uk/common/Currency/2.0"
xmlns:ns18="http://cdm.test.co.uk/customer/Transaction/2.0"
xmlns:ns19="http://cdm.test.co.uk/party/PartyRole/2.0"
xmlns:ns9="http://cdm.test.co.uk/common/Channel/2.0"
xmlns:soap1="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:ns12="http://cdm.test.co.uk/banking/Payment/2.0"
xmlns:ns5="http://cdm.test.co.uk/common/InternationalMoney/2.0"
xmlns:ns13="http://cdm.test.co.uk/customer/Account/2.0"
xmlns:ns6="http://cdm.test.co.uk/common/Location/2.0"
xmlns:ns10="http://cdm.test.co.uk/retail/RetailShop/2.0"
xmlns:ns7="http://cdm.test.co.uk/party/Party/2.0"
xmlns:ns11="http://cdm.test.co.uk/common/BaseType/2.0"
xmlns:ns8="http://cdm.test.co.uk/product/Games/2.0"
xmlns:ns2="http://cdm.test.co.uk/common/Country/2.0"
xmlns:ns1="http://cdm.test.co.uk/customer/Customer/2.0"
xmlns:ns4="http://cdm.test.co.uk/partner/Affiliate/2.0"
xmlns:ns3="http:///common/ManagedEntity/2.0"
xmlns:tns="http://services.test.co.uk/service/banking/walletTransaction/TransferFunds/1.0"
xmlns:ns0="http://cdm.test.co.uk/producdm.test.co.ukct/Catalogue/2.0"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="http://services.test.co.uk/service/banking/walletTransaction/TransferFunds/1.0"
I am using below command to generate the java files:
wsdl2java -db xmlbeans -d "D:\MY_PROJECT" wsdllocation
So all the java files are created in uk.co.test.cdm and uk.co.test.services folder.
But I want to generate all files under com.greeting.cdm and com.greeting.services folder. means uk.co.test should be replaced by com.greeting.
I have used this option in the command to change the package: -p com.greeting but this is not working.
Can anyone please give the solution to fix this problem.
You should use lots of -p options. Like this:
wsdl2java -db xmlbeans -d "D:\MY_PROJECT" \
-p http://services.test.co.uk/service/banking/walletTransaction/TransferFunds/1.0=com.greeting.services \
-p http://cdm.test.co.uk/common/Country/2.0=com.greeting.cdm \
-p http://cdm.test.co.uk/customer/Customer/2.0=com.greeting.cdm \
... \
wsdllocation
Related
I have a folder structure as Backup/Date/hostname/*zip.
I want to delete the folder date which has 7 days prior date than current.
I am using below command:
curl -k -u user:pass -X DELETE https://artifactory.test.com/artifactory/Backup/$Date.
But it is deleting the entire Backup artifact from artifactory.
It is to be done by curl, or any other means, but not through jfrog cli because I have to run this in jenkins.
How can this be resolved?
Assuming your date format is ddmmyyyy, try
DATE=$(date --date="7 days ago" +%d%m%Y)
curl -k -u user:pass -X DELETE https://artifactory.test.com/artifactory/Backup/${DATE}
Edit: If from Jenkins, do as below.
withCredentials([usernamePassword(credentialsId: '<your-credsID>', passwordVariable: 'pass', usernameVariable: 'user')]) {
sh '''
DATE=$(date --date="7 days ago" +%d%m%Y)
curl -k -u $user:$pass -X DELETE https://artifactory.test.com/artifactory/Backup/${DATE}
'''
}
I try to write a wrapper script for songbook generation using lilypond, latex and sejda-console (for the pdf part). Everything works so far, but I have a problem with sejda that is giving me nuts.
Here is the relevant part of my code:
for %%i in (%f%) do (
sejda-console.bat extractbybookmarks -f ".\%%~ni.pdf" -o "export\%%~ni\%title%.pdf" -l 2 -p [BOOKMARK_NAME] -e "%title%" --overwrite
)
where f is a ";"-separated list of files. This command works for the first file, but fails for all others. I can't find any difference between the commands that sejda receives. Here is my console output:
make_sheet.bat -t "Live it up" --supress *.lytex
Configuring Sejda 3.2.30
Starting execution with arguments: 'extractbybookmarks -f .\book_drums.pdf -o export\book_drums\Live it up.pdf -l 2 -p [BOOKMARK_NAME] -e Live it up --overwrite'
Java version: '1.8.0_151'
Validating parameters.
Starting task (org.sejda.impl.sambox.ExtractByOutlineTask#28701274) execution.
Opening C:\Users\skr1_\Desktop\Tools\Songbook\Sample\out\.\book_drums.pdf
Retrieving outline information for level 2 and match regex Live it up
Starting extraction by outline, level 2 and match regex Live it up
Found 0 inherited images and 0 inherited fonts potentially unused
Starting extracting Live it up pages 9 9
Created output temporary buffer C:\Users\skr1_\Desktop\Tools\Songbook\Sample\out\export\book_drums\.sejdaTmp2789047920522272436.tmp
Appended relevant outline items
Filtering annotations
Skipped acroform merge, nothing to merge
Ending extracting Live it up
Task progress: 0% done
Moving C:\Users\skr1_\Desktop\Tools\Songbook\Sample\out\export\book_drums\.sejdaTmp2789047920522272436.tmp to C:\Users\skr1_\Desktop\Tools\Songbook\Sample\out\export\book_drums\Live it up.pdf.
Extraction completed and outputs written to org.sejda.model.output.FileOrDirectoryTaskOutput#478190fc[C:\Users\skr1_\Desktop\Tools\Songbook\Sample\out\export\book_drums\Live it up.pdf]
Task (org.sejda.impl.sambox.ExtractByOutlineTask#28701274) executed in 0 seconds
Completed execution
C:\Users\skr1_\Desktop\Tools\Songbook\Sample>(sejda-console.bat extractbybookmarks -f ".\book_general.pdf" -o "export\book_general\Live it up.pdf" -l 2 -p [BOOKMARK_NAME] -e "Live it up" --overwrite )
Configuring Sejda 3.2.30
Starting execution with arguments: 'extractbybookmarks -f .\book_general.pdf -o export\book_general\Live it up.pdf -l 2 -p [BOOKMARK_NAME] -e Live it up --overwrite'
Java version: '1.8.0_151'
Invalid value (File '.\book_general.pdf' does not exist): --files -f value... : pdf files to operate on. A list of existing pdf files (EX. -f /tmp/file1.pdf or -f /tmp/password_protected_file2.pdf:secret123) (required)
Invalid value (File '.\book_general.pdf' does not exist): --files -f value... : pdf files to operate on. A list of existing pdf files (EX. -f /tmp/file1.pdf or -f /tmp/password_protected_file2.pdf:secret123) (required)
C:\Users\skr1_\Desktop\Tools\Songbook\Sample>(sejda-console.bat extractbybookmarks -f ".\book_guitar.pdf" -o "export\book_guitar\Live it up.pdf" -l 2 -p [BOOKMARK_NAME] -e "Live it up" --overwrite )
Configuring Sejda 3.2.30
Starting execution with arguments: 'extractbybookmarks -f .\book_guitar.pdf -o export\book_guitar\Live it up.pdf -l 2 -p [BOOKMARK_NAME] -e Live it up --overwrite'
Java version: '1.8.0_151'
Invalid value (File '.\book_guitar.pdf' does not exist): --files -f value... : pdf files to operate on. A list of existing pdf files (EX. -f /tmp/file1.pdf or -f /tmp/password_protected_file2.pdf:secret123) (required)
Invalid value (File '.\book_guitar.pdf' does not exist): --files -f value... : pdf files to operate on. A list of existing pdf files (EX. -f /tmp/file1.pdf or -f /tmp/password_protected_file2.pdf:secret123) (required)
Even worse, if I copy the commands that sejda receives and paste them as arguments for a new command, everything works fine.
I suspect that something is happening with the working directory in between, but I don't get it.
Also, note that the output includes the command for subsequent passes of the for-loop (starting with "(sejda-console.bat ...") though echo is off. It is not included for the first run, however.
I'm not an expert with programming, especially not with batch, and any help would be very appreciated.
I'd suggest that sejda.bat is changing the current directory.
Try
pushd
call sejda.bat ...
popd
Is it possible to mass rename objects on Google Cloud Storage using gsutil (or some other tool)? I am trying to figure out a way to rename a bunch of images from *.JPG to *.jpg.
Here is a native way to do this in bash with an explanation below, line by line of the code:
gsutil ls gs://bucket_name/*.JPG > src-rename-list.txt
sed 's/\.JPG/\.jpg/g' src-rename-list.txt > dest-rename-list.txt
paste -d ' ' src-rename-list.txt dest-rename-list.txt | sed -e 's/^/gsutil\ mv\ /' | while read line; do bash -c "$line"; done
rm src-rename-list.txt; rm dest-rename-list.txt
The solution pushes 2 lists, one for the source and one for the destination file (to be used in the "gsutil mv" command):
gsutil ls gs://bucket_name/*.JPG > src-rename-list.txt
sed 's/\.JPG/\.jpg/g' src-rename-list.txt > dest-rename-list.txt
The line "gsutil mv " and the two files are concatenated line by line using the below code:
paste -d ' ' src-rename-list.txt dest-rename-list.txt | sed -e 's/^/gsutil\ mv\ /'
This then runs each line in a while loop:
while read line; do bash -c "$line"; done
Lastly, clean up and delete the files created:
rm src-rename-list.txt; rm dest-rename-list.txt
The above has been tested against a working Google Storage bucket.
https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames
gsutil supports URI wildcards
EDIT
gsutil 3.0 release note
As part of the bucket sub-directory support we changed the * wildcard to match only up to directory boundaries, and introduced the new ** wildcard...
Do you have directories under bucket? if so, maybe you need to go down to each directories or use **.
gsutil -m mv gs://my_bucket/**.JPG gs://my_bucket/**.jpg
or
gsutil -m mv gs://my_bucket/mydir/*.JPG gs://my_bucket/mydir/*.jpg
EDIT
gsutil doesn't support wildcard for destination so far (as of 4/12/'14)
nether API.
so at this moment you need to retrieve list of all JPG files,
and rename each files.
python example:
import subprocess
files = subprocess.check_output("gsutil ls gs://my_bucket/*.JPG",shell=True)
files = files.split("\n")[:-1]
for f in files:
subprocess.call("gsutil mv %s %s"%(f,f[:-3]+"jpg"),shell=True)
please note that this would take hours.
gsutil does not support parallelized and mass-copy/rename.
You have two options:
use a dataflow process to do the operation
or
use GNU parallel to launch it using several processes
If you use GNU Parallel, it is better to deploy a new instance to do the mass copy/rename operation:
First: - Make a list of files you want to copy/rename (a file with source and destination separated by a space or tab), like this:
gs://origin_bucket/path/file gs://dest_bucket/new_path/new_filename
Second: Launch a new compute instance
Third: Login in that instance and install Gnu parallel
sudo apt install parallel
Third: authorize yourself with google (gcloud auth login) because the service account for compute might not have permissions to move/rename the files.
gcloud auth login
Make the copy (gsutil cp) or move (gsutil mv) operation with parallel:
parallel -j 20 --colsep ' ' gsutil mv {1} {2} :::: file_with_source_destination_uris.txt
This will make 20 parallel runs of the gsutil cp operation.
Yes, it is possible:
Move/rename objects and/or subdirectories
I am rather new to bioinformatic but trying my best to learn. I am running into an issue and I was hoping someone would know what to do, and explain me how bash tool for multiple file is actually working.
I have a folder with 160 RNAseq libraries unzip just look like name.fastq.
I want to run cutadapt (a software which will remove all the adapters sequence from my libraries) on all of them at the same time; so, for one library, the command looks just like this:
python2.6 /imports/home/w/workshop/oibc2013/oibc1/Apps/cutadapt-1.2.1/bin/cutadapt -a name_adapter input_file.fastq > out
So I tried to make a bash array loop to be able to do it on all 160 files I have, but it still does not work.
!/bin/bash
. $HOME/.bashrc
my_array=(*.fastq)
echo ${myarray["SGE_TASK_ID"-1]}
python2.6 \
/imports/home/w/workshop/oibc2013/oibc1/Apps/cutadapt-1.2.1/bin/cutadapt \
-a CTGTCTCTTATACACATCT \
-b AATTGCAGTGGTATCAACGCAGAGCGGCCGC \
-b GCGGCCGCTCTGCGTTGATACCACTGCAATT \
-b AAGCAGTGGTATCAACGCAGAGTACATGGG \
-b CCCATGTACTCTGCGTTGATACCACTGCTT \
inputs.$SGE_TASK_ID \
results.$SGE_TASK_ID]}
Rather than an array, you just want a loop. In this case, since you're matching a glob pattern (*.fastq), a for ... in loop would make sense.
The general syntax is for variable_name in list_of_words; do something_with $variable_name; done;. In your case:
#!/bin/bash
. $HOME/.bashrc
path=/imports/home/w/workshop/oibc2013/oibc1/Apps/cutadapt-1.2.1/bin
for file in *.fastq
do
python2.6 "$path"/cutadapt -a name_adapter "$file" > "$file.out"
done
How to post 5000 files to Solr server?
While posting by using command "java -jar post.jar dir/*.xml", command tool tells Argument list is too long.
The quickest solution would be using a bash script like the following:
for i in $( ls *.xml); do
cat $i | curl -X POST -H 'Content-Type: text/xml' -d #- http://localhost:8080/solr/update
echo item: $i
done
which adds to Solr, using curl, all the xml files within the current directory.
Otherwise you can write a Java main similar to the one included in post.jar, which adds all the xml files within a directory instead of having to pass all of them as arguments.