I know there is sort of a lot to see here, but I wanted it to be complete. Any help will be very very much appreciated.
I've been looking at this for a couple of days, and can't figure out how to get axis to generate an xml instance consistent with my consumer's requirements. If anybody might see a quick fix or switch that needs setting, I would appreciate it. I've got a suspicion that this may be just how it works ... ======================================================================= First, the output that I'm looking for: The output below was generated by XMLSpy against a WSDL/Schema to follow. Stylus output pretty much the same XML <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <SOAP-ENV:Body> <m:ETA xmlns:m="http://test.TitleRequest_MCOInState_OS"> <m:TP_REG_NUM>String</m:TP_REG_NUM> <m:ETA_REG_NUM>String</m:ETA_REG_NUM> <m:REQ_SEQ_NUM>2</m:REQ_SEQ_NUM> <m:REQ_DT>String</m:REQ_DT> <m:TST_PROD_IND>String</m:TST_PROD_IND> <m:REQ_TITLE_TYPE>String</m:REQ_TITLE_TYPE> <m:EVIDENCE_TYPE>String</m:EVIDENCE_TYPE> </m:ETA> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Below is what Axis 1.2 outputs after running wsdl2java, populating, and sending using client interface. The biggest problem is that the elements inside of <ns1:ETA> do not contain the ns1 prefix, as above. This is causing me a world of problems. Stylus insists that the XML instance below is not even valid with respect to the WSDL file. The other problems I'd like to fix is the <TST_PROD_IND element being emitted at all. The schema mentions only minOccurs=0, and I would very much not like to see this element in the XML instance. <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <ns1:ETA xmlns:ns1="http://test.TitleRequest_MCOInState_OS"> <TP_REG_NUM xsi:type="xsd:string">tpregnum</TP_REG_NUM> <ETA_REG_NUM xsi:type="xsd:string">regnum</ETA_REG_NUM> <REQ_SEQ_NUM xsi:type="xsd:positiveInteger">123</REQ_SEQ_NUM> <REQ_DT xsi:type="xsd:string">11/01/2005</REQ_DT> <TST_PROD_IND xsi:nil="true"/> <REQ_TITLE_TYPE xsi:type="xsd:string">TType</REQ_TITLE_TYPE> <EVIDENCE_TYPE xsi:type="xsd:string">etype</EVIDENCE_TYPE> </ns1:ETA> </soapenv:Body> </soapenv:Envelope> ======================================================================== Wsdl2Java is invoked like below. Nothing fancy. I've tried --noWrapped with no different results. <java classname="org.apache.axis.wsdl.WSDL2Java" fork="true" failonerror="true" classpathref="classpath" > <arg file="${wsdl-dmv-input.file}"/> <arg value="--output"/> <arg file="${wsdl-JavaOutput.dir}"/> <arg value="--server-side"/> <arg value="--skeletonDeploy"/> <arg file="true"/> <arg value="--verbose"/> </java> ======================================================================== ========== Now the bits of code to invoke the message to send, and thus generate the XML. org.apache.axis.description.OperationDesc oper; oper = new org.apache.axis.description.OperationDesc(); oper.setStyle(org.apache.axis.constants.Style.DOCUMENT); oper.setUse(org.apache.axis.constants.Use.LITERAL); org.apache.axis.description.ParameterDesc param; oper.setName("DoTest"); param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName( "http://test.TitleRequest_MCOInState_OS", "ETA"), org.apache.axis.description.ParameterDesc.IN, new javax.xml. namespace.QName("http://test.TitleRequest_MCOInState_OS", ">ETA"), test.eta.MCOInState_OS.ETA.class, false, false); oper.addParameter(param); oper.setReturnType(new javax.xml.namespace.QName("http://test.TitleResponse", "MESSAGE")); oper.setReturnClass(test.TitleResponse.MESSAGE.class); oper.setReturnQName(new javax.xml.namespace.QName("http://test.TitleResponse", ">MESSAGE")); try { String endpoint = "http://localhost:70/axis/services/ohtest"; Service service = new Service(); Call call = (Call) service.createCall(); call.setOperation(oper); service.getEngine().setOptionDefault(AxisEngine.PROP_SEND_XSI, Boolean.FALSE); service.getEngine().setOption(AxisEngine.PROP_DOTNET_SOAPENC_FIX, Boolean.TRUE); call.setTargetEndpointAddress(new java.net.URL(endpoint)); call.setOperationName(new QName("http://test.TitleRequest_MCOInState_OS", "ETA")); Object ret = call.invoke(new Object[] {getETA()}); ======================================================================== ====================================== OKAY, and finally the WSDL file. Below is the WSDL file. Sorry, I have cut this down from a couple thousand lines to something readable. Hope it is okay. <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://test.TitleWorkflowFacade" xmlns:s2="http://test.TitleResponse" xmlns:s15="http://test.TitleRequest_MCOInState_OS" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://test.TitleWorkflowFacade"> <wsdl:types> <s:schema targetNamespace="http://test.TitleWorkflowFacade"> <s:complexType name="AnySchema"> <s:sequence> <s:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/> </s:sequence> </s:complexType> </s:schema> <s:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://test.TitleRequest_MCOInState_OS" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://test.TitleRequest_MCOInState_OS"> <xs:annotation> <xs:appinfo> <b:references xmlns:b="http://schemas.microsoft.com/BizTalk/2003"> <b:reference targetNamespace="http://test.Prop_Lien_Incl"/> </b:references> </xs:appinfo> </xs:annotation> <xs:element name="ETA"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="TP_REG_NUM"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:minLength value="8"/> <xs:maxLength value="9"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="ETA_REG_NUM"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:minLength value="8"/> <xs:maxLength value="9"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="REQ_SEQ_NUM"> <xs:simpleType> <xs:restriction base="xs:positiveInteger"> <xs:totalDigits value="20"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="REQ_DT"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:pattern value="(0[1-9]|1[012])[/](0[1-9]|[12][0-9]|3[01])[/](19|20)\d\d[ ](0\d|1\d|2[0-3])[:][0-5]\d[:][0-5]\d"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element minOccurs="0" name="TST_PROD_IND"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:length value="1"/> <xs:pattern value="T|P"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="REQ_TITLE_TYPE"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:length value="1"/> <xs:pattern value="O|S"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="EVIDENCE_TYPE"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:length value="2"/> <xs:pattern value="MC"/> </xs:restriction> </xs:simpleType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </s:schema> <s:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://test.TitleResponse" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://test.TitleResponse"> <xs:element name="MESSAGE"> <xs:complexType> <xs:sequence> <xs:element name="REQ_SEQ_NUM"> <xs:simpleType> <xs:restriction base="xs:positiveInteger"> <xs:totalDigits value="20"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="REQ_DT"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:pattern value="(0[1-9]|1[012])[/](0[1-9]|[12][0-9]|3[01])[/](19|20)\d\d[ ](0\d|1\d|2[0-3])[:][0-5]\d[:][0-5]\d"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="ETA_DT"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:pattern value="(0[1-9]|1[012])[/](0[1-9]|[12][0-9]|3[01])[/](19|20)\d\d[ ](0\d|1\d|2[0-3])[:][0-5]\d[:][0-5]\d"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="TST_PROD_IND"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:length value="1"/> <xs:pattern value="T|P"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="STATUS"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:length value="1"/> <xs:pattern value="P|C|R|N"/> </xs:restriction> </xs:simpleType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </s:schema> </wsdl:types> <wsdl:message name="DoTestMessageIn" > <wsdl:part name="part" element="s15:ETA" /> </wsdl:message> <wsdl:message name="DoTestMessageOut"> <wsdl:part name="part" element="s2:MESSAGE"/> </wsdl:message> <wsdl:portType name="testPortType"> <wsdl:operation name="DoTest"> <wsdl:input message="tns:DoTestMessageIn"/> <wsdl:output message="tns:DoTestMessageOut"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="ohtestbinding" type="tns:testPortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="DoTest"> <soap:operation soapAction="http://test.TitleWorkflowFacade/DoTest" style="document"/> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="testFacade"> <wsdl:port name="ohtest" binding="tns:ohtestbinding"> <soap:address location="http://10.20.32.192/Titleworkflowfacade/prtWorkflowfacade.ashx "/> </wsdl:port> </wsdl:service> </wsdl:definitions>