Skip to main content

Custom package for generated classes in JAXWS

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
2 replies [Last post]
mp_iworxs
Offline
Joined: 2007-12-03

Hello,

I have a webservice and which is having different classes with different packages at server side. Is there any way to generate the class with same package at client side? For example
my service is like this

public com.example.test.MyClass getMyClass()

and I need the class MyClass to be created at client side in the package com.example.test itself, and the other stub classes are generated in different package eg: com.example.service

Can anyone help me out here?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mp_iworxs
Offline
Joined: 2007-12-03

Hi all,

I got it solved, if somebody need to know please let me know.

I have another doubt, anybody know if it is possible to configure like sharing a single namespace to an entire package? Currently I have to modify all my classes in a specific package, somebody know whether it's possible to specify somewhere to use a namespace to all the classes !

mp_iworxs
Offline
Joined: 2007-12-03

Hi all,
The following link tells how to define custom package, and I did something like this, and here when using wsimport remove the switch for package, which will over ride all the package customization ! After doing like this, I got a custom package created at client like I defined one namespace in webservice, but currently only ObjectFactory class is there in that package, which means that the required classes are not mapped with the corresponding namespace.

So now my question is that, anybody know how to set namespace for a custom class for example in my above post I need the namespace "http://test.example.com" to be mapped to the class "com.example.test.MyClass", then the wsimport will place that class in the corresponding package I hope ! If I'm wrong please let me know !