Thursday, October 27, 2005

WL : Posting SOAP request directly to the SOAP server

It's often useful to make changes to the SOAP request to see what happens. Normally, you have to do this via code and then re-compile the client.

However, you can do this via the command line.

Run the Weblogic "setDomainEnv.cmd" first to set up the environment and then:

java weblogic.webservice.tools.debug.Post "file name"

where "file name" is a file that contains the SOAP request.

Using this you can add / change the request parameters by simply using a text editor.

Much simpler.

An example of the file format is:

POST ...method... HTTP/1.1
Content-Type: text/xml
SOAPAction: ""
User-Agent: Java/1.4.2_06
Host: ...host...
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive

#?xml version="1.0" encoding="utf-8"?*
#env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"*
#env:Header/*
#env:Body*
#method*
#param*value#/param*
#/method*
#/env:Body*
#/env:Envelope*

Note:

# = Left square bracket
* = Right square bracket

Enjoy!

WL : Getting a Weblogic SOAP wire trace

If you are using the BEA Weblogic webservices for a Java SOAP client, you can see what is being sent on the wire by adding the following VM command line argument:

-Dweblogic.webservice.verbose=true

e.g. if you are using Eclipse, you can specify this under "Run / Arguments / VM Arguments".

The console will then display something like:

!-------------------- REQUEST ----------------
URL :
Headers :
SOAPAction: [""]
Content-Type: [text/xml]

... SOAP request

!-------------------- END REQUEST ------------

!-------------------- RESPONSE ---------------
URL : Response Code :200
Headers :
Date=Wed, 26 Oct 2005 19:15:40 GMT
Server=Apache
Keep-Alive=timeout=30, max=199
Connection=Keep-Alive
Transfer-Encoding=chunked
Content-Type=text/plain; charset=ISO-8859-1
Envelope :

... SOAP response

!-------------------- END RESPONSE -----------

Enjoy!

Thursday, October 20, 2005

.NET : Web services behind firewall

If you are trying to generate the web service proxy classes by using "Add Web Reference" from Visual Studio 2003 and the URL you are trying to get to is behind a firewall, you are screwed! Big time!

There's no way to do it.

You need to run Visual Studio command line (See earlier post) and then run "wsdl.exe".

Just type "wsdl" and you'll get the options. You'll note that you can specify the firewall address and the user logon / password to get you through the firewall as options. Bingo!

e.g. wsdl http://URL.wsdl /proxy:xx.xx.xx.xx /pu:User /pp:Password

So now you can go ahead and generate the proxy stubs. Add this file to your project and you are away.

But wait - there's more!

When you try and run the program to actually access the web service behind the firewall you will have exactly the same problem - the dreaded "407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied. )"

The way around this is to programmatically specify the proxy / logon / password.

Assume that you have the proxy configured in IE under "Tools / Options / Connections / LAN Settings". (Note that this does NOT allow user logon / password to be specified).

(See also :
The proxy settings on this computer are not configured correctly for Web discovery).

You create the webservice from the proxy class in the normal way.

using System.Net;

...

wsName = new WebServiceName ();

// Use default IE setting as above.
wsName.Proxy = System.Net.WebProxy.GetDefaultProxy();
// Set credentials
wsName.Proxy.Credentials = new NetworkCredential("User", "Password");

Enjoy!

Friday, October 14, 2005

BB : Erasing all data on the device

Interesting article in "Blackberry Cool"

Erasing All Data On Handheld

Enjoy!

WL : Logging to a Weblogic log file

There doesn't seem to be any way to programmatically log to the access.log but you can log to the server.log. In the jsp file:

(Note: # is "left square bracket %" and * is "% right square bracket").

#@ page import="weblogic.logging.NonCatalogLogger"*

#
NonCatalogLogger serverLogger;

serverLogger = new NonCatalogLogger ("Name of application");
serverLogger.info ("Some information message");
*

Enjoy!

Thursday, October 06, 2005

Misc : African recipes, African cooking and African Cookbook

e-book download with heaps of recipes from Africa

African recipes, African cooking and African Cookbooks, The African Recipes Book, Real food from Africa

Try the bobotie, the brandy pudding and the Cape Malay pickled fish.

Yum!

Enjoy!

BB : Running simulator without IDE / JDE

Obviously you need the IDE / JDE to develop the application. However, the simulator can be run without starting up the IDE. The IDE requires the Java 2 SDK Standard Edition. The simulator does not.

Assume you want to run the simulator on a laptop which does not have the J2SE platform installed.

First install the BlackBerry Java Development Environment (JDE) from the Blackberry site. Then copy across the program files app.code, app.cso, app.debug and app.jar into the "C:\Program Files\Research In Motion\BlackBerry JDE 4.0.2\simulator" directory on the laptop. (This path assumes that you have installed the 4.0.2 JDE).

Now run the required simulator file from that directory e.g. 7100v.bat.

Enjoy!

Monday, October 03, 2005

Misc : English Cut

Sometimes you stumble across a blog that is so different and potentially looks so interesting that you just have to stop and read it.

Here's one: English Cut, a really interesting blog about bespoke Savile Row tailoring.

Atom feed

Enjoy!