I'm trying to create a wsdl in eclipse, but it is generating an error adding headers, the error is "The 'Producto_httpPort' port has an invalid binding - 'Producto_httpBinding' Check that. the 'Producto_httpBinding' is defined binding. ProductoService.wsdl / ssss / WebContent / wsdl WSDL line 72 Problem "punishment immediately to this? basically I need to stop the wsdl with headers included, as I can do?
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions name="ProductoService"
targetNamespace="http://www.ABC.co/Contrato/Service" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.ABC.co/Contrato/Service"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ser="http://www.ABC.co/Cuerpo/schemas"
xmlns:ser1="http://www.ABC.co/Cabecera/schemas">
<wsdl:types>
<xsd:schema>
<xsd:import schemaLocation="../Schemas/Cuerpo.xsd"
namespace="http://www.ABC.co/Cuerpo/schemas" />
<xsd:import schemaLocation="../Schemas/Cabecera.xsd"
namespace="http://www.ABC.co/Cabecera/schemas" />
</xsd:schema>
</wsdl:types>
<wsdl:message name="Consulta">
<wsdl:part type="ser1:headerEntrada" name="headerConsulta" />
<wsdl:part type="ser:msgEntrada" name="Consulta" />
</wsdl:message>
<wsdl:message name="RespuestaConsulta">
<wsdl:part type="ser1:headerSalida" name="headerConsultaResponse" />
<wsdl:part type="ser:msgSalida" name="ConsultaResponse" />
</wsdl:message>
<wsdl:message name="Actualiza">
<wsdl:part type="ser1:headerEntrada" name="headerActualiza" />
<wsdl:part type="ser:msgEntrada" name="Actualiza" />
</wsdl:message>
<wsdl:message name="RespuestaActualiza">
<wsdl:part type="ser1:headerSalida" name="headerActualizaResponse" />
<wsdl:part type="ser:msgSalida" name="ActualizaResponse" />
</wsdl:message>
<wsdl:portType name="ProductoPortType">
<wsdl:operation name="Consultar">
<wsdl:input message="tns:Consulta" />
<wsdl:output message="tns:RespuestaConsulta" />
</wsdl:operation>
<wsdl:operation name="Actualizar">
<wsdl:input message="tns:Actualiza" />
<wsdl:output message="tns:RespuestaActualiza" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Producto_httpBinding" type="tns:ProductoPortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="Consultar">
<soap:operation soapAction="" />
<wsdl:input>
<soap:header use="literal" part="headerConsulta"
message="Consulta" />
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:header use="literal" part="headerConsultaResponse"
message="RespuestaConsulta" />
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Actualizar">
<soap:operation soapAction="" />
<wsdl:input>
<soap:header use="literal" part="headerActualiza"
message="Actualiza" />
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:header use="literal" part="headerActualizaResponse"
message="RespuestaActualiza" />
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Producto_httpService">
<wsdl:port binding="tns:Producto_httpBinding" name="Producto_httpPort">
<soap:address location="http://www.ABC.co/ProductoService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Cuerpo.xsd:
<xs:schema xmlns="http://www.ABC.co/Cuerpo/schemas" targetNamespace="http://www.ABC.co/Cuerpo/schemas" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:complexType name="msgEntrada">
<xs:sequence>
<xs:element name="nroIdentificador" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:long">
<xs:minExclusive value="1"/>
<xs:maxExclusive value="99999999999"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="tipoIdentificador" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="3"/>
<xs:enumeration value="CED"/>
<xs:enumeration value="NIT"/>
<xs:enumeration value="CEE"/>
<xs:enumeration value="REG"/>
<xs:enumeration value="AHO"/>
<xs:enumeration value="TCR"/>
<xs:enumeration value="TDE"/>
<xs:enumeration value="ETB"/>
<xs:enumeration value="AGU"/>
<xs:enumeration value="GAS"/>
<xs:enumeration value="LUZ"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="fechaAdicional" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="\d{4}[-]\d{2}[-]\d{2}"/>
<xs:length value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="msgSalida">
<xs:sequence>
<xs:element name="nroAutorizacion" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:long">
<xs:minExclusive value="1"/>
<xs:maxExclusive value="9999999999"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="valor" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:double">
<xs:minExclusive value="0"/>
<xs:maxExclusive value="999999999999"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
Cabecera.xsd:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="http://www.ABC.co/Cabecera/schemas" targetNamespace="http://www.ABC.co/Cabecera/schemas" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:complexType name="headerEntrada">
<xs:sequence>
<xs:element name="canalOrigen" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="3"/>
<xs:enumeration value="CAJ"/>
<xs:enumeration value="WEB"/>
<xs:enumeration value="BMO"/>
<xs:enumeration value="OFI"/>
<xs:enumeration value="CNB"/>
<xs:enumeration value="IVR"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="canalDestino" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="3"/>
<xs:enumeration value="ETB"/>
<xs:enumeration value="AGU"/>
<xs:enumeration value="GAS"/>
<xs:enumeration value="LUZ"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="fechaTransaccion" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="\d{4}[-]\d{2}[-]\d{2}"/>
<xs:length value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="horaTransaccion" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="\d{2}[:]\d{2}[:]\d{2}"/>
<xs:length value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="headerSalida">
<xs:sequence>
<xs:element name="codRespuesta" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:int">
<xs:minExclusive value="0"/>
<xs:maxExclusive value="999"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="descRespuesta" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:whiteSpace value="collapse"/>
<xs:minLength value="1"/>
<xs:maxLength value="40"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
The binding tag in the WSDL has an incorrect syntax, the attributes message from the header tag in both the output and input should have the namespace like the following:
<wsdl:input>
<soap:header use="literal" part="headerConsulta" message="tns:Consulta" />
<soap:body use="literal" />
</wsdl:input>
Probably that is what generates the error message.
Related
I try to implement a SOAP-webservice with spring boot. Everything seems normal until I want to call it. I get the following Message:
No global element for root was found: {urn:com.companyname.dto}CalloutRequest
The wsdl looks the following:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:com.companyname"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="urn:com.companyname"
xmlns:dto="urn:com.companyname.dto">
<wsdl:types>
<xs:schema targetNamespace="urn:com.companyname">
<xs:import schemaLocation="CalloutServiceDto.xsd" namespace="urn:com.companyname.dto"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="CalloutRequestMessage">
<wsdl:part name="request" element="dto:CalloutRequest"></wsdl:part>
</wsdl:message>
<wsdl:message name="CalloutResponseMessage">
<wsdl:part name="response" element="dto:CalloutResponse"></wsdl:part>
</wsdl:message>
<wsdl:portType name="CalloutPortType">
<wsdl:operation name="callMeldungAusgang">
<wsdl:documentation>Wird eine KVUVMeldung zurueck ins SHIP erzeugt, erfolgt dies ueber diesen Service.
</wsdl:documentation>
<wsdl:input message="tns:CalloutRequestMessage"></wsdl:input>
<wsdl:output message="tns:CalloutResponseMessage"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CalloutBinding" type="tns:CalloutPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<wsdl:operation name="callMeldungAusgang">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CalloutService">
<wsdl:port name="CalloutPort" binding="tns:CalloutBinding">
<soap:address location="http://localhost:8080/Callout" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
The xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
targetNamespace="urn:com.companyname.dto"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="urn:com.companyname.dto"
elementFormDefault="qualified">
<xs:element name="CalloutRequest"
type="tns:CalloutRequestType" />
<xs:element name="CalloutResponse"
type="tns:CalloutResponseType" />
<xs:complexType name="CalloutRequestType">
<xs:annotation>
<xs:documentation>
Request fuer einen MeldungsAusgang, welcher ins gesendet wird.
e Beinhaltet nur das Response-XML, gehalten als String.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="xml" type="xs:string" minOccurs="1" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="CalloutResponseType">
<xs:annotation>
<xs:documentation>
Die Antwort der MeldungsAusgangs-Service
</xs:documentation>
</xs:annotation>
</xs:complexType>
</xs:schema>
If I call the webservice he gives me the error that there is no root element. I generate my code with wsdl2java and it works just fine. Just when I call the service via http://localhost:8080/Callout it gives me the error.
Thanks in advance
Hi i'm newbie working with wsdl, xsd and web services... I must generate some class from a wsdl generated in EA.
I found some problems trying to import 2 local schemas on same namespace, so my workaround was include schemas.
But now i find an Error that i can't resolve:
[ERROR] XML type "{http://www.iTEC.aero/AMANSequence}filter" could not be resolved, XML to JAVA binding failed! Please check the wsdl:part "filter" in the wsdl:message " {http://www.iTEC.aero
/AMANSequence}amanMessageFilter". line 75 of ***.wsdl
WSDL
<?xml version='1.0' encoding='UTF-8'?>
<wsdl:definitions name="iSwimService"
targetNamespace="http://www.iTEC.aero/AMANSequence"
xmlns:ns1="http://schemas.xmlsoap.org/soap/http"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.iTEC.aero/AMANSequence"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!--TYPES-->
<wsdl:types>
<xs:schema elementFormDefault="qualified" version="1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:seq="http://www.iTEC.aero/AMANSequence"
targetNamespace="http://www.iTEC.aero/AMANSequence">
<xs:include schemaLocation="AMANFilter.xsd" />
<xs:include schemaLocation="AMANSequence.xsd" />
<xs:element name="filter" type="seq:AMANSequenceFilterType" />
<xs:element name="sequence" type="seq:AMANSequence" />
</xs:schema>
</wsdl:types>
<!-- MESSAGES -->
<wsdl:message name="amanMessageSequence">
<wsdl:part type="tns:sequence" name="sequence" />
</wsdl:message>
<wsdl:message name="amanMessageFilter">
<wsdl:part type="tns:filter" name="filter" />
</wsdl:message>
<wsdl:message name="amanMessageSubscription">
<wsdl:part type="xs:string" name="stakeholderId" />
<wsdl:part type="tns:filter" name="filter" />
</wsdl:message>
<wsdl:message name="amanMessageUnSubscription">
<wsdl:part type="xs:string" name="stakeholderId" />
</wsdl:message>
<wsdl:message name="amanMessageReturn">
<wsdl:part type="xs:string" name="returnValue" />
</wsdl:message>
<wsdl:message name="amanFaultMessage">
<wsdl:part name="operationName" type="xs:string"/>
<wsdl:part name="errorCode" type="xs:string"/>
<wsdl:part name="errorMessage" type="xs:string"/>
</wsdl:message>
<!-- PORT TYPES -->
<wsdl:portType name="AMANSequenceInfo">
<wsdl:operation name="getAMANSequence">
<wsdl:input message="tns:amanMessageFilter" />
<wsdl:output message="tns:amanMessageSequence"/>
<wsdl:fault message="tns:amanFaultMessage" name="faultMessage"/>
</wsdl:operation>
<wsdl:operation name="publishAMANSequence">
<wsdl:input message="tns:amanMessageSequence" />
<wsdl:output message="tns:amanMessageReturn" />
<wsdl:fault message="tns:amanFaultMessage" name="faultMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:portType name="AMANSequenceSubscription">
<wsdl:operation name="subscribeToAMANSequence">
<wsdl:input message="tns:amanMessageSubscription" />
<wsdl:output message="tns:amanMessageReturn" />
<wsdl:fault message="tns:amanFaultMessage" name="faultMessage"/>
</wsdl:operation>
<wsdl:operation name="unsubscribeToAMANSequence">
<wsdl:input message="tns:amanMessageUnSubscription" />
<wsdl:output message="tns:amanMessageReturn" />
<wsdl:fault message="tns:amanFaultMessage" name="faultMessage"/>
</wsdl:operation>
</wsdl:portType>
<!-- BINDING -->
<wsdl:binding name="AMANSequenceInfoSOAP" type="tns:AMANSequenceInfo">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
<!--
return the sequence data according to the filters provided.
if no filter is provided, all the sequence data for this aman is provided
-->
<wsdl:operation name="getAMANSequence">
<soap:operation soapAction="http://www.iTEC.aero/getAMANSequence" />
<wsdl:input>
<soap:body use="literal" namespace="http://www.iTEC.aero/AMANSequence" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" namespace="http://www.iTEC.aero/AMANSequence"/>
</wsdl:output>
</wsdl:operation>
<!--
A request/reply operation deployed in the iMAS ESB.
The invocation of this operation will trigger a request in the iMAS ESB for distributing
this information to several stakeholders in a async way
-->
<wsdl:operation name="publishAMANSequence">
<soap:operation soapAction="http://www.iTEC.aero/publishAMANSequence" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="AMANSequenceSubscriptionSOAP" type="tns:AMANSequenceSubscription">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
<!--
subscribe to the corresponding aman indicating the filter with the information the customer is interested in receiving.
The stakeholderId is also provided in this operation to manage the publication of the information
-->
<wsdl:operation name="subscribeToAMANSequence">
<soap:operation soapAction="" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<!--
unsubscribe to the corresponding aman indicating the filter with the information the customer is interested in receiving.
The stakeholderId is also provided in this operation to manage the publication of the information
-->
<wsdl:operation name="unsubscribeToAMANSequence">
<soap:operation soapAction="" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<!-- SERVICES -->
<wsdl:service name="AMANSequenceInfo">
<wsdl:port binding="tns:AMANSequenceInfoSOAP" name="AMANSequenceInfoService">
<soap:address location="null" />
</wsdl:port>
<wsdl:port binding="tns:AMANSequenceSubscriptionSOAP" name="AMANSequenceSubscriptionService">
<soap:address location="null" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
FILTER XSD
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema version="0.1"
elementFormDefault="qualified"
targetNamespace="http://www.iTEC.aero/AMANSequence"
xmlns:filter="http://www.iTEC.aero/AMANSequence"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="AMANSequenceFilterType">
<xs:sequence>
<xs:element name="filterRows" type="filter:FilterRowType" minOccurs="1" maxOccurs="1" />
<xs:element name="filterColumns" type="filter:FilterColumnsType" minOccurs="1" maxOccurs="1" />
<xs:element name="filterUpdate" type="filter:FilterUpdatedType" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="FilterRowType">
<xs:annotation>
<xs:documentation>These filters are based on the ""DomainOfinterest" class in the logical model</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="fixName" type="xs:string" minOccurs="1" maxOccurs="1" />
<xs:element name="typeOfFix" type="xs:string" minOccurs="1" maxOccurs="1" />
<xs:element name="departureAerodrome" type="xs:string" minOccurs="1" maxOccurs="1" />
<xs:element name="destinationAerodrome" type="xs:string" minOccurs="1" maxOccurs="1" />
<xs:element name="runwayDirection" type="xs:string" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="FilterColumnsType">
<xs:annotation>
<xs:documentation>These filters are based on filter example discussed in the SICG</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="sequenceNumber" type="xs:string" minOccurs="1" maxOccurs="1" />
<xs:element name="RunwayId" type="xs:string" minOccurs="1" maxOccurs="1" />
<xs:element name="LandingTime" type="xs:string" minOccurs="1" maxOccurs="1" />
<xs:element name="CallSign" type="xs:string" minOccurs="1" maxOccurs="1" />
<xs:element name="MF" type="xs:string" minOccurs="1" maxOccurs="1" />
<xs:element name="OTA" type="xs:string" minOccurs="1" maxOccurs="1" />
<xs:element name="TTL" type="xs:string" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="FilterUpdatedType">
<xs:annotation>
<xs:documentation>These filters are based on filter example discussed in the SICG</xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element name="periodic" type="xs:string" minOccurs="1" maxOccurs="1" />
<xs:element name="sequenceEntryOnChange" type="xs:string" minOccurs="1" maxOccurs="1" />
</xs:choice>
</xs:complexType>
</xs:schema>
If somebody can help ;!!
SOLVED
I changed binding style to document.
Create complexType in the schema for messages with multiple parts and compile without errors or warnings.
I'm using Axis2's wsdl2java to generate a stub for the following WSDL (please note that if names don't match up, it's probably from my obfuscation of the code):
<?xml version="1.0" encoding="UTF-8" standalone="no"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:sch="http://test.com/saucy/schemas" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://test.com/saucy/definitions" targetNamespace="http://test.com/saucy/definitions">
<wsdl:types>
<xs:schema xmlns:wtfd="http://test.com/saucy/schemas" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://test.com/saucy/schemas">
<xs:element name="fubarmanagerRequest">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="1" name="addUsers" type="wtfd:addUsersType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="addUsersType">
<xs:sequence>
<xs:element maxOccurs="unbounded" name="user" type="wtfd:userType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="userType">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="1" name="emailAddress" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="1" name="password" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="fubarmanagerRequest">
<wsdl:part element="sch:fubarmanagerRequest" name="fubarmanagerRequest">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="wtfsaucy">
<wsdl:operation name="fubarmanager">
<wsdl:input message="tns:fubarmanagerRequest" name="fubarmanagerRequest">
</wsdl:input>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="wtfsaucySoap11" type="tns:wtfsaucy">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="fubarmanager">
<soap:operation soapAction=""/>
<wsdl:input name="fubarmanagerRequest">
<soap:body use="literal"/>
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="wtfsaucyService">
<wsdl:port binding="tns:wtfsaucySoap11" name="wtfsaucySoap11">
<soap:address location="http://localhost:8080/mailerManagerService/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
However, it seems like the generated stub isn't providing a means for me to retrieve the response XML:
/**
* Auto generated method signature
*
*/
public void fubarManager(com.obfuscated.fubarRequest fubarRequest0
) throws java.rmi.RemoteException
I'm able to get the response XML in SoapUI, but How can I retrieve it through the web generated service client code? Is something missing from my WSDL? Are there additional options I should be passing to wsdl2java?
I had to make sure my WSDL included a section for the response message:
<wsdl:portType name="wtfDirect">
<wsdl:operation name="MailManager">
<wsdl:input message="tns:MailManagerRequest" name="MailManagerRequest">
</wsdl:input>
<wsdl:output message="tns:MailManagerResponse" name="MailManagerResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
I have a wsdl file without binding section:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<wsdl:definitions xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Engage" targetNamespace="http://tempuri.org/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<xs:element name="OtherData">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="id" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="OtherDataResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="OtherDataResult" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="MyData">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="id" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="MyDataResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="MyDataResult" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<xs:schema xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/">
<xs:element name="anyType" nillable="true" type="xs:anyType" />
<xs:element name="anyURI" nillable="true" type="xs:anyURI" />
<xs:element name="base64Binary" nillable="true" type="xs:base64Binary" />
<xs:element name="boolean" nillable="true" type="xs:boolean" />
<xs:element name="byte" nillable="true" type="xs:byte" />
<xs:element name="dateTime" nillable="true" type="xs:dateTime" />
<xs:element name="decimal" nillable="true" type="xs:decimal" />
<xs:element name="double" nillable="true" type="xs:double" />
<xs:element name="float" nillable="true" type="xs:float" />
<xs:element name="int" nillable="true" type="xs:int" />
<xs:element name="long" nillable="true" type="xs:long" />
<xs:element name="QName" nillable="true" type="xs:QName" />
<xs:element name="short" nillable="true" type="xs:short" />
<xs:element name="string" nillable="true" type="xs:string" />
<xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte" />
<xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt" />
<xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong" />
<xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort" />
<xs:element name="char" nillable="true" type="tns:char" />
<xs:simpleType name="char">
<xs:restriction base="xs:int" />
</xs:simpleType>
<xs:element name="duration" nillable="true" type="tns:duration" />
<xs:simpleType name="duration">
<xs:restriction base="xs:duration">
<xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?" />
<xs:minInclusive value="-P10675199DT2H48M5.4775808S" />
<xs:maxInclusive value="P10675199DT2H48M5.4775807S" />
</xs:restriction>
</xs:simpleType>
<xs:element name="guid" nillable="true" type="tns:guid" />
<xs:simpleType name="guid">
<xs:restriction base="xs:string">
<xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}" />
</xs:restriction>
</xs:simpleType>
<xs:attribute name="FactoryType" type="xs:QName" />
<xs:attribute name="Id" type="xs:ID" />
<xs:attribute name="Ref" type="xs:IDREF" />
</xs:schema>
</wsdl:types>
<wsdl:message name="IMyService_OtherData_InputMessage">
<wsdl:part element="tns:OtherData" name="parameters" />
</wsdl:message>
<wsdl:message name="IMyService_OtherData_OutputMessage">
<wsdl:part element="tns:OtherDataResponse" name="parameters" />
</wsdl:message>
<wsdl:message name="IMyService_MyData_InputMessage">
<wsdl:part element="tns:MyData" name="parameters" />
</wsdl:message>
<wsdl:message name="IMyService_MyData_OutputMessage">
<wsdl:part element="tns:MyDataResponse" name="parameters" />
</wsdl:message>
<wsdl:portType name="IMyService">
<wsdl:operation name="OtherData">
<wsdl:input message="tns:IMyService_OtherData_InputMessage" wsaw:Action="http://tempuri.org/IMyService/OtherData" />
<wsdl:output message="tns:IMyService_OtherData_OutputMessage" wsaw:Action="http://tempuri.org/IMyService/OtherDataResponse" />
</wsdl:operation>
<wsdl:operation name="MyData">
<wsdl:input message="tns:IMyService_MyData_InputMessage" wsaw:Action="http://tempuri.org/IMyService/MyData" />
<wsdl:output message="tns:IMyService_MyData_OutputMessage" wsaw:Action="http://tempuri.org/IMyService/MyDataResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:service name="MyService">
<wsdl:port name="xmlPort">
<http:address location="http://localhost:59109/MyService.svc/xml" />
</wsdl:port>
<wsdl:port name="jsonPort">
<http:address location="http://localhost:59109/MyService.svc/json" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Is this wsdl valid? Or in other words can we have wsdl without a binding section or it is required and this wsdl is invalid? Some tools (like SoapUI) throws exception but the other (like this https://www.wsdl-analyzer.com/) says that this is valid wsdl.
According to the W3C note about WSDL 1.1:
There may be any number of bindings for a given portType
Does it mean there can be no bindings?
Well, taking look at the XML schema for WSDL 1.1, binding element can have no occurences at all.
The practical behavior probably depends on a SOAP library. Note that the binding specifies whether we use document or RFC-style call and whether we encode the data or not.
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<soap:Header/>
<soap:Body>
<xs:QueryProductionCalendarRequest/>
</soap:Body>
</soap:Envelope>
Due to these empty request elements our customer is unable to generate a java client using the WSDL. Therfore, it's very eminent that I address this issue.The WSDL looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:axis2="http://ws.apache.org/axis2" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://ws.apache.org/axis2">
<wsdl:documentation>FlexisService</wsdl:documentation>
<wsdl:types>
<xs:element name="QueryProductionCalendarRequest" type="QueryProductionCalendarRequestType"/>
<xs:complexType name="QueryProductionCalendarRequestType">
<xs:sequence>
<xs:element name="Plant" type="xs:string"/>
<xs:element name="Line" type="xs:string"/>
<xs:element name="StartDate" type="xs:date" minOccurs="0"/>
<xs:element name="EndDate" type="xs:date" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:element name="QueryProductionCalendarResponse" type="QueryProductionCalendarResponseType"/>
<xs:complexType name="QueryProductionCalendarResponseType">
<xs:sequence>
<xs:element name="Plant" type="xs:string"/>
<xs:element name="Line" type="xs:string"/>
<xs:element name="ProductionDayList" type="ProductionDayListType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ProductionDayListType">
<xs:sequence>
<xs:element name="ProductionDay" type="ProductionDayType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ProductionDayType">
<xs:sequence>
<xs:element name="ProductionDate" type="xs:date"/>
<xs:element name="ProductionRate" type="xs:integer"/>
<xs:element name="ProductionShiftList" type="ProductionShiftListType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ProductionShiftListType">
<xs:sequence>
<xs:element name="ProductionShift" type="ProductionShiftType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ProductionShiftType">
<xs:sequence>
<xs:element name="Name" type="xs:string"/>
<xs:element name="ShiftRate" type="xs:integer"/>
<xs:element name="StartDateTime" type="xs:dateTime"/>
<xs:element name="EndDateTime" type="xs:dateTime"/>
</xs:sequence>
</xs:complexType>
</wsdl:types>
<wsdl:message name="QueryProductionCalendarRequestMessage">
<wsdl:part name="parameters" element="xs:QueryProductionCalendarRequest"/>
</wsdl:message>
<wsdl:message name="QueryProductionCalendarResponseMessage">
<wsdl:part name="parameters" element="xs:QueryProductionCalendarResponse"/>
</wsdl:message>
<wsdl:portType name="FlexisServicePortType">
<wsdl:operation name="QueryProductionCalendar">
<wsdl:input message="axis2:QueryProductionCalendarRequestMessage" wsaw:Action="urn:QueryProductionCalendar"/>
<wsdl:output message="axis2:QueryProductionCalendarResponseMessage" wsaw:Action="urn:QueryProductionCalendarResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="FlexisServiceSoap11Binding" type="axis2:FlexisServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="QueryProductionCalendar">
<soap:operation soapAction="urn:QueryProductionCalendar" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="FlexisServiceSoap12Binding" type="axis2:FlexisServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="QueryProductionCalendar">
<soap12:operation soapAction="urn:QueryProductionCalendar" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="FlexisServiceHttpBinding" type="axis2:FlexisServicePortType">
<http:binding verb="POST"/>
<wsdl:operation name="QueryProductionCalendar">
<http:operation location="FlexisService/QueryProductionCalendar"/>
<wsdl:input>
<mime:content type="text/xml" part="QueryProductionCalendar"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="QueryProductionCalendar"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="FlexisService">
<soap:address location='http://localhost:8080/axis2/services/FlexisService'/>
</wsdl:service>
</wsdl:definitions>
Can someone please nudge me in the right direction as to why that's happening?