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!

No comments: