Showing posts with label Weblogic. Show all posts
Showing posts with label Weblogic. Show all posts

Thursday, November 10, 2005

WL : Using wsdl2service to create the Java classes for servicegen

In the previous post, it talks about a_service.service.Java_ServiceImpl.

But where does this java class come from?

The answer is that it's created by Weblogic's wsdl2service. In the build.xml file, you would add:

wsdl2service
packageName="a_service.service"
keepGenerated="True"
generateimpl="True"

This utility reads the WSDL and then creates the classes.

Enjoy!

WL : servicegen and javaClassComponents

Weblogic's servicegen "takes as input an EJB JAR file or list of Java classes, and creates all the needed Web Service components and packages them into a deployable EAR file".

javaClassComponents has as input a "Comma-separated list of Java class names that implement the Web Service operation. The Java classes must be compiled and in your CLASSPATH"

This comes under the service element of servicegen so part of the build.xml would be:

service
serviceName="a_service"
javaClassComponents="a_service.service.Java_ServiceImpl"

So in the CLASSPATH, you would have:

set CLASSPATH=%CLASSPATH%;C:\...\a_service\service\Java_ServiceImpl.class;

and Java_ServiceImpl.java would than have a:

package a_service.service;

Note the "a_service.service" in javaClassComponents. If that's missing, servicegen will invoke javac which will then throw a "Class not found" exception.

But where does the Java class come from in the first place? See this

Enjoy!

Wednesday, November 09, 2005

WL : The task doesn't support the "generateimpl" attribute

Running Ant on Weblogic SP2 wsdl2service.

Get this weird message.

file:.../build.xml:xx: The task doesn't support the "generateimpl" attribute.

What?

The Weblogic 8.1 documentation specifically states that it IS an option:

"generateImpl - Specifies that the wsdl2Service Ant task should generate an empty implementation Java class file."

Pull hair out. Turn to best friend Mr. Google. Turns out this is a bug which has been fixed in SP3.

Download latest SP4 - problem solved.

Enjoy!

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!

Friday, October 14, 2005

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, June 02, 2005

WL : Weblogic Workshop textbox sizes

Weblogic Workshop 8.1 SP2 running on XP SP2.

The following HTML code snippet:

LB input size="14" value="input" RB
LB input type="password" size="14" value="" RB

where LB = "<" and RB = ">".

When viewed in either the standard IE browser or the Workshop test browser, the password textbox is smaller than the normal textbox even though both are the same size.

The same is also true when viewed by Weblogic using the LB netui:textBox .... construct.

The solution is to make the password field use a monospace font i.e.

LB input type="password" value="" style="font-family: courier new;font-size:14;" RB

Enjoy!

(Weblogic)