I have to set up a connection to a webservice that I don't own, all I have is a link to the WSDL file. The webservice has only one method, and I need access to it. I'm trying to use the standard "Generate Java Code from Wsdl or Wadl" (or create New->Web Service Client, which ends up in the same spot)
When I enter the URL I have, the status line says "Wsdl url connection exception". If I put the url in a browser, it nicely displays the xml file, so the URL works. I have a similar problem trying to generate the code in eclipse, where it also refuses to acknowledge the URL.
It's the first time I do anything webservice related and it's driving me mad, how do I fix this?
Related
I am developing an application to send a text message/sms to a user base and receive their responses. I have been given a wsdl which I have used to consume the service to sendsms using netbeans IDE .So far so good.
Now the problem is when I receive a text message a soap request is posted over to a location on our server. The request-response is as follows:
<a>http://www.csoft.co.uk/sms/api/sms_to_soap.htm</a>
I have checked the provider's sample API section but they do not have any material that does something similar.
My question is how do I parse the soap request and send the corresponding response? Also I have to check the messages and filter them for offensive/obscene content. I have the wsdl, xsd, java classes generated by netbeans, but I cant get around how to use them to achieve the goal. Any help or a pointer in the right direction would be greatly appreciated.
Thanks
Kalyan
Please search Stackoverflow and Google, there is plenty of howto around.
Even in this question, just check on the right at "related".
While deploying my app to mochahost, I met the problem between servlet and GWT-RPC communicate. The error shows:
HTTP Status 404 - /403.shtml
type Status report
message /403.shtml
description The requested resource (/403.shtml) is not available.
.war file works perfectly on my workstation, but not working on mochahost.
Any ideas to solve it?
Thanks in advance.
Mochahost have a very good support, try livechatting with their tech department, you will probably have the thing solved.
That's what I do.
Make sure you update live site URL. For instance, generally, on local system you access web app as http://localhost:8080/myapp but, on server it changes to http://[www.]myapp.com. Again, this is just an instance. The point is, the live site must reflect correct URL from code (servlet/JSP/action/etc...) and configuration properties, if any.
Comment 'DirectoryIndex' property in .htaccess file if you do not have any index file.
Comment 'RewriteCond' property in .htaccess file if you do not have any rewrite requirement.
For sure, one of the reason - if client does not accept cookies and servlet does not encode URL.
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.
IOException Error in getContentFromUrl method: java.io.FileNotFoundEx
We are trying to hit a URL: http://somewebsite.com/somefolder/dosomething?zip=75070&servCat=1
It used to generate an XML file on the fly and get us. All of a sudden it started giving us that error. When we access the URL from any computer and even on the actual server, we can see the XML file. Just not on the application itself.
I would think that the somewebsite.com does not point to itself? try doing an nslookup and verify that it is getting the correct IP.
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.