wsimport with special character and Xauthfile - web-services

I'm facing the same problem that this guy here:
wsimport Xauthfile error
Since he didn't gave a feedback and I'm new here and can't ask him if he solved his problem I'm opening a new question.
I'm using ubuntu and have JDK7 from java oracle installed.
I'm consuming a thirdparty web service. The password (...GT##ED...) for the webservice have a character that conflicts with de -Xauthfile syntax (http[s]://user:password#host:port//) because of the "#". The dots (...) represents the rest of my password.
Here is the command I'm running:
wsimport -p loa -Xauthfile "path_to_auth.txt" https://myWS?wsdl
In my auth.txt file I have:
https://user:...GT##ED...#myWS?wsdl
In return a get
parsing WSDL...
[ERROR] Server returned HTTP response code: 401 for URL: https://myWS?wsdl,
"https://myWS?wsdl" needs authorization, please provide authorization file with
read access at /home/user_name/.metro/auth or use -Xauthfile to give the
authorization file and on each line provide authorization information using this
format : http[s]://user:password#host:port//<url-path>
I search all over the net, but no success.
When I try to import the WS using SoapUI like in this tutorial I got a
[ERROR] sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid
certification path to requested target
and I don't know where to specify the ssl file for SoapUI. I tryed in
preferences -> SSL Settings
but no lucky.
That's it. I'll apreciate any help.
EDIT
OK, so I pass through the authorization, changing the characters using the HTML URL Encoding Reference, but now I'm getting the following error
[ERROR] Server redirected too many times (20), "https://ws?wsdl" needs
authorization, please provide authorization file with read access at /home/user
/.metro/auth or use -Xauthfile to give the authorization file and on each line
provide authorization information using this format :
http[s]://user:password#host:port//<url-path>

I am using Apache axis2 instead of wsimport. first this problem happened for me, and I write a bash script and it worked.
#!/bin/bash
/axis2-1.7.9/bin/wsdl2java.sh -uri http://username:password#domain/x?wsdl
I also use encoding password and username by 'url encoding' such as bellow:
##%g3E99! -(URL encoding)-> %40%23%25g3E99%21

First create auth.txt file where you need to put the following and save it in C drive:
http://username:password#localhost:port/wsdlurl
Now run the following command:
wsimport -Xauthfile C:\auth.txt -keep http://example.com/test?wsdl
This worked for me.

Related

RequestDumperValve breaks POST request

I have an historic ColdFusion 9 server running on top of JBoss 5.1 on Scientific Linux 6.2.
Every once in a while I see the error
2019-08-20 12:15:30,621 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/REDACTED].[CfmServlet]] (ajp-0.0.0.0-8009-8) Servlet.service() for servlet CfmServlet threw exception
javax.servlet.ServletException: ROOT CAUSE:
java.lang.IllegalArgumentException
at coldfusion.filter.FormScope.parseQueryString(FormScope.java:375)
at coldfusion.filter.FormScope.parsePostData(FormScope.java:346)
at coldfusion.filter.FormScope.fillForm(FormScope.java:296)
at coldfusion.filter.FusionContext.SymTab_initForRequest(FusionContext.java:377)
in the file /var/log/jboss/server.log
To find out what seems to be the problem I thought it's somehow possible to log the POST params JBoss received and is trying to prepare for ColdFusion to use. On the internet I read I should go to file /opt/jboss/server/default/deploy/jbossweb.sar/server.xml and uncomment the line <Valve className="org.apache.catalina.valves.RequestDumperValve" />.
Now, the params (cookie, header, POST etc.) are indeed logged into the server.log file. The ColdFusion server, however, does not do its task anymore. I open CFADMIN in the browser and enter the password. I'm not let in. I, again, see the log-on page. Same is true for my application. I see in the server.log file the parameters (username and password) are correct. They are logged in clear text.
There's a story on the internet that describes how the RequestDumperValve destroys a request by applying wrong encoding. Does something like this happen to me? Are there other possibilities to log the POST params in JBoss?

WSO2 EI611 FTP url for inboundendpoint FILE invalid, throws error

[2017-10-31 18:38:43,008] [] ERROR - FilePollingConsumer Repeatedly
failed to resolve the file URI:
ftp://username":#"servername/folder/folder/folder/
org.apache.commons.vfs2.FileSystemException: Invalid absolute URI
"ftp://username":#"servername/folder/folder/folder/".
Caused by: org.apache.commons.vfs2.FileSystemException: Expecting / to
follow the hostname in URI
"ftp://username":***#"servername/folder/folder/folder/".
Tried several options, still not working. I used FTP url syntax/format from previous StackOverflow WSO2 postings and product documentation, but did not work. what am I doing stupid?
adding vfs.passive=true in the FTP URL did the magic. FTP inbound endpoint works fine.

Google speech to text authentication access token expiry issue

I am using google speech to text api and followed all the steps mentioned in below link :
https://cloud.google.com/speech/docs/getting-started
When I used the commands using command line interface mentioned in above page, everything seems fine and I am getting the output text as well.
But, if I create a php file for the same commands then it is working fine for 1 hour and then the token expires. And also not creating the token with below command via php file :
shell_exec(gcloud auth activate-service-account --key-file=/keyfile.json)
shell_exec(gcloud auth print-access-token)
But the same command is working very fine on command line system.
So basically I am having issue with the authentication process via php file and getting the below error :
"error": { "code": 401, "message": "Request had invalid authentication credentials.", "status": "UNAUTHENTICATED" } }
Can anyone please tell what I am missing or am I following the wrong approach for authentication?
Reproduced successfully and ran again the php file after one hour and then 2 hours with the same result: no errors. You may consider providing more detail, maybe by including directives such as ini_set('display_errors', 'On'); error_reporting(E_ALL); in your file.
A relevant read about the on-hour expiry of credentials is to be found at [1], in the 401-error sub-chapter.
[1] https://cloud.google.com/storage/docs/xml-api/reference-status

Web service using Lotus notes

when am trying to WSDL using lotus script i got following error, any one help me
"Error: client:WSDLreader:Loading of the wsdl file failed HRESULT=0x80070057-WSDLReader:xml Parser failed at linenumber 1, lineposition 63, reason is required white space was missing.HRESULT=0x1Line:7"
It sounds like an error with the WSDL file. See if you can verify it with an online WSDL checker.
Also, make sure you have specified the correct endpoint URL.
That error normally means that the structure of the WSDL is broken. For example if you got a 404 page back instead of WSDL from the server.
First try opening the WSDL File via a browser and check it to make sure you only get the WSDL back.
Your URL above has at the end:
?WSDL%22
The %22 looks wrong.
Second you can test your WSDL using a tool like SOAPUI. http://www.soapui.org
There is a tutorial on the Wiki at this location:
http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Testing_your_Domino_web_service_provider_and_consumer_using_SoapUI._

Error 403.14 when installing WebService on IIS7

I try to install my WebService on IIS7, but I get this error:
HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory
on IIS5 I know how to do it, can I get any direction ?
You should use the correct URL, such as http://localhost/somepath/someservice.asmx (or .svc) If you don't specify the service part, of course you get 403.14.