wsdl webservice from Outlook Web App
I’m trying to figure out what the Webservice for an Outlook Web App (OWA) can provide me with.
So far, this doesn’t work but I hope I’ll manage to get it to work during this post.
I had the URL for webservice. It look something like this:
https://exchange.myuniversity.edu/EWS/Services.wsdl
Then I wanted to create the client-class-stubs via wsimport . I tried running wsimport from the command line.
First problem: I have to use a proxy. As wsimport works from the console I tried setting the proxy there. As I use Windows 7 proxycfg wasn’t the correct command any more but I had to use
netsh winhttp set proxy proxy.mycompany.com:3128
In case you have put explicity proxy information into the system settings of IE netsh winhttp import proxy source=ie might help. But I only have an automatic configuration there and that didn’t carry over to the command line proxy configuration.
Then I figured that wsimport had it’s own proxy argument and I could get the result via:
wsimport -httpproxy:proxy.mycompany.com:3128 https://exchange.myuniversity.edu/EWS/Services.wsdl
This got me the following error message:
[ERROR] Server returned HTTP response code: 401 for URL: https://exchange.myuniversity.edu/EWS/Services.wsdl, "https://exchange.myuniversity.edu/EWS/Services.wsdl" needs authorization, please provide authorization file with read access at C:\Users\winusername\.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>
So I created a file myuni.txt with the line:
https://uniaccountname:unipassword@exchange.myuniversity.edu/EWS/Services.wsdl
(At first I mistakenly thought that I was supposed to download the SSL certificate, but that wasn’t the case.)
I than ran:
wsimport -httpproxy:proxy.mycompany.de:3128 -Xauthfile myuni.txt https://exchange.myuniversity.edu/EWS/Services.wsdl
However I ran into:
parsing WSDL... [ERROR] Server redirected too many times (20), "https://exchange.myuniversity.edu/EWS/Services.wsdl" needs authorization, please provide authorization file with read access at C:\Users\winusername\.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 didn’t know how to solve this, so followed Ravi C Kota’s suggestion on Code Ranch to just download the wsdl-file.
However I than got:
At least one WSDL with at least one service definition needs to be provided. Failed to parse the WSDL.
Maybe I have the same problem as Henning Mahlzahn over at social.technet.microsoft.com.
Unfortunately Henning Mahlzahn only links to the URL
saying it describes how to change the wsdl file. As this URL is down, I tried to figure out how to correct my wsdl by looking at the amazon.wsdl file at:
http://soap.amazon.com/schemas2/AmazonWebServices.wsdl
Infering from that file I added a service definition in my wsdl file before the last line and after the last </wsdl:binding>. Including the two surrunding lines I had:
</wsdl:binding> <wsdl:service name="ExchangeService"> <wsdl:port name="ExchangeServicePortType" binding="tns:ExchangeServiceBinding"> <soap:address location="http://schemas.xmlsoap.org/wsdl/soap/"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
Where I made up the name “ExchangeService”, an I got the names for port and binding from the lines:
<wsdl:portType name="ExchangeServicePortType">
and
<wsdl:binding name="ExchangeServiceBinding" type="tns:ExchangeServicePortType">
(On my first try I forgot the “wsdl:”-namespace in front of the port so I got the following error:
parsing WSDL…
Exception in thread “main” com.sun.tools.internal.ws.util.WSDLParseException: Encountered error in wsdl. Check namespace of element <port>
Now the parsing worked a little further and I got to the point where I need the file
parsing WSDL... [ERROR] C:\cwd\messages.xsd (Das System kann die angegebene Datei nicht finden) [WARNING] schema_reference.4: Failed to read schema document 'messages.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. line 5 of file:/C:/crw/modified.Services.wsdl.xml#types?schema1
So I had to download all the files Henning Malzahn listed in his posting: : Services.wsdl, messages.xsd and types.xsd
Those files are located in the same directory on your exchange server as the wsdl. In my case:
https://exchange.myuniversity.edu/EWS/messages.xsd
Running wsimport now got me the new errors:
parsing WSDL... [WARNING] src-resolve: Cannot resolve the name 'xml:lang' to a(n) 'attribute declaration' component. line 3921 of file:/C:/cwd/types.xsd [WARNING] s4s-elt-invalid-content.1: The content of 'ReplyBody' is invalid. Element 'attribute' is invalid, misplaced, or occurs too often. line 3921 of file:/C:/cwd/types.xsd [ERROR] undefined attribute 'xml:lang' line 3921 of file:/C:/cwd/types.xsd
Those errors all reference some line in types.xsd. As the line had a “use=\”optional\”" attribute, I thought I could just comment it out. So I had the following:
<xs:complexType name=”ReplyBody”>
<xs:sequence>
<xs:element minOccurs=”0″ maxOccurs=”1″ name=”Message” type=”xs:string”/>
</xs:sequence>
<!– <xs:attribute ref=”xml:lang” use=”optional”/>–>
</xs:complexType>
All these changes resulted in compiling code:
parsing WSDL…
generating code…
compiling code…
Note: C:\cwd\.\com\
microsoft\schemas\exchange\services\_2006\messages\ObjectFactory.java uses unche
cked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Now I had to check whether I could use the Web Service features from within Java and I wasn’t too sure about it because I had come across a posting by cheeso on Connecting to Exchange using JAX-WS, part 1 – All About Interop – Site Home – MSDN Blogs where he lists these things he had to do before he was able to use the Web Service:
Let me summarize what I did to get Java to talk to Exchange:
- Modified the exchange.wsdl to include a service definition, and to remove all occurrences of impersonation, S2SAuth, and MailboxCulture from each wsdl:message.
- Modified the types.xsd to eliminate the ref=”t:Path”, and replace it with actual elements
- Use Fiddler2 to trace and debug the SOAP messages.
I forgot to add the -keep option to my wsimport statement. I added it in order to get coding help from eclipse.
At this point I stopped trying for now. What I did was trying to use the amazon web service but it then I read that amazon’s webservice based on soap is not compatible with JAX-WS and that one should use JAX-RPC. Now I wonder whether exchange is compatible.
Android ViewMap example – a beginner’s very basic observations
Hi,
I’m just got an eclipse project containing code coming from http://developer.android.com/guide/tutorials/views/hello-mapview.html but with slight changes. I wanted to run it here to help with debugging some problems. As I had never written an android project I had some very basic “insights”.
- I had to generate my own MapKey. I got the information for that from: http://code.google.com/intl/de-DE/android/add-ons/google-apis/mapkey.html . For now I only got a MapKey for my debug.keystore . You need keytool for it and it’s part of the Oracle SDK within the bin folder
- Sometimes I might have executed the main.xml that produced an main.out.xml. I had to delete that, when it was there.
- I wanted to have a look at the main.xml. It was not perfectly formatted. As I wasn’t sure whether it was correct on an XML-level I ran Source/Format on it. Then I was able to see that it was actually correct.
- I had an error symbol on my project and I could run it. There were, however, no errors indicated in the log. So I ran Project/Clean and it got rid of the problem. (From: http://stackoverflow.com/questions/3638660/undefined-error-when-trying-to-run-android-tutorial-form-stuff )
- Then I had the error log: No command output when running: ‘am start -n google.map/google.map.HelloViewMap -a android.intent.action.MAIN -c android.intent.category.LAUNCHER’ on device emulator” specifically
eclipse.buildId=M20100909-0800java.version=1.6.0_24java.vendor=Sun Microsystems Inc.BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DEFramework arguments: -product org.eclipse.epp.package.jee.productCommand-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product
ErrorSat Apr 09 15:56:54 CEST 2011No command output when running: 'am start -n google.map/google.map.HelloViewMap -a android.intent.action.MAIN -c android.intent.category.LAUNCHER' on device emulator-5554
com.android.ddmlib.ShellCommandUnresponsiveException at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:408) at com.android.ddmlib.Device.executeShellCommand(Device.java:276) at com.android.ide.eclipse.adt.internal.launch.ActivityLaunchAction.doLaunchAction(Unknown Source) at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launchApp(Unknown Source) at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.clientChanged(Unknown Source) at com.android.ddmlib.AndroidDebugBridge.clientChanged(AndroidDebugBridge.java:867) at com.android.ddmlib.Device.update(Device.java:398) at com.android.ddmlib.Client.update(Client.java:834) at com.android.ddmlib.HandleAppName.handleAPNM(HandleAppName.java:90) at com.android.ddmlib.HandleAppName.handleChunk(HandleAppName.java:64) at com.android.ddmlib.MonitorThread.callHandler(MonitorThread.java:414) at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:322) at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)
. http://www.anddev.org/sdk-adt-emulator-problems-f16/unparsed-aapt-errors-check-the-console-for-output-t12615.html told me to just delete it or clean the project.
- I started the Android app but I wasn’t sure whether it was still running when I hit the “Home” button to go back to the main menu. I found the taskmanager at “All Programs/DevTools/Running Processes”. it seems, it was not running after I went back to the main menu.
- I tried to do some logging with System.out.println but http://developer.android.com/resources/faq/commontasks.html#logginghttp://groups.google.com/group/android-developers/browse_thread/thread/a4896b24bd355a30/208a143b4eec58c0?lnk=gst&q=System.out.println&pli=1 and http://developer.android.com/reference/android/util/Log.html tell me to use Log.v(“myAppTag”, “step 5 is about to happen”) instead. You can read the output with starting ddms.bat from “android-sdk-windows/tools”. But System.out.println is also listed within Dalvik Debug Monitor. You will have to click on the emulator in the upper left windows to see the outputs.
- I came across the bug: http://code.google.com/p/android/issues/detail?id=8816 that Geocoder.getFromLocationName throws an java.io.IOException: Service not Available. This seems to be a bug in the 2.2 emulator. In the bug link there is comment #21 with a workaround. I downgraded to 2.1 (my device is 2.1 anyhow). However then in main.xml I had to replace all “match_parent” by “fill_parent”. Tihs page http://stackoverflow.com/questions/4936553/android-how-can-you-align-a-button-at-the-bottom-and-listview-above says that match_parent was fill_parent till 2.1.
- You can set the information the android emulator sends to the android operating systems. http://www.helloandroid.com/tutorials/how-set-location-emulator tells you, you can do it in ddms.bat (Dalvik Debug Monitor) in the tab “Emulator Control” under Location Controls.
- One should maybe put the geocoder information request in a separate thread as it needs an internet connection that might be slow. http://stackoverflow.com/questions/472313/android-reverse-geocoding-getfromlocation
- I got this error message ERROR/AndroidRuntime(331): Uncaught handler: thread main exiting due to uncaught exception 06-14 22:13:34.031: ERROR/AndroidRuntime(331): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.HelloMap}: when I tried to add a map to an Activity. As pointed out here: http://stackoverflow.com/questions/3040307/android-hellomap-example-giving-exception I had to extend my Activity from MapActivity. In order for that to be possible I had to change the Android I compile against from 1.5 to “Google API + Android 1.5″. For that to work I had to let Eclipse add the required “isRouteDisplayed()” method.
- Then I got the error java.lang.NoClassDefFoundError: … and then the name of the class I had just changed from extending not Activity but MapActivity. I forgot adding ’<uses-library android:name=”com.google.android.maps” />’ in the manifest.xml.
- I’m now using a “clickable = true” map within a scrollable Activity. Now only the horizontal touch-movements are represented in the map. When I flick up and down this is only reflected in moving the whole activity up and down but not the map. Is there a UI trick for the user to use the map completely?
I’ll publish this now and might come back later
VLC increase volume over 200%
How to increase the volume in VLC over the max setting of 200%: Click in the video and use the scrollwheel to get up to 400% volume.
Additionally: Open the amplifier and set the preamplifier to 20dB.
No video calls on iPhone 3G with skype app 3.0.0 (Not even one-way)
When calling an iPhone 3G with the new Skype app 3.0 you can not establish a two-way or even one-way video chat. I tried it.
Adding temporary notes to LaTeX draft compiles
This is a short example code for comments in LaTeX draft documents. Depending on a variable at the start of the LaTeX document the comments are either compiled into the .pdf or .dvi file or they are kept out of it.
Use SpeedStep to Minimize Fan Noise even while laptop is plugged in – via Win XP command line
If you want to throttle your CPU via SpeedStep even while plugged in, you need to change a power scheme. You can add a new from the Power Options dialog (“control powercfg.cpl”) and change the SpeedStep behaviour while on AC via “POWERCFG.EXE /CHANGE MyPowerConfig1LowCPUSpeed /processor-throttle-ac CONSTANT”. This will slower the CPU so the fan won’t go on.
Continue Reading February 4, 2010 at 10:36 pm Leave a comment
Thunderbird 3 collapse header info as in v2 via Add-On
Thunderbird 3.0 doesn’t support compact headers but always shows the expanded version of the header information. You can change this behaviour and collapse the information via the Thunderbird Add-On CompactHeader
Continue Reading January 31, 2010 at 10:42 pm Leave a comment
Integralkerne in L.W. Kantorowitsch, G. P. Akilow Funktionalanalysis in normierten Räumen
These are German annotations to the book L.W. Kantorowitsch, G. P. Akilow Funktionalanalysis in normierten Räumen (German translation). I list all occurrences of integral kernels. Those are functions like the Schwartz kernel. Unfortunately the book only contains theorems that yield properties of the operator from properties known about the kernel. For example in all most all cases the kernel k is supposed to be continuous and mostly the domains used are compact, mostly just intervals [a,b].
Continue Reading January 23, 2010 at 1:13 pm Leave a comment
Battery BL-4C bulging out in Nokia 6260
My Nokia 6260 battery BL-4C is bulging out. Should I be worried? Others experience the same.
Continue Reading November 7, 2009 at 6:05 pm Leave a comment