I've been struggling with loading/parsing my xml file in R. I've tried both the XML and the xml2 package with no luck. The file size is 275,000kb. I've been able to load other xml files and parse the data however I can't seem to figure this out.
Below is a sample of the xml file:
<?xml version="1.0" standalone="yes"?>
<T_WC>
<xs:schema id="T_WC" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="T_WC" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="api_st_cde" type="xs:short" minOccurs="0" />
<xs:element name="api_cnty_cde" type="xs:short" minOccurs="0" />
<xs:element name="api_well_idn" type="xs:int" minOccurs="0" />
<xs:element name="pool_idn" type="xs:int" minOccurs="0" />
<xs:element name="eff_dte" type="xs:dateTime" minOccurs="0" />
<xs:element name="ogrid_cde" type="xs:int" minOccurs="0" />
<xs:element name="well_typ_cde" type="xs:string" minOccurs="0" />
<xs:element name="sdiv_twp_idn" type="xs:string" minOccurs="0" />
<xs:element name="sdiv_rng_idn" type="xs:string" minOccurs="0" />
<xs:element name="sdiv_sect_num" type="xs:short" minOccurs="0" />
<xs:element name="sdiv_unlt_idn" type="xs:string" minOccurs="0" />
<xs:element name="lot_idn" type="xs:string" minOccurs="0" />
<xs:element name="ftg_ns_num" type="xs:short" minOccurs="0" />
<xs:element name="ftg_ew_num" type="xs:short" minOccurs="0" />
<xs:element name="ns_cde" type="xs:string" minOccurs="0" />
<xs:element name="ew_cde" type="xs:string" minOccurs="0" />
<xs:element name="compl_typ_cde" type="xs:string" minOccurs="0" />
<xs:element name="compl_dte" type="xs:dateTime" minOccurs="0" />
<xs:element name="dpth_perf_top_num" type="xs:int" minOccurs="0" />
<xs:element name="dpth_perf_btm_num" type="xs:int" minOccurs="0" />
<xs:element name="fst_oil_prodn_dte" type="xs:dateTime" minOccurs="0" />
<xs:element name="fst_gas_deliv_dte" type="xs:dateTime" minOccurs="0" />
<xs:element name="tst_dte" type="xs:dateTime" minOccurs="0" />
<xs:element name="prodn_meth_cde" type="xs:string" minOccurs="0" />
<xs:element name="tst_len_tim" type="xs:string" minOccurs="0" />
<xs:element name="tbg_pres_num" type="xs:int" minOccurs="0" />
<xs:element name="csg_pres_num" type="xs:int" minOccurs="0" />
<xs:element name="choke_siz_dec" type="xs:decimal" minOccurs="0" />
<xs:element name="tst_oil_amt" type="xs:decimal" minOccurs="0" />
<xs:element name="tst_wtr_amt" type="xs:decimal" minOccurs="0" />
<xs:element name="tst_gas_amt" type="xs:decimal" minOccurs="0" />
<xs:element name="api_grav_dec" type="xs:decimal" minOccurs="0" />
<xs:element name="tst_meth_cde" type="xs:string" minOccurs="0" />
<xs:element name="tst_gor_dec" type="xs:decimal" minOccurs="0" />
<xs:element name="wc_stat_cde" type="xs:string" minOccurs="0" />
<xs:element name="tst_gas_dispn_cde" type="xs:string" minOccurs="0" />
<xs:element name="spc_unit_idn" type="xs:int" minOccurs="0" />
<xs:element name="prod_prop_idn" type="xs:int" minOccurs="0" />
<xs:element name="well_nbr_idn" type="xs:string" minOccurs="0" />
<xs:element name="vent_apr_cde" type="xs:string" minOccurs="0" />
<xs:element name="vent_apr_dte" type="xs:dateTime" minOccurs="0" />
<xs:element name="vent_apr_expr_dte" type="xs:dateTime" minOccurs="0" />
<xs:element name="ocd_lease_num" type="xs:string" minOccurs="0" />
<xs:element name="well_class_cde" type="xs:decimal" minOccurs="0" />
<xs:element name="well_grp_num" type="xs:short" minOccurs="0" />
<xs:element name="bh_psd_act_ind" type="xs:string" minOccurs="0" />
<xs:element name="sdiv_consol_cde" type="xs:string" minOccurs="0" />
<xs:element name="dhc_cmngl_ind" type="xs:string" minOccurs="0" />
<xs:element name="ocd_ord_typ_cde" type="xs:string" minOccurs="0" />
<xs:element name="ocd_ord_num" type="xs:int" minOccurs="0" />
<xs:element name="ocd_ord_sfx_idn" type="xs:string" minOccurs="0" />
<xs:element name="dhc_dte" type="xs:dateTime" minOccurs="0" />
<xs:element name="nfo_prmt_num" type="xs:int" minOccurs="0" />
<xs:element name="nfo_eff_dte" type="xs:dateTime" minOccurs="0" />
<xs:element name="nfo_expr_dte" type="xs:dateTime" minOccurs="0" />
<xs:element name="deliv_tst_q_num" type="xs:int" minOccurs="0" />
<xs:element name="c104_apr_dte" type="xs:dateTime" minOccurs="0" />
<xs:element name="gas_conn_dte" type="xs:dateTime" minOccurs="0" />
<xs:element name="ocd_unlt_idn" type="xs:string" minOccurs="0" />
<xs:element name="rec_termn_dte" type="xs:dateTime" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<Table>
<api_st_cde>30</api_st_cde>
<api_cnty_cde>1</api_cnty_cde>
<api_well_idn>5002</api_well_idn>
<pool_idn>96838</pool_idn>
<eff_dte>1964-04-24T00:00:00-06:00</eff_dte>
<ogrid_cde>196291</ogrid_cde>
<well_typ_cde>G</well_typ_cde>
<sdiv_twp_idn>10N</sdiv_twp_idn>
<sdiv_rng_idn>05E</sdiv_rng_idn>
<sdiv_sect_num>12</sdiv_sect_num>
<sdiv_unlt_idn>D </sdiv_unlt_idn>
<lot_idn xml:space="preserve"> </lot_idn>
<ftg_ns_num>985</ftg_ns_num>
<ftg_ew_num>902</ftg_ew_num>
<ns_cde>N</ns_cde>
<ew_cde>W</ew_cde>
<compl_typ_cde xml:space="preserve"> </compl_typ_cde>
<compl_dte>9999-12-31T00:00:00-07:00</compl_dte>
<dpth_perf_top_num>1</dpth_perf_top_num>
<dpth_perf_btm_num>1</dpth_perf_btm_num>
</Table>
<Table>
<api_st_cde>30</api_st_cde>
<api_cnty_cde>1</api_cnty_cde>
<api_well_idn>20007</api_well_idn>
<pool_idn>96838</pool_idn>
<eff_dte>1997-09-29T00:00:00-06:00</eff_dte>
<ogrid_cde>14538</ogrid_cde>
<well_typ_cde>G</well_typ_cde>
<sdiv_twp_idn>10N</sdiv_twp_idn>
<sdiv_rng_idn>01E</sdiv_rng_idn>
<sdiv_sect_num>21</sdiv_sect_num>
<sdiv_unlt_idn>G50</sdiv_unlt_idn>
<lot_idn xml:space="preserve"> </lot_idn>
<ftg_ns_num>640</ftg_ns_num>
<ftg_ew_num>590</ftg_ew_num>
<ns_cde>S</ns_cde>
<ew_cde>W</ew_cde>
<compl_typ_cde xml:space="preserve"> </compl_typ_cde>
<compl_dte>9999-12-31T00:00:00-07:00</compl_dte>
<dpth_perf_top_num>1</dpth_perf_top_num>
<dpth_perf_btm_num>1</dpth_perf_btm_num>
</Table>
<Table>
<api_st_cde>30</api_st_cde>
<api_cnty_cde>1</api_cnty_cde>
<api_well_idn>20010</api_well_idn>
<pool_idn>96838</pool_idn>
<eff_dte>2015-06-02T00:00:00-06:00</eff_dte>
<ogrid_cde>5380</ogrid_cde>
<well_typ_cde>G</well_typ_cde>
<sdiv_twp_idn>10N</sdiv_twp_idn>
<sdiv_rng_idn>01W</sdiv_rng_idn>
<sdiv_sect_num>27</sdiv_sect_num>
<sdiv_unlt_idn>G50</sdiv_unlt_idn>
<lot_idn xml:space="preserve"> </lot_idn>
<ftg_ns_num>800</ftg_ns_num>
<ftg_ew_num>800</ftg_ew_num>
<ns_cde>S</ns_cde>
<ew_cde>E</ew_cde>
<compl_typ_cde xml:space="preserve"> </compl_typ_cde>
<compl_dte>9999-12-31T00:00:00-07:00</compl_dte>
<dpth_perf_top_num>1</dpth_perf_top_num>
<dpth_perf_btm_num>1</dpth_perf_btm_num>
</Table>
Related
I am converting WSDL to Java with CXF. When -autoNameResolution key is enabled CXF generates many files with the same content. Is there any way to avoid it?
To avoid nested static classes I've enabled <jaxb:globalBindings localScoping="toplevel">. As you can see in the WSDL element "Apple" is referenced three times. Unfortunately I cannot change WSDL. CXF creates
Apple.java, Apple2.java, Apple3.java accordingly or crashes when -autoNameResolution flag is not set.
<xs:element name="Forest">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="99" minOccurs="0" name="Apple">
<xs:complexType>
<xs:sequence>
<xs:element name="Size" type="xsd:string" />
<xs:element name="Color" type="xsd:string" />
<xs:element name="Taste" type="xsd:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="TreeOne">
<xs:complexType>
<xs:sequence>
<xs:element name="Branch1" type="xsd:string">
</xs:element>
<xs:element maxOccurs="99" minOccurs="0" name="Apple">
<xs:complexType>
<xs:sequence>
<xs:element name="Size" type="xsd:string" />
<xs:element name="Color" type="xsd:string" />
<xs:element name="Taste" type="xsd:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="TreeTwo">
<xs:complexType>
<xs:sequence>
<xs:element name="BranchTwo" type="xsd:string">
</xs:element>
<xs:element maxOccurs="99" minOccurs="0" name="Apple">
<xs:complexType>
<xs:sequence>
<xs:element name="Size" type="xsd:string" />
<xs:element name="Color" type="xsd:string" />
<xs:element name="Taste" type="xsd:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Is there any way to teach wsdl2java not to create Apple2.java and Apple3.java and refer to Apple.java in all three cases? With bindings I could change the name to something else like Apple2->Peach, Apple3->Watermelon but this is not that What I am looking for. It might be obvious to see that all three apples have same set of fields, and are actually the same?
Is there any way to solve that? May be some refactoring plugin that refactors code generated by cxf?
You can force JAXB/XJC to reuse existing classes using the jaxb:class/#ref customization. Something along the lines:
<jaxb:class ref="com.acme.foo.Apple"/>
Where com.acme.foo.Apple is the FQCN of one of the generated Apple classes.
Bind this to the other two xs:complexTypes and JAXB will reuse the existing class instead of generating the same thing again.
I don't have much experience with customizing WSDLs so unfortunatelly I can't point you to the exact syntax of the binding in this case.
Based on oozie doc I understand that I can use the global element to avoid repeating, let's say, the job-tracker specification, for every action. Although, given the following simple workflow:
<workflow-app name="Test Hello World" xmlns="uri:oozie:workflow:0.4">
<global>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
</global>
<start to="import"/>
<action name="import">
<shell xmlns="uri:oozie:shell-action:0.1">
<exec>hw.sh</exec>
<file>hw.sh#hw.sh</file>
</shell>
<ok to="end"/>
<error to="kill"/>
</action>
<kill name="kill">
<message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>
when running oozie validate on it I get:
Error: Invalid app definition, org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 19; cvc-complex-type.2.4.a: Invalid content was found starting with element 'exec'. One of '{"uri:oozie:shell-action:0.1":job-tracker}' is expected.
So basically, it still expects a job-tracker element in the action.
If you have any idea on this behavior, your answers will be much appreciated.
Thank you.
Here is the schema of oozie shell action version 0.1. You will notice that job-tracker and name-node tags require the minimum occurrence of 1 time. Same applies for the exec tag as well.
Source: Shell XML-Schema
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:shell="uri:oozie:shell-action:0.1" elementFormDefault="qualified"
targetNamespace="uri:oozie:shell-action:0.1">
<xs:element name="shell" type="shell:ACTION"/>
<xs:complexType name="ACTION">
<xs:sequence>
<xs:element name="job-tracker" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="name-node" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="prepare" type="shell:PREPARE" minOccurs="0" maxOccurs="1"/>
<xs:element name="job-xml" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="configuration" type="shell:CONFIGURATION" minOccurs="0" maxOccurs="1"/>
<xs:element name="exec" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="argument" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="env-var" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="file" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="archive" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="capture-output" type="shell:FLAG" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="FLAG"/>
<xs:complexType name="CONFIGURATION">
<xs:sequence>
<xs:element name="property" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="name" minOccurs="1" maxOccurs="1" type="xs:string"/>
<xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:string"/>
<xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PREPARE">
<xs:sequence>
<xs:element name="delete" type="shell:DELETE" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="mkdir" type="shell:MKDIR" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="DELETE">
<xs:attribute name="path" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="MKDIR">
<xs:attribute name="path" type="xs:string" use="required"/>
</xs:complexType>
</xs:schema>
I have a XML file which looks like the following:
This is just a snippet and there are around 100 tables in this XML
<NewDataSet>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="row1" type="xs:string" minOccurs="0" />
<xs:element name="row2" type="xs:int" minOccurs="0" />
<xs:element name="row3" type="xs:string" minOccurs="0" />
<xs:element name="row4" type="xs:string" minOccurs="0" />
<xs:element name="row5" type="xs:string" minOccurs="0" />
<xs:element name="row6" type="xs:string" minOccurs="0" />
<xs:element name="row7" type="xs:decimal" minOccurs="0" />
<xs:element name="row8" type="xs:decimal" minOccurs="0" />
<xs:element name="row9" type="xs:string" minOccurs="0" />
<xs:element name="row10" type="xs:int" minOccurs="0" />
<xs:element name="row11" type="xs:string" minOccurs="0" />
<xs:element name="row12" type="xs:string" minOccurs="0" />
<xs:element name="row13" type="xs:string" minOccurs="0" />
<xs:element name="row14" type="xs:string" minOccurs="0" />
<xs:element name="row15" type="xs:string" minOccurs="0" />
<xs:element name="row16" type="xs:int" minOccurs="0" />
<xs:element name="row17" type="xs:int" minOccurs="0" />
<xs:element name="row18" type="xs:string" minOccurs="0" />
<xs:element name="row19" type="xs:string" minOccurs="0" />
<xs:element name="row20" type="xs:string" minOccurs="0" />
<xs:element name="row21" type="xs:int" minOccurs="0" />
<xs:element name="row22" type="xs:string" minOccurs="0" />
<xs:element name="row23" type="xs:string" minOccurs="0" />
<xs:element name="row24" type="xs:boolean" minOccurs="0" />
<xs:element name="row25" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<Table>
<row1>9074A454308A4460AE7A557A294636E0</row1>
<row2>2</row2>
<row3>561B2BDC1A04455A8A2BC07FDB0D114C</row3>
<row4>3AJPUL78</row4>
<row5>Cancelled</row5>
<row6>09/10/2012</row6>
<row7>1562.8600</row7>
<row8>1537.8600</row8>
<row9>Valid</row9>
<row10>1</row10>
<row11>GBP</row11>
<row12>##,##0.00</row12>
<row13>Valid</row13>
<row14>Valid</row14>
<row15>Correct</row15>
<row16>943</row16>
<row17>26</row17>
<row18>Right</row18>
<row19>Mr</row19>
<row20>A364A37BFC9D4B4186DE735BC0DFB01A</row20>
<row21>1</row21>
<row22>Firstname</row22>
<row23>Fwtxweb1</row23>
<row24>false</row24>
<row25>Home</row25>
I want to be able to query the XML and bring back all the tables that have a ROW20 ID = A364A37BFC9D4B4186DE735BC0DFB01A
In my code behind i have started to do this but i am getting stuck.
VB.NET CODE:
Protected Sub dtb_client_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
'**THIS FIND THE ID OF THE PARAMETER THAT ROW20 NEEDS**'
Dim country As String = TryCast(dtb_client.SelectedRow.FindControl("txtInsuredpartyID"), Label).Text
'**THIS PUT THE STRING INTO A XML FILE**'
Dim pols As String = CType(Session("brokerPolicies"), String)
Dim XMLFilitered As XmlDocument = New XmlDocument()
XMLFilitered.LoadXml(pols)
'**I AM TRYING TO QUERY THE XML FILE AND BRING BACK THE TABLES THAT HAVE THE
Dim buff As XmlNodeList = XMLFilitered.SelectNodes("//NewDataSet/Table/ROW20[.='A364A37BFC9D4B4186DE735BC0DFB01A']")
Dim returnstr As String = ""
For Each item As XmlNode In buff
returnstr += item.OuterXml
Next
End Sub
Conclusion - I have a XML file with around 100 table inside of it. I have a ROW20 ID and want to query the XML file and bring back all the tables
First
Issue:
Not able to add new API Proxy by importing existing SOAP WSDL
Error:
Fetch WSDL Error: Could not download resource. peer not authenticated
My view:
I suspect is caused by WSDL structure contains import XSD which derived from another link.
<xsd:import namespace="http://XXX/message" schemaLocation="https://XXX:123/xxxservices/XxxWebService?xsd=1"/>
Tried modifying my WSDL , instead of using import from external URL, I copied the whole XSD structure into the WSDL. It works!
Question:
What is the issue behind the validation process? f.y.i. I have also imported the certificate into my Java truststore (cacerts)
Second
Issue:
Few elements/parameters not populated after successfully imported the WSDL
Portion of my WSDL :
<xs:complexContent>
<xs:extension base="ns:UserDetailsRequest">
<xs:sequence>
<xs:extension base="ns:UserDetailsRequest">
<xs:sequence>
<xs:element name="password" type="xs:string" minOccurs="0"/>
<xs:element name="userID" type="xs:string" minOccurs="0"/>
</xs:sequence>
My view:
I found out that the Apigee does not populate the parameters of password and userID, I suspect the issue is caused by implementing XML extension base component
Question:
How to solve the missing parameters issue?
Thank you!
My whole WSDL is below:
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://webservice.docx.abc.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://webservice.docx.abc.com/" name="XyzWebService">
<definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://webservice.docx.abc.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://webservice.docx.abc.com/" name="XyzWebService">
<types>
<xsd:schema>
<xsd:import namespace="http://webservice.docx.abc.com/message" schemaLocation="https://www.xxx.com:123/docxservices/XyzWebService?xsd=1" />
</xsd:schema>
<xsd:schema>
<xsd:import namespace="http://webservice.docx.abc.com/" schemaLocation="https://www.xxx.com:123/docxservices/XyzWebService?xsd=2" />
</xsd:schema>
</types>
<message name="docUpload">
<part name="parameters" element="tns:docUpload" />
</message>
<message name="docUploadResponse">
<part name="parameters" element="tns:docUploadResponse" />
</message>
<portType name="XyzWebServicePortType">
<operation name="docUpload">
<input message="tns:docUpload" />
<output message="tns:docUploadResponse" />
</operation>
</portType>
<binding name="XyzWebServicePortTypePortBinding" type="tns:XyzWebServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<operation name="docUpload">
<soap:operation soapAction="" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="XyzWebService">
<port name="XyzWebServicePortTypePort" binding="tns:XyzWebServicePortTypePortBinding">
<soap:address location="https://www.xxx.com:123/docxservices/XyzWebService" />
</port>
</service>
</definitions>
1st XSD:
<?xml version="1.0" encoding="UTF-8"?>
<!--Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.3-07/10/2008 08:41 PM(bt).-->
<xs:schema version="1.0" targetNamespace="http://webservice.docx.abc.com/message" xmlns:xns="http://webservice.docx.abc.com/message" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="DocumentUserDetailsRequest">
<xs:sequence>
<xs:element name="password" type="xs:string" minOccurs="0"/>
<xs:element name="userID" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="DocumentResponseStatus">
<xs:sequence>
<xs:element name="errorDetailsMap">
<xs:complexType>
<xs:sequence>
<xs:element name="entry" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="key" minOccurs="0" type="xs:string"/>
<xs:element name="value" minOccurs="0" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="success" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="DocumentUploadRequest">
<xs:complexContent>
<xs:extension base="xns:DocumentUserDetailsRequest">
<xs:sequence>
<xs:element name="docName" type="xs:string" minOccurs="0"/>
<xs:element name="folderName" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="DocumentUploadResponse">
<xs:complexContent>
<xs:extension base="xns:DocumentResponseStatus">
<xs:sequence>
<xs:element name="docNumber" type="xs:string" minOccurs="0"/>
<xs:element name="docName" type="xs:string" minOccurs="0"/>
<xs:element name="Date" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
2nd XSD:
<?xml version="1.0" encoding="UTF-8"?>
<!--Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.3-07/10/2008 08:41 PM(bt).-->
<xs:schema version="1.0" targetNamespace="http://webservice.docx.abc.com/" xmlns:xns="http://webservice.docx.abc.com/" xmlns:ns1="http://webservice.docx.abc.com/message" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://webservice.docx.abc.com/message" schemaLocation="XyzWebService.xsd"/>
<xs:element name="docUpload" type="xns:docUpload"/>
<xs:element name="docUploadResponse" type="xns:docUploadResponse"/>
<xs:complexType name="docUpload">
<xs:sequence>
<xs:element name="arg0" type="ns1:DocumentUploadRequest" minOccurs="0"/>
<xs:element name="arg1" type="xs:base64Binary" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="docUploadResponse">
<xs:sequence>
<xs:element name="return" type="ns1:DocumentUploadResponse" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
This is not an answer - I 'm just posting it here so you can read it.
Your original imports look fine to me and should be supported.
I took your files, and gave them valid import references (they were still referencing and external server) and everything worked when I tried it, so I'm going to need your original hosted WSDL, XSDs to better diagnose the issue. Is that possible?
File contents:
WSDL
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://webservice.docx.abc.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://webservice.docx.abc.com/" name="XyzWebService">
<types>
<xsd:schema>
<xsd:import namespace="http://webservice.docx.abc.com/message" schemaLocation="XyzWebService1.xsd" />
</xsd:schema>
<xsd:schema>
<xsd:import namespace="http://webservice.docx.abc.com/" schemaLocation="XyzWebService2.xsd" />
</xsd:schema>
</types>
<message name="docUpload">
<part name="parameters" element="tns:docUpload" />
</message>
<message name="docUploadResponse">
<part name="parameters" element="tns:docUploadResponse" />
</message>
<portType name="XyzWebServicePortType">
<operation name="docUpload">
<input message="tns:docUpload" />
<output message="tns:docUploadResponse" />
</operation>
</portType>
<binding name="XyzWebServicePortTypePortBinding" type="tns:XyzWebServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<operation name="docUpload">
<soap:operation soapAction="" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="XyzWebService">
<port name="XyzWebServicePortTypePort" binding="tns:XyzWebServicePortTypePortBinding">
<soap:address location="https://www.xxx.com:123/docxservices/XyzWebService" />
</port>
</service>
</definitions>
XyzWebService1.xsd
<?xml version="1.0" encoding="UTF-8"?>
<!--Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.3-07/10/2008 08:41 PM(bt).-->
<xs:schema version="1.0" targetNamespace="http://webservice.docx.abc.com/message" xmlns:xns="http://webservice.docx.abc.com/message" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="DocumentUserDetailsRequest">
<xs:sequence>
<xs:element name="password" type="xs:string" minOccurs="0"/>
<xs:element name="userID" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="DocumentResponseStatus">
<xs:sequence>
<xs:element name="errorDetailsMap">
<xs:complexType>
<xs:sequence>
<xs:element name="entry" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="key" minOccurs="0" type="xs:string"/>
<xs:element name="value" minOccurs="0" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="success" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="DocumentUploadRequest">
<xs:complexContent>
<xs:extension base="xns:DocumentUserDetailsRequest">
<xs:sequence>
<xs:element name="docName" type="xs:string" minOccurs="0"/>
<xs:element name="folderName" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="DocumentUploadResponse">
<xs:complexContent>
<xs:extension base="xns:DocumentResponseStatus">
<xs:sequence>
<xs:element name="docNumber" type="xs:string" minOccurs="0"/>
<xs:element name="docName" type="xs:string" minOccurs="0"/>
<xs:element name="Date" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
XyzWebService2.xsd
<?xml version="1.0" encoding="UTF-8"?>
<!--Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.3-07/10/2008 08:41 PM(bt).-->
<xs:schema version="1.0" targetNamespace="http://webservice.docx.abc.com/" xmlns:xns="http://webservice.docx.abc.com/" xmlns:ns1="http://webservice.docx.abc.com/message" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://webservice.docx.abc.com/message" schemaLocation="XyzWebService.xsd"/>
<xs:element name="docUpload" type="xns:docUpload"/>
<xs:element name="docUploadResponse" type="xns:docUploadResponse"/>
<xs:complexType name="docUpload">
<xs:sequence>
<xs:element name="arg0" type="ns1:DocumentUploadRequest" minOccurs="0"/>
<xs:element name="arg1" type="xs:base64Binary" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="docUploadResponse">
<xs:sequence>
<xs:element name="return" type="ns1:DocumentUploadResponse" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
Although you have your domains redacted, I notice you have a port number :123 on your resource:
https://www.xxx.com:123/docxservices/XyzWebService?xsd=1
Assume that all resources need to be reachable by Amazon AWS servers and that odd ports might be blocked. So if your https resource isn't on 443 it may be a problem for the Apigee system to connect to it.
I have a method:
public static DataSet getTable()
{
DataSet DS = new DataSet("My Set");
DS.ReadXml(getCategories());
return DS;
}
My getCategories() returns a stream containing my XML.
But when I run this, I get this error:
The supplied xml instance is a schema or contains an inline schema. This class cannot infer a schema for a schema.
So I'm not sure what to do.
My goal is to use the call to getTable() to populate a DataList.
I've tried using the DataTable and I get a different, but similar error.
Any help would be great.
Thanks.
Here is my XML file. Might help. Thanks.
<?xml version="1.0" encoding="utf-8"?>
<WSPackage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
<ResponseInteger>0</ResponseInteger>
<ResponseBoolean>false</ResponseBoolean>
<ResponseDataset>
<xs:schema id="CategoryDS" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="CategoryDS" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Category">
<xs:complexType>
<xs:sequence>
<xs:element name="PartCategories" type="xs:string" minOccurs="0" />
<xs:element name="CategoryDescriptions" type="xs:string" minOccurs="0" />
<xs:element name="CategoryImageURLs" type="xs:string" minOccurs="0" />
<xs:element name="CategoryModelFlags" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<CategoryDS xmlns="">
<Category diffgr:id="Category1" msdata:rowOrder="0" diffgr:hasChanges="inserted">
<PartCategories>TESTCAT</PartCategories>
<CategoryDescriptions>TESTING API</CategoryDescriptions>
<CategoryImageURLs />
<CategoryModelFlags />
</Category>
</CategoryDS>
</diffgr:diffgram>
</ResponseDataset>
<ErrorMessage />
<UserMessage />
</WSPackage>
It is related to the fact that you have the following xml in there.. If you take that out it should work. it is not going to create a schema for something that already exists.
<xs:element name="Category">
<xs:complexType>
<xs:sequence>
<xs:element name="PartCategories" type="xs:string" minOccurs="0" />
<xs:element name="CategoryDescriptions" type="xs:string" minOccurs="0" />
<xs:element name="CategoryImageURLs" type="xs:string" minOccurs="0" />
<xs:element name="CategoryModelFlags" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
t