Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Alignment API
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab upgrade completed. Current version is 17.11.3.
Show more breadcrumbs
moex
Alignment API
Commits
e0e7827f
Commit
e0e7827f
authored
15 years ago
by
Jérôme Euzenat
Browse files
Options
Downloads
Patches
Plain Diff
- fully dealt with parameters in REST messages
parent
dfe7d0ff
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/wservice/AlignmentClient.java
+39
-10
39 additions, 10 deletions
examples/wservice/AlignmentClient.java
with
39 additions
and
10 deletions
examples/wservice/AlignmentClient.java
+
39
−
10
View file @
e0e7827f
...
...
@@ -78,13 +78,6 @@ public class AlignmentClient {
services
=
new
Hashtable
();
// Read parameters
Properties
params
=
readParameters
(
args
);
if
(
SERVUrl
==
null
)
SERVUrl
=
"http://"
+
HOST
+
":"
+
HTML
;
SOAPUrl
=
new
URL
(
SERVUrl
+
"/aserv"
);
RESTStr
=
SERVUrl
+
"/rest"
;
if
(
outfile
!=
null
)
{
// This redirects error outout to log file given by -o
System
.
setErr
(
new
PrintStream
(
outfile
)
);
}
if
(
debug
>
0
)
{
System
.
err
.
println
(
"***** Parameter parsed"
);
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++
){
...
...
@@ -92,6 +85,13 @@ public class AlignmentClient {
}
System
.
err
.
println
();
}
if
(
SERVUrl
==
null
)
SERVUrl
=
"http://"
+
HOST
+
":"
+
HTML
;
SOAPUrl
=
new
URL
(
SERVUrl
+
"/aserv"
);
RESTStr
=
SERVUrl
+
"/rest"
;
if
(
outfile
!=
null
)
{
// This redirects error outout to log file given by -o
System
.
setErr
(
new
PrintStream
(
outfile
)
);
}
// Create the message (SOAP Message or REST URI)
String
message
=
createMessage
(
params
);
...
...
@@ -179,7 +179,7 @@ public class AlignmentClient {
messageBody
+=
" <wsmethod>"
+
arg4
+
"</wsmethod>\n"
;
RESTParams
+=
"¶mn2=wsmethod¶mv2="
+
arg4
;
}
messageBody
+=
"
<force>on</force>"
;
messageBody
+=
"
<force>on</force>"
;
RESTParams
+=
"&force=on"
;
//we do not need this command from WS client
}
else
if
(
cmd
.
equals
(
"align"
)
)
{
...
...
@@ -295,13 +295,42 @@ public class AlignmentClient {
// Create input message or URL
String
message
;
if
(
rest
)
{
message
=
RESTAction
+
"?"
+
RESTParams
;
message
=
RESTAction
+
"?"
+
RESTParams
+
addParams
(
params
)
;
}
else
{
message
=
messageBody
;
message
=
messageBody
+
addParams
(
params
)
;
}
return
message
;
}
public
String
addParams
(
Properties
params
){
String
opt
=
""
;
int
i
=
5
;
for
(
Object
ko
:
params
.
keySet
()
){
String
k
=
(
String
)
ko
;
if
(
!
k
.
startsWith
(
"arg"
)
&&
!
k
.
equals
(
"host"
)
&&
!
k
.
equals
(
"debug"
)
&&
!
k
.
equals
(
"command"
)
)
{
if
(
rest
)
{
opt
+=
"¶mn"
+
i
+
"="
+
k
+
"¶mv"
+
i
+
"="
+
params
.
getProperty
(
k
);
i
++;
}
else
{
opt
+=
" <param name=\""
+
k
+
"\">"
+
params
.
getProperty
(
k
)+
"</param>\n"
;
// opt += " <"+k+">"+params.getProperty(k)+"</"+k+">\n";
}
}
}
return
opt
;
}
public
String
addSOAPParams
(
Properties
params
){
String
opt
=
""
;
for
(
Object
ko
:
params
.
keySet
()
){
String
k
=
(
String
)
ko
;
if
(
!
k
.
startsWith
(
"arg"
)
)
{
}
}
return
opt
;
}
public
HttpURLConnection
sendRESTMessage
(
String
message
,
Properties
param
)
throws
Exception
{
URL
RESTUrl
=
null
;
URLConnection
connection
=
null
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment