Web Service client - Service definition selected is invalid - java

i am building a web service on eclipse using Apache AXIS 2 Webservice runtime using Apache Tomcat server (apache-tomcat-7.0.23) while running it on tomcat server it sucessfully shows that the web service is running...
But while creating Webservice client to test the web service and using the wsdl url in the server definition (http://localhost:9090/Axis2WSTest/services/Converter?wsdl), this gives below mentioned error and not letting me to create Webservice client:
The service definition selected is invalid
Can you please suggest me the error and possible solution for it?

The problem could be that your wsdl needs http authentication. I was getting the same error in eclipse, but it was because the server I was connecting to needed authentication and was returning a 401 error, so eclipse was saying it wasn't a wsdl. Eclipse doesn't seem to have the functionality to prompt for authentication, I was able to generate a client in netbeans using the same wsdl url because netbeans knows to ask for authentication.
Generate client from http authenticated wsdl

I was searching for the whole day for an answer for this,generally localhost will be added in your bypass proxy list and hence you will not encounter an error.
Go to windows--> preference-->general--> network-connection and see whether localhost is listed in your proxybypass list.If you are trying to access a external wsdl link and you under
some corporate network having proxy firewall you have to set http proxy/https proxy.

Is this how you are trying to generate client stub ?? If yes, just simply create a java project in eclipse, click on it, then press Ctrl+N, select web service client and enter your wsdl url. (make sure you have made sure you can access the wsdl url, by simply giving it in a browser).

Try replacing localhost with the actual IP address. I was facing the same problem and it worked for me this way

I had exactly same situation. For me the following worked:
I got the lead from rdp's response - "Try replacing localhost with the actual IP address. I was facing the same problem and it worked for me this way"
Using IP didn't work for me. What worked for me:
Instead of - http://servername/SomeWebService/Service.asmx?WSDL
putting FQDN for servername. For example -
http://servername.my.company.com/SomeWebService/Service.asmx?WSDL

I had the same issue and I was able to generate the stubs using soapUI. Please follow the this post. Which contains GENERATING CLIENT JAVA CODE FOR WSDL USING SOAP UI – AXIS2 WSDL2JAVA. Before that please download apache axis2 binary from here and extract it.

Related

Access JIRA on HTTPS Server Using API

I am trying to access JIRA (Hosted on HTTPS server, JIRA URL Starts with HTTPS) but it is throwing an Error message .
--javax.net.ssl.SSLHandshakeException: General SSLEngine problem
I am using AsynchronousJiraRestClientFactory().createwithBasicHttpAuthentication(uri,uusername,password)
Please help me getting through this issue , i want to access a prject location in JIRA and drop a bug into it.
Normally in Local machine , self installed Jira Work Fine with This Code as it has no Https Url.
Do i need Some Certificates for that , if yes ..who provides them and how i have to use them in the Code.

Thoughtworks Go Agent : Registration configuration

Today only I heard about the Thoughtworks GO and started the installation configuration. Windows Installation is went well and I am able to run the server over HTTP using 8153 ports.
Then I have installed agent in the same box using the localhost. What i am not able to figure out is how to connect the agent automatically using HTTP ? I am getting error in the go agent log that is trying to access the https : //localhost :8153 I am right now not concerned with HTTPS and all. all I want to register the Agent.
One more thing just for FYI. I have enabled user authentication file based. that is working fine.
Please suggest if there is alternate way to change the URL Protocol to HTTPS.
Finally I run the manual installation by downloading the zip for the go server and then I got the server running with both HTTP and HTTPS without any additional efforts.
This answer will be useful is the installation is having issue with the windows installer. Use the zip.
Thanks.
Praveen

Calling webservice through a proxy

I want to call a webservice .
I created a webservice client in netbeans, and gave WSDL url.
It generated the classes for me.
Where can I give the proxy details, and the ws authentication paramaeters.
WSDL generation goes on fine, but while executing the client it gives me error"HTTP status code 502: Proxy Error"
I am using java 1.7, netbeans 7.3
Assuming that you are using JAX-WS, then this page in the NetBeans documentation says how to do it:
"3) ... If you are behind a firewall, you might need to specify a proxy server—otherwise the WSDL file cannot be downloaded. To specify the proxy server, click Set Proxy in the wizard. The IDE's Options window opens, where you can set the proxy universally for the IDE."

Axis 2 (1.6.1) client webservice Basic Auth

I´m trying to implement a client webservice (AXIS 2 1.6.1) in JBoss 5.1.0 GA.
I´ve generated the stubs and the first invocation (to a mockService) works fine.
Now i want to invoke my web service (without the mockService) and i need to inplement the Basic-Authentication.
I already implements the basic authentication code and i´m almost sure that there isn´t a bug in the code.
HttpTransportProperties.Authenticator basicAuth = new HttpTransportProperties.Authenticator();
basicAuth.setUsername("userName");
basicAuth.setPassword("password");
basicAuth.setPreemptiveAuthentication(true);
stub._getServiceClient().getOptions().setProperty(HTTPConstants.AUTHENTICATE, basicAuth);
Since i can make a invocation using the SOAP UI, i strongly believe that my problem is that i haven´t set my
"WWS-Password Type" and "WWS TimeToLive" (i have the same error message when i disable these properties on the SOAP-UI).
I think that i may need to put a axis2.xml in the server to put these properties but...
When do i put my configuration file (in JBoss)? Or where do i define the path to this file?
Or there is something else?
Thanks all.
Note: I tried unsucessfully this solution:
Adding User/Password to SOAPHeader for WebService client call with AXIS2
My error is:
Exception in thread "main" org.apache.axis2.AxisFault: Internal Error (from server)
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at myPackage.process(MyStub.java:187)
P.S- Note that the server web service communicate over https.
P.S.2 - Tks Edward
Just for the record, i´ve resolved the problem using the solution in Adding User/Password to SOAPHeader for WebService client call with AXIS2 .
I had a misspelled tag (in this case, the user tag).
Thanks a lot.

how can i generate a web service proxy behind https and client certificate request

I'm trying to generate a web service client with eclipse (I also tried with jdeveloper and netbeans). The WSDL is behind a https server with client certificate request.
I can connect and generate the classes with this command:
java -Djavax.net.ssl.trustStore=testes.keystore -Djavax.net.ssl.keyStore=testes.keystore -Djavax.net.ssl.trustStorePassword=123 -Djavax.net.ssl.keyStorePassword=123 -Dsun.security.ssl.allowUnsafeRenegotiation=true -jar D:\Java\jdevstudio10134\webservices\lib\wsa.jar -genProxy -wsdl https://urlxpto?wsdl
But then I get an error about a ActionMismatch. Probably this error comes from the library I'm using so I want to try with axis. If I use the wizard in eclipse it gives an error when trying to connect. The same happens with jdeveloper or netbeans.
So the question is: How do I do it? How to generate a web service proxy with an IDE?
Or the question can be: how do I change the message part to match the action part in a soap request?
Thanks!
I guess I can't use the classic wizard to generate a web service client that is behind https with client certificate request.
The only way I can think of and that worked for me was:
install the needed certificates in a browser;
manually download the WSDL xml document;
manually download every xml documents that the WSDL refers to, that are in the same domain;
alter the WSDL to point to the xml files on disk instead of pointing to urls where those documents are;
build the client with genproxy or WSDL2Java or with a wizard against the WSDL on disk
alter the code to point to the original URLs;
finally add the keystore details to the generated client;
I still have some problems but I can now connect and "talk" with the server.

Categories