Because the child elements are in different namespaces, this is likely going to 
be a bit difficult.

You can TRY doing:

@XmlType(name="subscribeServCfmReq",namespace="http://www.chinamobile.com/vgop/serviceorder/v1_0";)
public class SubscribeServCfmReq {

@XmlElement(name="msgTransactionID", 
namespace="http://www.chinamobile.com/vgop/serviceorder/v1_0/common";)
public String getMsgTransactionID() {
return msgTransactionID;
}
...
}

to force the namespace on each element, but I'm not sure that will work.   You 
can also try using XmlElementRef instead of XmlElement, but again, I'm not sure 
that will work without and ObjectFactory.   

Another option MAY be to put the SubscribeServCfmReq type into the "common" 
namespace via it's XmlType annotation.   You could try that.


Honestly, the best option may be to create a schema for this (two schemas, one 
for http://www.chinamobile.com/vgop/serviceorder/v1_0 and one for 
http://www.chinamobile.com/vgop/serviceorder/v1_0/common)  and run the 
wsdl2java or jaxb xic things on it to see what it generates for this.


Dan




On Oct 11, 2012, at 9:17 PM, cantalou89 <[email protected]> wrote:

> deal all:
> i have a problem about the customize namespace,
> i public a webservice interface below:
> 
> @WebService(targetNamespace="http://www.chinamobile.com/vgop/serviceorder/v1_0";)
> @EndpointProperty(key = "soap.no.validate.parts", value = "true") 
> public interface UserOrderServer {
> 
>   
> @ResponseWrapper(className="com.funo.ehealth.SubscribeServCfmResp",targetNamespace="http://www.chinamobile.com/vgop/serviceorder/v1_0";)
>   @WebMethod(operationName="subscribeServCfm")
>   public SubscribeServCfmResp 
> subscribeServCfm(@WebParam(name="subscribeServCfmReq")SubscribeServCfmReq 
> subscribeServCfmReq) ;
> }
> 
> @XmlType(name="subscribeServCfmReq",namespace="http://www.chinamobile.com/vgop/serviceorder/v1_0";)
> public class SubscribeServCfmReq {
> ...
> }
> 
> this interface can handle the soap message like below. the 
> subscribeServCfmReq is without namespace,
> <ns3:subscribeServCfm 
> xmlns:ns2="http://www.chinamobile.com/vgop/serviceorder/v1_0"; 
> xmlns:ns3="http://main.ehealth.funo.com/";>
> <subscribeServCfmReq>
> <cfmResult>00</cfmResult>
> <msgTransactionID>qq</msgTransactionID>
> <oprTime>123</oprTime>
> </subscribeServCfmReq>
> </ns3:subscribeServCfm>
> 
> and the client send a message like below,the subscribeServCfmReq is with 
> namespace
> <ns2:subscribeServCfm 
> xmlns:ns2="http://www.chinamobile.com/vgop/serviceorder/v1_0";>
> <ns2:subscribeServCfmReq>
> <ns1:msgTransactionID 
> xmlns:ns1="http://www.chinamobile.com/vgop/serviceorder/v1_0/common";>555</ns1:msgTransactionID>
> <ns1:oprTime 
> xmlns:ns1="http://www.chinamobile.com/vgop/serviceorder/v1_0/common";>20121011094323</ns1:oprTime>
> <ns1:cfmResult 
> xmlns:ns1="http://www.chinamobile.com/vgop/serviceorder/v1_0/common";>00</ns1:cfmResult>
> </ns2:subscribeServCfmReq>
> </ns2:subscribeServCfm>
> i try to use StaxTransformFeature  with expression "<entry 
> key="{http://www.chinamobile.com/vgop/serviceorder/v1_0}subscribeServCfmReq"; 
> value="subscribeServCfmReq" /> " , and then it works fine,but i want to 
> modify the annotataion to meet the message, not StaxTransformFeature , is it 
> any way to do? 
> thanks
> 
> 
> 
> 
> cantalou89

-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to