Error generating web service client from wsdl using apache CXF 3 - eclipse

I am trying to generate the web service client from WSDL , I am quiet new to this so can't figure out the error.
I have tried:
wsimport -keep path-to-wsdl
which gives me this error :
C:\WINDOWS\system32>wsimport -keep E:\NIEsocketWork\sdl.wsdl
parsing WSDL...
[WARNING] src-resolve.4.2: Error resolving component 'tns:GetMerchantRateRequest'. It was detected that 'tns:GetMerchantRateRequest' is in namespace 'http://www.fexcodcc.com/DCC20071126', but components from this namespace are not referenceable from schema document 'file:/E:/NIEsocketWork/sdl.wsdl#types?schema1'. If this is the incorrect namespace, perhaps the prefix of 'tns:GetMerchantRateRequest' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:/E:/NIEsocketWork/sdl.wsdl#types?schema1'.
line 20 of file:/E:/NIEsocketWork/sdl.wsdl#types?schema1
[WARNING] src-resolve: Cannot resolve the name 'tns:GetMerchantRateRequest' to a(n) 'type definition' component.
line 20 of file:/E:/NIEsocketWork/sdl.wsdl#types?schema1
[ERROR] undefined simple or complex type 'tns:GetMerchantRateRequest'
line 20 of file:/E:/NIEsocketWork/sdl.wsdl
[ERROR] undefined simple or complex type 'tns:GetMerchantRateResponse'
line 26 of file:/E:/NIEsocketWork/sdl.wsdl
[ERROR] undefined simple or complex type 'tns:GetCardRateRequest'
line 79 of file:/E:/NIEsocketWork/sdl.wsdl
[ERROR] undefined simple or complex type 'tns:GetCardRateResponse'
line 85 of file:/E:/NIEsocketWork/sdl.wsdl
Exception in thread "main" com.sun.tools.internal.ws.wscompile.AbortException
at com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:129)
at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2283)
at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:183)
at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:126)
at com.sun.tools.internal.ws.wscompile.WsimportTool.buildWsdlModel(WsimportTool.java:429)
at com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:190)
at com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:168)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:159)
at com.sun.tools.internal.ws.WsImport.main(WsImport.java:42)
I have also tried apache cxf 3.1.1 to generate the web service client in eclipse but get this error :
Loading FrontEnd jaxws ...
Loading DataBinding jaxb ...
wsdl2java -client -d C:\Users\Hamza\GalileoWorkspace\NIDCCFexco\.cxftmp/src -classdir C:\Users\Hamza\GalileoWorkspace\NIDCCFexco\build\classes -p http://www.fexcodcc.com/DCC20071126=com.fexcodcc.dcc20071126 -impl -validate -exsh false -dns true -dex true -wsdlLocation file:///E:/NIEsocketWork/sdl.wsdl -verbose -defaultValues -fe jaxws -db jaxb -wv 1.1 file:/E:/NIEsocketWork/sdl.wsdl
wsdl2java - Apache CXF 3.1.1
WSDLToJava Error:
Summary: Failures: 4, Warnings: 0
<<< ERROR!
Part <parameters> in Message <{http://www.fexcodcc.com/DCC20071126}GetMerchantRateOut> referenced Type <{http://www.fexcodcc.com/DCC20071126}GetMerchantRateResult> can not be found in the schemas
Part <parameters> in Message <{http://www.fexcodcc.com/DCC20071126}GetCardRateOut> referenced Type <{http://www.fexcodcc.com/DCC20071126}GetCardRateResult> can not be found in the schemas
Part <parameters> in Message <{http://www.fexcodcc.com/DCC20071126}GetCardRateIn> referenced Type <{http://www.fexcodcc.com/DCC20071126}GetCardRate> can not be found in the schemas
Part <parameters> in Message <{http://www.fexcodcc.com/DCC20071126}GetMerchantRateIn> referenced Type <{http://www.fexcodcc.com/DCC20071126}GetMerchantRate> can not be found in the schemas
org.apache.cxf.tools.common.ToolException:
Summary: Failures: 4, Warnings: 0
<<< ERROR!
Part <parameters> in Message <{http://www.fexcodcc.com/DCC20071126}GetMerchantRateOut> referenced Type <{http://www.fexcodcc.com/DCC20071126}GetMerchantRateResult> can not be found in the schemas
Part <parameters> in Message <{http://www.fexcodcc.com/DCC20071126}GetCardRateOut> referenced Type <{http://www.fexcodcc.com/DCC20071126}GetCardRateResult> can not be found in the schemas
Part <parameters> in Message <{http://www.fexcodcc.com/DCC20071126}GetCardRateIn> referenced Type <{http://www.fexcodcc.com/DCC20071126}GetCardRate> can not be found in the schemas
Part <parameters> in Message <{http://www.fexcodcc.com/DCC20071126}GetMerchantRateIn> referenced Type <{http://www.fexcodcc.com/DCC20071126}GetMerchantRate> can not be found in the schemas
at org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:139)
at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:207)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:204)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:164)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:415)
at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
My WSDL file is :
<?xml version="1.0" encoding="utf-8" ?>
<wsdl:definitions targetNamespace="http://www.fexcodcc.com/DCC20071126"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:tns="http://www.fexcodcc.com/DCC20071126"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsi="http://ws-i.org/schemas/conformanceClaim/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:documentation>DCC Gateway (Provides functionality to make requests to the DCC for availability)</wsdl:documentation>
<!-- Types --> <wsdl:types>
<xsd:schema elementFormDefault="qualified" targetNamespace="http:// www.fexcodcc.com/DCC20071126" xmlns:dhs="urn:dhs">
<!-- Type definitions -->
<xsd:element name="GetMerchantRate"> <xsd:complexType>
<xsd:sequence>
<xsd:element name="GetMerchantRateRequest" type="tns:GetMerchantRateRequest" minOccurs="1" maxOccurs="1"/>
</xsd:sequence> </xsd:complexType>
</xsd:element>
<xsd:element name="GetMerchantRateResult"> <xsd:complexType>
<xsd:sequence>
<xsd:element name="GetMerchantRateResponse" type="tns:GetMerchantRateResponse" minOccurs="1" maxOccurs="1" />
</xsd:sequence> </xsd:complexType>
</xsd:element>
<!-- Complex type definitions -->
<xsd:complexType name="GetMerchantRateResponse"> <xsd:sequence>
<xsd:element name="ReferenceNumber" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="ExchangeRate" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="FgnCurCode" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="FgnAmount" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="DccOffered" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="ValidHours" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="MarginRatePercentage" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="ExchangeRateSourcename" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="CommissionPercentage" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="ExchangerateSourceTimestamp" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="MinorUnits" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="ResponseCode" type="xsd:string" minOccurs="1" maxOccurs="1" />
</xsd:sequence> </xsd:complexType>
<xsd:complexType name="GetMerchantRateRequest"> <xsd:sequence>
<xsd:element name="ReferenceNumber" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="MerchantId" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="Acquirer" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="FgnCurCode" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="BaseAmount" type="xsd:string" minOccurs="0" maxOccurs="1" />
</xsd:sequence> </xsd:complexType>
<xsd:element name="GetCardRate"> <xsd:complexType>
<xsd:sequence>
<xsd:element name="GetCardRateRequest" type="tns:GetCardRateRequest" minOccurs="1" maxOccurs="1" />
</xsd:sequence> </xsd:complexType>
</xsd:element>
<xsd:element name="GetCardRateResult"> <xsd:complexType>
<xsd:sequence>
<xsd:element name ="GetCardRateResponse" type="tns:GetCardRateResponse" minOccurs="1" maxOccurs="1" />
</xsd:sequence> </xsd:complexType>
</xsd:element>
<!-- Complex type definitions --> <xsd:complexType name="GetCardRateResponse">
<xsd:sequence>
<xsd:element name="ReferenceNumber" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="ExchangeRate" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="FgnCurCode" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="FgnAmount" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="DccOffered" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="ValidHours" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="MarginRatePercentage" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="ExchangeRateSourceName" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="CommissionPercentage" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="ExchangeRateSourceTimestamp" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element name="MinorUnits" type="xsd:string" minOccurs="0" maxOccurs="1" /><xsd:element name="ResponseCode" type="xsd:string" minOccurs="1" maxOccurs="1" />
</xsd:sequence> </xsd:complexType>
<xsd:complexType name="GetCardRateRequest"> <xsd:sequence>
<xsd:element name="ReferenceNumber" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="CardId" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="MerchantId" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="Acquirer" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="BaseAmount" type="xsd:string" minOccurs="0" maxOccurs="1" />
</xsd:sequence> </xsd:complexType>
</xsd:schema> </wsdl:types>
<!-- Dhs Server Messages --> <wsdl:message name="GetMerchantRateIn">
<wsdl:part name="parameters" element="tns:GetMerchantRate" /> </wsdl:message>
<wsdl:message name="GetMerchantRateOut">
<wsdl:part name="parameters" element="tns:GetMerchantRateResult" /> </wsdl:message>
<wsdl:message name="GetCardRateIn">
<wsdl:part name="parameters" element="tns:GetCardRate" /> </wsdl:message>
<wsdl:message name="GetCardRateOut">
<wsdl:part name="parameters" element="tns:GetCardRateResult" /> </wsdl:message>
<!-- End of Dhs Server Messages -->
<!-- Port types --> <wsdl:portType name="DHS">
<wsdl:operation name="getMerchantRate">
<wsdl:documentation>Get Exchange Rate for merchant</wsdl:documentation> <wsdl:input message="tns:GetMerchantRateIn" />
<wsdl:output message="tns:GetMerchantRateOut" /> </wsdl:operation>
<wsdl:operation name="getCardRate">
<wsdl:documentation>Get Dynamic Currency conversion</wsdl:documentation> <wsdl:input message="tns:GetCardRateIn" />
<wsdl:output message="tns:GetCardRateOut" /> </wsdl:operation>
<!-- End of Dhs Server Operations --> </wsdl:portType>
<!-- WSDL bindings -->
<wsdl:binding name="DHS12" type="tns:DHS"> <wsdl:documentation>
<wsi:Claim conformsTo="http://ws-i.org/profiles/basic/1.1" /> </wsdl:documentation>
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<wsdl:operation name="getMerchantRate">
<soap12:operation soapAction="http://www.fexcodcc.com/DCC20071126/ getMerchantRate" style="document" />
<wsdl:input>
<soap12:body use="literal" /> </wsdl:input>
<wsdl:output>
<soap12:body use="literal" /> </wsdl:output>
</wsdl:operation>
<wsdl:operation name="getCardRate">
<soap12:operation soapAction="http://www.fexcodcc.com/DCC20071126/ getCardRate" style="document" />
<wsdl:input>
<soap12:body use="literal" /> </wsdl:input>
<wsdl:output>
<soap12:body use="literal" /> </wsdl:output>
</wsdl:operation> </wsdl:binding>
<!-- WSDL service -->
<wsdl:service name="DHS">
<wsdl:documentation> DHS Server(Provides functionality to make DCC availability requests)</wsdl:documentation>
<wsdl:port name="DHS12" binding="tns:DHS12">
<soap12:address location="dhstest2.fexcodccapps.com/axis2/services/DHS" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
please help me figure out the error in any of the ways, whether wsimport or apache cxf. I will be really grateful.

in the schema declaration there is a space too much after the slashes: http:// www.fexcodcc.com/DCC20071126 instead of http://www.fexcodcc.com/DCC20071126.
try removing that space and it validates.

Related

SOAP::WSDL returns error Can't use an undefined value as an ARRAY reference

I have a perl program that is accessing a soap server. when testing the soap server via SoapUI it works, but when using my perl program I get
Can't use an undefined value as an ARRAY reference at /Library/Perl/5.18/SOAP/WSDL.pm line 222.
Here is my perl script.
use SOAP::WSDL;
my $data = 'some data here';
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
my $client = SOAP::WSDL->new( 'wsdl' => "link_to_wsdl" );
my $result = $client->call('MyMethod', $data);
use Data::Dumper;
print Dumper($result);
Here is the WSDL
<?xml version="1.0"?>
<wsdl:definitions
name="Test"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="urn:APISoapServer"
targetNamespace="urn:APISoapServer"
>
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:APISoapServer">
<xsd:element name="MyMethod">
<xsd:complexType>
<xsd:complexContent mixed="true">
<xsd:restriction base="xsd:anyType">
<xsd:sequence>
<xsd:element name="operand1" type="xsd:string" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="MyMethodResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Confirmation" maxOccurs="unbounded">
<xsd:complexType>
<xsd:complexContent>
<xsd:restriction base="xsd:anyType">
<xsd:attribute name="response" type="xsd:string"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="MYAPIRequest">
<wsdl:part name="MYAPIRequestPart" element="tns:MyMethod"/>
</wsdl:message>
<wsdl:message name="MYAPIResponse">
<wsdl:part name="MYAPIResponsePart" element="tns:MyMethodResponse"/>
</wsdl:message>
<wsdl:portType name="MYAPIServerPort">
<wsdl:operation name="MyMethod">
<wsdl:input name="MyMethodInput" message="tns:MYAPIRequest"/>
<wsdl:output name="MyMethodOutput" message="tns:MYAPIResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="MYAPIServerBinding" type="tns:MYAPIServerPort">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="MyMethod">
<soap12:operation style="document" soapAction="urn:APISoapServer#MyMethod" />
<wsdl:input name="MyMethodInput">
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output name="MyMethodOutput">
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="MYAPIService">
<wsdl:port name="MYAPIPort" binding="tns:MYAPIServerBinding">
<soap12:address location="https://my.site.com/api/my_api_server.pl"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

how to write a wfs- transaction insert with geoserver/postgrsql

I have a database and a server tomcat / geoserver and I try to exchange data from openlayers.
So i am trying to write a wfs transaction without success. I do not know what's wrong, geometry?
I tried to copy the example provided in the demonstration without further success:
<ows:ExceptionReport version="1.0.0" xsi:schemaLocation="http://www.opengis.net/ows http://ip_address:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd"><ows:Exception exceptionCode="InvalidParameterValue"><ows:ExceptionText>Error performing insert: Error inserting features</ows:ExceptionText></ows:Exception></ows:ExceptionReport>
my try :
<wfs:Transaction service="WFS" version="1.1.0"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:cite="http://www.opengeospatial.net/cite"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/WFS-transaction.xsd http://www.opengeospatial.net/cite http://ip_address:8080/geoserver/wfs/DescribeFeatureType?typename=cite:administration">
<wfs:Insert>
<cite:administration>
<cite:geom>
<gml:MultiPolygon xmlns="http://www.opengis.net/gml" srsName="EPSG:2154"><gml:polygonMember><gml:Polygon srsName="EPSG:3857"><gml:exterior><gml:LinearRing srsName="EPSG:2154"><gml:posList srsDimension="2">1033195.5041126036 6284576.928642391 1033176.0281535687 6284534.392003635 1033215.4422350351 6284544.237956143 1033195.5041126036 6284576.928642391</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:polygonMember></gml:MultiPolygon>
</cite:geom>
</cite:administration>
</wfs:Insert>
</wfs:Transaction>
the describeFeatuyreType
<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cite="http://www.opengeospatial.net/cite" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:wfs="http://www.opengis.net/wfs/2.0" elementFormDefault="qualified" targetNamespace="http://www.opengeospatial.net/cite">
<xsd:import namespace="http://www.opengis.net/gml/3.2" schemaLocation="ip_address:8080/geoserver/schemas/gml/3.2.1/gml.xsd"/>
<xsd:complexType name="administrationType">
<xsd:complexContent>
<xsd:extension base="gml:AbstractFeatureType">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="surface" nillable="true" type="xsd:decimal"/>
<xsd:element maxOccurs="1" minOccurs="0" name="annee_prescription" nillable="true" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="0" name="ro" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="numope" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="typope" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="geom" nillable="true" type="gml:MultiSurfacePropertyType"/>
<xsd:element maxOccurs="1" minOccurs="0" name="typemp" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="nomope" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="numoa" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="numprescr" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="tranche" nillable="true" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="0" name="code_tranche" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="surfaceC_ha" nillable="true" type="xsd:decimal"/>
<xsd:element maxOccurs="1" minOccurs="0" name="ratioC_ha" nillable="true" type="xsd:decimal"/>
<xsd:element maxOccurs="1" minOccurs="0" name="amenageur" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="opérateur" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="prescripteur" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="statut_contractuel" nillable="true" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="statut_operationnel" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="administration" substitutionGroup="gml:AbstractFeature" type="cite:administrationType"/>
</xsd:schema>
The srs is EPSG:2154
the openlayers transaction that does not work either :
var wfst = new ol.format.WFS({
featureNS: "http://www.opengeospatial.net/cite",
featureType: "cite:administration"
});
var options = {
srsName: "EPSG:2154",
featureNS: "http://www.opengeospatial.net/cite",
featurePrefix:'cite',
featureType: "cite:administration",
gmlOptions:{featureNS: "http://www.opengeospatial.net/cite",featureType: "cite:administration",srsName: "EPSG:2154"}
};
var node = wfst.writeTransaction(features2154,null,null,options);
console.log('node',node);
var s = new XMLSerializer();
var str = s.serializeToString(node);
result str =
<Transaction xmlns="http://www.opengis.net/wfs" service="WFS" version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Insert><cite:administration xmlns:cite="http://www.opengeospatial.net/cite"><cite:geometry><MultiPolygon xmlns="http://www.opengis.net/gml" srsName="EPSG:2154"><polygonMember><Polygon srsName="EPSG:2154"><exterior><LinearRing srsName="EPSG:2154"><posList srsDimension="2">1033187.44577774 6284581.696198352 1033171.7481650712 6284533.302464095 1033221.5049866531 6284544.554293833 1033187.44577774 6284581.696198352</posList></LinearRing></exterior></Polygon></polygonMember></MultiPolygon></cite:geometry><cite:collectedProperties>[object Object]</cite:collectedProperties></cite:administration></Insert></Transaction>
my response :
it lacked the necessary attributes for transaction (not null values in POSTGIS exception)
<wfs:Transaction service="WFS" version="1.1.0"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:cite="http://www.opengeospatial.net/cite"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/WFS-transaction.xsd http://www.opengeospatial.net/cite http://IP:8080/geoserver/wfs/DescribeFeatureType?typename=cite:prescription">
<wfs:Insert>
<cite:prescription>
<cite:geom>
<gml:MultiPolygon xmlns="http://www.opengis.net/gml" srsName="EPSG:2154"><gml:polygonMember><gml:Polygon srsName="EPSG:2154"><gml:exterior><gml:LinearRing srsName="EPSG:2154"><gml:posList srsDimension="2">1033195.5041126036 6284576.928642391 1033176.0281535687 6284534.392003635 1033215.4422350351 6284544.237956143 1033195.5041126036 6284576.928642391</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></gml:polygonMember></gml:MultiPolygon>
</cite:geom>
<cite:numope>D000000</cite:numope>
<cite:numoa>11111111</cite:numoa>
<cite:annee_prescription>2020</cite:annee_prescription>
<cite:ro>albert</cite:ro>
<cite:typope>diagnostic</cite:typope>
<cite:typemp>prescrite</cite:typemp>
</cite:prescription>
</wfs:Insert>
</wfs:Transaction>

SOAP and arrays + SUDS

This is my first time working with soap.
I managed to take my first steps following the tutorials, but now im stuck. Im trying to work with mantis (mantisbt.org). Im trying to post such data to the server:
<xsd:complexType name="IssueData">
<xsd:all>
<xsd:element name="id" type="xsd:integer" minOccurs="0"/>
<xsd:element name="view_state" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="last_updated" type="xsd:dateTime" minOccurs="0"/>
<xsd:element name="project" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="category" type="xsd:string" minOccurs="0"/>
<xsd:element name="priority" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="severity" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="status" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="reporter" type="tns:AccountData" minOccurs="0"/>
<xsd:element name="summary" type="xsd:string" minOccurs="0"/>
<xsd:element name="version" type="xsd:string" minOccurs="0"/>
<xsd:element name="build" type="xsd:string" minOccurs="0"/>
<xsd:element name="platform" type="xsd:string" minOccurs="0"/>
<xsd:element name="os" type="xsd:string" minOccurs="0"/>
<xsd:element name="os_build" type="xsd:string" minOccurs="0"/>
<xsd:element name="reproducibility" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="date_submitted" type="xsd:dateTime" minOccurs="0"/>
<xsd:element name="sponsorship_total" type="xsd:integer" minOccurs="0"/>
<xsd:element name="handler" type="tns:AccountData" minOccurs="0"/>
<xsd:element name="projection" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="eta" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="resolution" type="tns:ObjectRef" minOccurs="0"/>
<xsd:element name="fixed_in_version" type="xsd:string" minOccurs="0"/>
<xsd:element name="target_version" type="xsd:string" minOccurs="0"/>
<xsd:element name="description" type="xsd:string" minOccurs="0"/>
<xsd:element name="steps_to_reproduce" type="xsd:string" minOccurs="0"/>
<xsd:element name="additional_information" type="xsd:string" minOccurs="0"/>
<xsd:element name="attachments" type="tns:AttachmentDataArray" minOccurs="0"/>
<xsd:element name="relationships" type="tns:RelationshipDataArray" minOccurs="0"/>
<xsd:element name="notes" type="tns:IssueNoteDataArray" minOccurs="0"/>
<xsd:element name="custom_fields" type="tns:CustomFieldValueForIssueDataArray" minOccurs="0"/>
<xsd:element name="due_date" type="xsd:dateTime" minOccurs="0"/>
<xsd:element name="monitors" type="tns:AccountDataArray" minOccurs="0"/>
<xsd:element name="sticky" type="xsd:boolean" minOccurs="0"/>
<xsd:element name="tags" type="tns:ObjectRefArray" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
and it worked just fine. But then i found out i also need to fill some custom_fields. They are described as tns:CustomFieldValueForIssueDataArray.
<xsd:complexType name="CustomFieldValueForIssueDataArray">
<xsd:complexContent>
<xsd:restriction base="SOAP-ENC:Array">
<xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:CustomFieldValueForIssueData[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
I read from that that this should consist of CustomFieldValueForIssueData objects.
so i created two of those with relevant data:
contact_data = client.factory.create('CustomFieldValueForIssueData')
contact_data.field = contact_field
contact_data.value = 'alan#mysite.ee'
client_data = client.factory.create('CustomFieldValueForIssueData')
client_data.field = client_field
client_data.value = u'alan, alan kesselmann'
But how to add/append/push/whatever those values to array now? If i try to do something like this :
issue.custom_fields = [client_field, contact_field]
and then post it using:
client.service.mc_issue_add(user, pwd, issue)
Then all i get is an error. without custom_fields this ms_issue_add works.
Alan
Figured it out myself...
What i had to do was :
customfields = client.factory.create('CustomFieldValueForIssueDataArray') #had done it before too
customfields.items = [client_data, contact_data] # the new stuff that i didnt know
issue.custom_fields = customfields
client.service.mc_issue_add(user, pwd, issue)
Alan

Matlab compatible .wsdl file

I trying to make a web service accessible to Matlab. I can call it from PHP but Matlab doesn't seem to be able to parse the definition.
??? Attempt to reference field of non-structure array.
Error in ==> createClassFromWsdl>parseWsdl at 72
se = defTypes.getExtensibilityElements().get(0);
Error in ==> createClassFromWsdl at 32
[R, schema] = parseWsdl(wsdlUrl);
WSDL File:
<?xml version ='1.0' encoding ='UTF-8' ?>
<definitions name='server3'
targetNamespace='http://server.edu/php/soap_test/server3.wsdl'
xmlns:tns='http://server.edu/php/soap_test/server3.wsdl'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
xmlns='http://schemas.xmlsoap.org/wsdl/'>
<xsd:complexType name="ActivityData">
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" name="HomeId" type="string"/>
<xsd:element minOccurs="1" maxOccurs="1" name="TStamp" type="string"/>
<xsd:element minOccurs="1" maxOccurs="1" name="Description" type="string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ArrayOfActivityData">
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="keyval" type="tns:ActivityData"/>
</xsd:sequence>
</xsd:complexType>
<message name='getRangeRequest'>
<part name='inHomeId' type='xsd:int'/>
<part name='inStartDate' type='xsd:string'/>
<part name='inEndDate' type='xsd:string'/>
</message>
<message name='getRangeResponse'>
<part name='out1' type='ArrayOfActivityData'/>
</message>
<portType name='getRangePortType'>
<operation name='getRange'>
<input message='tns:getRangeRequest'/>
<output message='tns:getRangeResponse'/>
</operation>
</portType>
<binding name='getRangeBinding' type='tns:getRangePortType'>
<soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='getRange'>
<soap:operation soapAction='urn:xmethods-get-range#getRange'/>
<input>
<soap:body use='encoded' namespace='urn:xmethods-get-range' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</input>
<output>
<soap:body use='encoded' namespace='urn:xmethods-get-range' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</output>
</operation>
</binding>
<service name='getRangeService'>
<port name='getRangePort' binding='getRangeBinding'>
<soap:address location='http://server.edu/php/soap_test/soap_server3.php'/>
</port>
</service>
</definitions>
Reading the Matlab docs states:
The createClassFromWsdl function works with WSDL documents that comply with the WS-I 1.0 standard and use one of these forms: RPC-encoded, RPC-literal, Document-literal, or Document-literal-wrapped.
My Matlab install works with some sample WSDL files. So now Im trying to figure out what's wrong with mine. Suggestions?
FWIW: There are four issues:
1) the 'xsd:complexType' entries need to be in a 'types' section.
2) the 'service/port#binding' attribute needs to be 'tns:getRangeBinding'.
3) 'binding/operation/soap:operation#soapAction' should be 'urn:xmethods-get-range:getRange'
4) 'binding/operation/input/soap:body#namespace' should match #3.

How do I declare the return type of a SOAP method to be a map (in its WSDL)?

I am adding a method to a SOAP service. I would like this method to be able to return a map. More specifically it is map of lists (vectors/arrays). How would I capture this in its WSDL?
Here's and XSD type for a regular map from string to string:
<xsd:complexType name="MapDataType">
<xsd:sequence>
<xsd:element name="Pair" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Key" type="xsd:string" maxOccurs="1" minOccurs="1"/>
<xsd:element name="Value" type="xsd:string" maxOccurs="1" minOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
Is this what you want? You'll need to use this as the type for your return value.
I'm not sure what you mean by 'map of lists'