reficio / soap-ws

Java library, based on Spring-WS, that enables handling SOAP on a purely XML level
298 stars 146 forks source link

buildOutputMessage is big different with SoapUI #57

Open hikarulin opened 7 years ago

hikarulin commented 7 years ago

Here is my code: Wsdl wsdl = Wsdl.parse("http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl"); wsdl.printBindings(); List<SoapOperation> soapOperationList = new ArrayList<SoapOperation>(); List<QName> bindQnames = wsdl.getBindings(); for (QName qName : bindQnames) { SoapBuilder soapBuilder = wsdl.binding().localPart(qName.getLocalPart()).find(); soapOperationList.addAll(soapBuilder.getOperations()); for (SoapOperation oper : soapBuilder.getOperations()) { if ("getSupportDataSet".equals(oper.getOperationName())) { System.out.println(qName.getNamespaceURI() + ":" + qName.getLocalPart()); System.out.println(" " + oper.getOperationName()); System.out.println(" " + soapBuilder.getOperationBuilder(oper).buildOutputMessage(context)); } } } When I build sample request for operation 'getSupportDataSet',I get a very large XML string(hundreds of lines). I believe it's the problem of below code in wsdl file,but I don't konw how to solve it.

s:element name="getSupportDataSetResponse"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="getSupportDataSetResult"> <s:complexType> <s:sequence> <s:element ref="s:schema"/> <s:any/> </s:sequence> </s:complexType> </s:element> </s:sequence> </s:complexType> /s:element>

Is there any suggestion?

hikarulin commented 7 years ago

I just solved the problem.

Because SoapUI read file(soapui-settings.xml) to find exclude_type, so SoapUI ignore type [{http://www.w3.org/2001/XMLSchema}schema].

I add my exclude-type like below code,and it works. image