Discussions

XML & Web services: Axis response element name generation

  1. Axis response element name generation (3 messages)

    My webservice operation PutOrder generates the following SOAP:

    <?xml version="1.0" encoding="utf-8"?>
       <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
          <soapenv:Body>
             <PutOrderResponse xmlns="PartTrap.VoucherService">
                <PutOrderReturn>
                    ......
                </PutOrderReturn>
             </PutOrderResponse>
          </soapenv:Body>
       </soapenv:Envelope>0

    It seems though the .NET client expects a <PutOrderResult> element instead of <PutOrderReturn>. Anyway where did Axis get <PutOrderReturn> from? It's nowhere in my wsdl..

    The questions are - can I change this and how?

    /S
  2. hmm.. can you show me the wsdl?

    regards!

    /Ole
  3. Here's the WSDL:

    <?xml version="1.0" encoding="utf-8" ?>
    <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
                 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                 xmlns:s="http://www.w3.org/2001/XMLSchema"
                 xmlns:s0="PartTrap.VoucherService"
                 xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                 xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
                 targetNamespace="PartTrap.VoucherService" xmlns="http://schemas.xmlsoap.org/wsdl/">
        <types>
            <s:schema elementFormDefault="qualified" targetNamespace="PartTrap.VoucherService">
                <s:element name="PutOrder">
                    <s:complexType>
                        <s:sequence>
                            <s:element minOccurs="0" maxOccurs="1" name="OrderXML" type="s:string" />
                        </s:sequence>
                    </s:complexType>
                </s:element>
                <s:element name="PutOrderResponse">
                    <s:complexType>
                        <s:sequence>
                            <s:element minOccurs="0" maxOccurs="1" name="PutOrderResult" type="s:string" />
                        </s:sequence>
                    </s:complexType>
                </s:element>
                <s:element name="createOrder">
                    <s:complexType>
                        <s:sequence>
                            <s:element minOccurs="0" maxOccurs="1" name="objLogin" type="s0:Login" />
                            <s:element minOccurs="0" maxOccurs="1" name="objOrderRequest" type="s0:OrderRequest" />
                            <s:element minOccurs="0" maxOccurs="1" name="objOrderLines" type="s0:ArrayOfOrderLine" />
                        </s:sequence>
                    </s:complexType>
                </s:element>
                <s:complexType name="Login">
                    <s:sequence>
                        <s:element minOccurs="0" maxOccurs="1" name="loginName" type="s:string" />
                        <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
                    </s:sequence>
                </s:complexType>
                <s:complexType name="OrderRequest">
                    <s:sequence>
                        <s:element minOccurs="0" maxOccurs="1" name="orderNumber" type="s:string" />
                    </s:sequence>
                </s:complexType>
                <s:complexType name="ArrayOfOrderLine">
                    <s:sequence>
                        <s:element minOccurs="0" maxOccurs="unbounded" name="OrderLine" nillable="true" type="s0:OrderLine" />
                    </s:sequence>
                </s:complexType>
                <s:complexType name="OrderLine">
                    <s:sequence>
                        <s:element minOccurs="1" maxOccurs="1" name="quantity" type="s:int" />
                        <s:element minOccurs="0" maxOccurs="1" name="stockCode" type="s:string" />
                        <s:element minOccurs="0" maxOccurs="1" name="deliveryDate" type="s:string" />
                        <s:element minOccurs="0" maxOccurs="1" name="remark" type="s:string" />
                    </s:sequence>
                </s:complexType>
                <s:element name="createOrderResponse">
                    <s:complexType>
                        <s:sequence>
                            <s:element minOccurs="0" maxOccurs="1" name="createOrderResult" type="s0:Order" />
                        </s:sequence>
                    </s:complexType>
                </s:element>
                <s:complexType name="Order">
                    <s:sequence>
                        <s:element minOccurs="0" maxOccurs="1" name="orderNumber" type="s:string" />
                    </s:sequence>
                </s:complexType>
                <s:element name="fetchCreditLimit">
                    <s:complexType>
                        <s:sequence>
                            <s:element minOccurs="0" maxOccurs="1" name="objLogin" type="s0:Login" />
                            <s:element minOccurs="0" maxOccurs="1" name="customerNumber" type="s:string" />
                        </s:sequence>
                    </s:complexType>
                </s:element>
                <s:element name="fetchCreditLimitResponse">
                    <s:complexType>
                        <s:sequence>
                            <s:element minOccurs="1" maxOccurs="1" name="fetchCreditLimitResult" type="s:float" />
                        </s:sequence>
                    </s:complexType>
                </s:element>
            </s:schema>
        </types>
        <message name="PutOrderSoapIn">
            <part name="parameters" element="s0:PutOrder" />
        </message>
        <message name="PutOrderSoapOut">
            <part name="parameters" element="s0:PutOrderResponse" />
        </message>
        <message name="createOrderSoapIn">
            <part name="parameters" element="s0:createOrder" />
        </message>
        <message name="createOrderSoapOut">
            <part name="parameters" element="s0:createOrderResponse" />
        </message>
        <message name="fetchCreditLimitSoapIn">
            <part name="parameters" element="s0:fetchCreditLimit" />
        </message>
        <message name="fetchCreditLimitSoapOut">
            <part name="parameters" element="s0:fetchCreditLimitResponse" />
        </message>
        <portType name="VoucherServiceSoap">
            <operation name="PutOrder">
                <documentation>Put Order</documentation>
                <input message="s0:PutOrderSoapIn" />
                <output message="s0:PutOrderSoapOut" />
            </operation>
            <operation name="createOrder">
                <documentation>Create Order</documentation>
                <input message="s0:createOrderSoapIn" />
                <output message="s0:createOrderSoapOut" />
            </operation>
            <operation name="fetchCreditLimit">
                <documentation>fetchCreditLimit</documentation>
                <input message="s0:fetchCreditLimitSoapIn" />
                <output message="s0:fetchCreditLimitSoapOut" />
            </operation>
        </portType>
        <binding name="VoucherServiceSoap" type="s0:VoucherServiceSoap">
            <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
            <operation name="PutOrder">
                <soap:operation soapAction="PartTrap.VoucherService/PutOrder" style="document" />
                <input>
                    <soap:body use="literal" />
                </input>
                <output>
                    <soap:body use="literal" />
                </output>
            </operation>
            <operation name="createOrder">
                <soap:operation soapAction="PartTrap.VoucherService/createOrder" style="document" />
                <input>
                    <soap:body use="literal" />
                </input>
                <output>
                    <soap:body use="literal" />
                </output>
            </operation>
            <operation name="fetchCreditLimit">
                <soap:operation soapAction="PartTrap.VoucherService/fetchCreditLimit" style="document" />
                <input>
                    <soap:body use="literal" />
                </input>
                <output>
                    <soap:body use="literal" />
                </output>
            </operation>
        </binding>
        <service name="VoucherService">
            <port name="VoucherServiceSoap" binding="s0:VoucherServiceSoap">
                <soap:address location="http://localhost/Power/services/VoucherServiceSoap" />
            </port>
        </service>
    </definitions>
  4. Solved by updating to a later version of Axis and then regenerating the deploy.wsdd file using wsdl2java which added some missing <operation> parameters to the service. Tried to write those manually before but didn't succeed.

    /S