문제

I have a Java class with a method exposed as a webservice method. Below is my Java class.

    @WebService
    public class TestService{

        public String testMethod(InputVO input) {

        }
    }

        public class InputVO{
           private Data data;

        }

        public class Data{
            private String xmlData;
        }

Now in my InputVO, I've a Data field which has a String xmlData.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:svc="http://test.svc.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <svc:testMethod>
         <arg0>
             <data>
               <!-- ANY XML CONTENT-->
            </data>
         </arg0>
      </svc:service>
   </soapenv:Body>
</soapenv:Envelope>

This is the structure of the Input XML file that my service expects. Inside the data element, I should be able to pass any XML content. Now in my service's testMethod, I should get this data in the XML format in xmlData element of Data object. I've set for the content inside data in the xsd file of my wsdl.

 <xs:complexType name="data">
    <xs:sequence>
      <xs:any/>
    </xs:sequence>
  </xs:complexType>

But when I check my xmlData field in InputVO, it is coming as null. How do I set the complete String XML data into xmlData field? Kindly help me.

도움이 되었습니까?

해결책

Please check whether your classes are properly annotated, seems some XML annotation are missing.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top