Skip to main content

Document Literal Wrapped

7 replies [Last post]
janilsal
Offline
Joined: 2003-06-10
Points: 0

If I have operations with more than one parameter, wsgen is generating a wsdl in line with JSR-181 doc/lit wrapped style.

This is not the way wscompile used to generate wsdl for doc/lit. It used to wrap the operations in Request/Response structures.

Can I ask the Sun dev team as to whether the wscompile way has been discontinued ?

JSR181 doc/lit wrapped is the way to go?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
janilsal
Offline
Joined: 2003-06-10
Points: 0

Ofcourse not, you did not mislead me. I looked at the generated source files and figured out that you have heavy reliance on JAXB2.

The reason I was interested in wscompile Request Response structures is that I think it helps in dispatch for doc/lit web services.

Doing some research.

kohlert
Offline
Joined: 2003-06-16
Points: 0

Dispatch was one of the reasons we decided to generate request/response beans, so you could use them with dispatch if desired.

janilsal
Offline
Joined: 2003-06-10
Points: 0

Sorry for the long post. My impl bean reads:

@WebService(name = "EndpointInterface", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld", serviceName = "TestDocService")
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
public class JSEDocWrappedBean
{
public void order(int id, String name, float amount)
{
System.out.println("Do custom processing");
}
}

I run wsgen. I get a wsdl file that has doc/lit wrapped in the JSR181 Style.

Now I look for the generated source files. I see only Order.java and OrderResponse.java with JAXB annotations. Cool.

Now, where do I get the Request/Response structures?

kohlert
Offline
Joined: 2003-06-16
Points: 0

Sorry, if I miss led you earlier. wsgen does not generate the same request/response structures as wscompile. It generates request/response beans (JAXB beans) instead, however, they serve the same purpose and that is why I said that wsgen generates request/response beans in my earlier message.

I am curious as to why you are so interested with the request/response structures? Maybe there is something that I can help you with.

janilsal
Offline
Joined: 2003-06-10
Points: 0

Never mind, used the -s option

janilsal
Offline
Joined: 2003-06-10
Points: 0

Now how do I get the Request/Response structures when I run wsdlgen via the command line?

My script reads:
JAXWS_HOME=/home/anil/jaxws2/jaxws-2.0ea2
export JAXWS_HOME

#Use wsgen tool
./wsgen.sh -classpath ../../../JB/anil/webservice/test/output/classes -wsdl -keep -d test/build -nd repo/gen -verbose test.JSEDocWrappedBean

Now if you say that I cannot get the Request/Response structs via the command line usage of wsdlgen, I will be disappointed, as I like wscompile very much.

kohlert
Offline
Joined: 2003-06-16
Points: 0

You will notice that wsgen still generates requese/response beans for each method. They should be in the jaxws subpackage of the SEI. The main difference is that JAX-WS uses JAXB for its databinding so the schema generated maybe slightly different.

Anyway, the way that wsgen is doing it today is how we plan on doing it for FCS.

BTW, when starting from Java, especially when doing doc/lit wrapped, you should use APT to compile your classes instead of using wsgen.

So if you use APT to compile your classes, it will do the same work that wsgen does, but since it is processing source code it has access to parameter names. Parameter names are not accesible to wsgen due to lack of support in the reflection apis. Of course if you specify WebParam annotations on each parameter and specify the name element, there will be no difference. Once APT has compiled your classes you can just create a WAR file without having to run wsgen.

Thanks