You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Tobi L." <T....@exxcellent.de> on 2007/12/06 17:12:11 UTC

2 small problems Java2Wsdl/Wsdl2Java & SOAP Adress

Hello,

I've got two small problems and absolutly no clue how to fix it.

I try to generate a WSDL from the Java SEI. This WSDL should be the refernce
for the clients. The first problem is that the <soap:address
location="http://localhost:9090/hello"/> in the WSDL is always this. There
should be something like: <soap:address
location="http://myServer:8081/fdm/services/Foo"/> but I didn't find any way
to change it. I'm sure it's quite easy but I didn't get it...

The other thing is: I write a Webmethod like: 
============================================
@WebMethod(operationName = "addDokumente")
public void addDokumente(
@WebParam(targetNamespace = "http://www.exxcellent.de/documentManager/",
name = "clientId")
String clientId,
@WebParam(targetNamespace = "http://www.exxcellent.de/documentManager/",
name = "laufId")
String laufId,
@WebParam(targetNamespace = "http://www.exxcellent.de/documentManager/",
name = "dokumente")
Collection<DokumentPaket> dokumentenPakete)
throws DokumentenManagerException, LaufStatusException;
============================================

I generate the WSDL by Java2WSDL and then I generate the client by
Wsdl2Java.

There is the method generated like this: 

============================================
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebResult(targetNamespace = "http://webservice.docmanager.exxcellent.de/",
partName = "parameters", name = "addDokumenteResponse")
@WebMethod
public de.exxcellent.docmanager.webservice.AddDokumenteResponse
addDokumente(
@WebParam(targetNamespace = "http://webservice.docmanager.exxcellent.de/",
partName = "parameters", name = "addDokumente")
de.exxcellent.docmanager.webservice.AddDokumente parameters
) throws DokumentenManagerException, LaufStatusException_Exception;
============================================

There are a few more exaples. But always the same question:

Why are there the Types "AddDokumenteResponse" and "AddDokumente" and not
directly the correct types? Other methods with only simple Types are correct
tranfered (without the Wrappers). I tried to work with the @RequestWrapper
and @ResponeWrapper annotations but it didn't help. Is there a way to get
rid of the wrappers?  :-(

Confused and depressed greetings.

Tobi


-- 
View this message in context: http://www.nabble.com/2-small-problems-Java2Wsdl-Wsdl2Java---SOAP-Adress-tf4956833.html#a14194918
Sent from the cxf-user mailing list archive at Nabble.com.


Re: 2 small problems Java2Wsdl/Wsdl2Java & SOAP Adress

Posted by Glen Mazza <gl...@verizon.net>.
Am Donnerstag, den 06.12.2007, 08:12 -0800 schrieb Tobi L.:
> Hello,
> 
> I've got two small problems and absolutly no clue how to fix it.
> 
> I try to generate a WSDL from the Java SEI. This WSDL should be the refernce
> for the clients. The first problem is that the <soap:address
> location="http://localhost:9090/hello"/> in the WSDL is always this. There
> should be something like: <soap:address
> location="http://myServer:8081/fdm/services/Foo"/> but I didn't find any way
> to change it. I'm sure it's quite easy but I didn't get it...

Bitte Note #4 von [1] lesen.  Hopefully that will help make things
clearer.

[1] http://www.jroller.com/gmazza/date/20071019#notes

Client-side, you can switch the URL at runtime as shown in Step #7
here[2]:

[2] http://www.jroller.com/gmazza/entry/using_the_ebay_shopping_api1


> 
> The other thing is: I write a Webmethod like: 
> ============================================
> @WebMethod(operationName = "addDokumente")
> public void addDokumente(
> @WebParam(targetNamespace = "http://www.exxcellent.de/documentManager/",
> name = "clientId")
> String clientId,
> @WebParam(targetNamespace = "http://www.exxcellent.de/documentManager/",
> name = "laufId")
> String laufId,
> @WebParam(targetNamespace = "http://www.exxcellent.de/documentManager/",
> name = "dokumente")
> Collection<DokumentPaket> dokumentenPakete)
> throws DokumentenManagerException, LaufStatusException;
> ============================================
> 
> I generate the WSDL by Java2WSDL and then I generate the client by
> Wsdl2Java.
> 
> There is the method generated like this: 
> 
> ============================================
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> @WebResult(targetNamespace = "http://webservice.docmanager.exxcellent.de/",
> partName = "parameters", name = "addDokumenteResponse")
> @WebMethod
> public de.exxcellent.docmanager.webservice.AddDokumenteResponse
> addDokumente(
> @WebParam(targetNamespace = "http://webservice.docmanager.exxcellent.de/",
> partName = "parameters", name = "addDokumente")
> de.exxcellent.docmanager.webservice.AddDokumente parameters
> ) throws DokumentenManagerException, LaufStatusException_Exception;
> ============================================
> 
> There are a few more exaples. But always the same question:
> 
> Why are there the Types "AddDokumenteResponse" and "AddDokumente" and not
> directly the correct types? 

The JAX-WS specification gives rules for when you will get bare vs.
wrapped parameters.  Sometimes you don't have a choice under certain
rules (as explained in section 3.6.2.2 of the JAX-WS 2.1 spec of May
2007).  There is a flag that will allow you to switch to bare (pure
parameters, but it is currently not implemented in CXF.  Metro has it
though.)  It typically is not a big deal either way, [2] above shows how
you can work with wrapped parameters.

HTH,
Glen