Generate client from http authenticated wsdl - java

I'm trying to generate a web service client with the eclipse Web Service Client wizard. However, the wsdl needs http authentication, and haven't found a way to enter the authentication information.

Open the wsdl in a browser and enter the login information when prompted. Once the wsdl opens save it to a file on your hard drive. Use the file with eclipse to generate your code. Then you may have to replace the endpoint value in the java code created because it will contain the location of the file instead of the deployed wsdl. I've had to do it this way a couple of times to get around the authentication piece.

Related

Sharepoint 2013 WSDL Authentication Java

I am trying to create application to manage sharepoint. I got some of WSDL files for my sharepoint site. while doing authorization. whether I have to pass Username(mailed) and passoword to get response from the sharepoint server. or whether I have encrypt my username or password while sending through WSDL Request?
Kindly help to resolve my issue.strong text
I tried through Java, SO i converted all WSDL files to Java Class. But the server give response like Password Not Match all the time. even if i send correct password

Access Web service from java when wsdl file is known

I am trying to access a web service in the remote system by using java code. I take the WSDL URL from the XMethods registry and download the WSDL file from that location. I parse the WSDL file and display the list of operations and their Input and Output parameters and type. I will get the Input from the user according to the Information I got from the WSDL file. Now What I am need is I need to display the user the corresponding output from the Webservice. For this what is the easiest method to consume the Webservice. I dont have any Idea. Please anyone can help me??? Thanks in advance.
you can user axis2 jar framework to consume the webservice. Axis2 jar's generate the dependency files to consume the web service. Use this link to create client files.
http://javapapers.com/web-service/axis2-web-service-using-eclipse/

Getting services.wsdl for Microsoft Exchange online

I am trying to write a small Java client for consuming services provided by Microsoft Exchange server through Exchange Web Services (EWS). For experimenting I set up Exchange Online account from here.
Then I configured my Outlook client to use the newly created mail on exchange and outlook's Test Email Auto-Configuration windows I tried to retrieve the link for Services.wsdl for that client:
Then I tried hitting Availability Services url, entered the username and password and it opened following page:
I then tried to hit the url specified on that page for service.wsdl, but it gave Page Not Found error. SO
Q1 where will I get WSDL file, and
Q2 which link should I hit while developing Java client. In my office environment I get WSDL file over configured Exchange server which directly opens WSDL file but am guessing what should be in case of exchange online.
Q1 - The WSDL file can be downloaded from the Exchange server endpoint that you wish to hit. I don't have credentials to try this, but this should work:
https://outlook.office365.com/EWS/Services.wsdl
It's usually in the EWS directory and named Services.wsdl. I just looked at your other screenshots above and inferred the same format.
Q2 - For Office 365 (which you are testing with), Microsoft recommends this approach for manually finding the URL to hit for API calls. (Alternative much more detailed desciption here: How to get services.wsdl for Office 365?)
However building the stubs yourself and finding URLs to invoke is a lot of work that you don't have to do if you use a pre-built Java library such as Microsoft's own EWS Java API or this 3rd party library. They both do basically the same thing, which is to expose Java classes in a Jar that allow you to make calls to any Exchange server. They will also take care of automatically discovering the URL to use, if you wish (it's a feature called Autodiscover).

How to create a webservice client to a secure webservice at localhost

I have created a webservice and it has deployed on localhost. When I browse the WSDL using browser https://localhost:8181/Test/TestOne?wsdl it shows me the WSDL.
But when I try to create client program (I am using NetBeans 7.0) and give this URL for the WSDL URL, it shows me error message that wsdl Problem with downloading wsdl or schema file..... I tried editing the proxy to use system proxy settings also but no luck. Am I doing something wrong or is this a bug in NetBeans?
I think your server doesn't use a certificate signed by CA. So, you need to create a keystore with certificate and pass "-Djavax.net.ssl.trustStore=" parameter to NetBeans.
Open the wizard for setting the attributes for the WebService: right mouse click on the Web Service reference in the client application, choose Edit WebService Attributes, go to Wsimport options tab, and correct the property wsdlLocation as follows:
from: https://<address>:8181/<ws-url>?wsdl
to: /META-INF/wsdl/<address>_8181/<ws-url>.wsdl
more info here

Make two servers talk to each other

I have application written in GWT and hosted on Google AppEngine/Java. In this application user will have an option to upload video/audio/text file to the server. Those files could be big, up to 1gb or so and because GAE/J does not support large file I have to use another server to store those files. This would be easy to implement if there was no cross-domain security feature in browsers. So, what I'm thinking is to make GAE Server talk to my server (Glassfish or any other java servers if needed) to tell url to the file and if possible send status of uploaded file (how many percent was uploaded) so I can show status on clients screen. Here is what I'm thinking to do.
When user loads GWT page that is stored on GAE/J he/she will upload file to my server, then my server will send response back to GAE and GAE will send response to the client.
If this scenario is possible what would be the best way to implement GAE to Glassfish conversation?
Actually before that maybe you can try using first approach via by-passing cross-domain security of browsers using iframe. There are some ready to use components for this but for your problem which of them can be usable I don't know. Just google for these components...
Doing it the original way you suggested use URL Fetch Service
The down side to doing it the other way is that you introduce dependencies on multiple sites inside your web pages.
The downside of using the URL Fetch Service is that you have to pay by number of bytes transferred after you have reached the free quota.
One option would be to wait - the blobstore limit won't always be 50MB!
If you're in a hurry, though, I would suggest an approach like the following:
Have your App Engine app generate a signed token that signifies the user has permission to upload a file. The token should include the current date and time, the user's user ID, the maximum file size, and any other relevant information, and should be signed using HMAC-SHA1 with a secret key that your App Engine app and your server both know.
Return a form to the user that POSTs to a URL on your blob hosting server, and embeds the token you generated in step 1. If you want progress notifications, you can use a tool like plupload, and serve the form in an IFrame served by your upload server.
When the user uploads the file to your server, the server should return a redirect back to your App Engine app, with a new token embedded in the redirect URL. That token, again signed with a common secret, contains the ID of the newly uploaded file.
When your App Engine app receives a request for the redirect URL, it knows the upload was completed, and can record the new file's ID etc in the datastore.
Alternately, you can use Amazon's S3, which already supports all this with its HTML Form support.

Categories

Resources