JAX-WS: why nested elements are in “” namespace?

前端 未结 2 2039
谎友^
谎友^ 2021-02-09 19:24

Having a toy service as below

@WebService(targetNamespace=\"http://www.example.org/stock\")
@SOAPBinding(style=Style.RPC,parameterStyle=ParameterStyle.WRAPPED)
p         


        
2条回答
  •  失恋的感觉
    2021-02-09 20:09

    I too have the same problem . i developed webservice clientusing JAX-WS, with SOAP UI simulation.My webservice client is working fine. but when i test with real server (axis web service). I got null values.

    SOUP UI simulation response like this

        
       
       
          
             
             
                ?
                ?
                ?
                ?
                ?
                ?
                ?
                ?
                ?
             
          
       
    
    

    But in the server it response with out namespace like this..

            ?
            ?
            ?
            ?
            ?
            ?
            ?
            ?
            ?
    

    The JAX-WS generated code looks like this.

      @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "SdnBean", namespace = "http://dataobject.aml.infrasofttech.biz", propOrder = {
        "countries",
        "dob",
        "fullName",
        "isError",
        "listName",
        "passport",
        "percentage",
        "sdnId",
        "sdnName"
    })
    public class SdnBean {
    

    Then i have change the client jax-ws code @XmlType as shown below

    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "countries",
        "dob",
        "fullName",
        "isError",
        "listName",
        "passport",
        "percentage",
        "sdnId",
        "sdnName"
    })
    public class SdnBean {
    

    Now this will bind the soap response without namespace.

提交回复
热议问题