Since you are doing document/literal-wrapped style, instead of an empty message (for the getAllCustomers() operation request), shouldn't you have a message containing the element <getCustomers/> ?

Also, shouldn't the part name for all the messages be "parameters"?

Yves Erb wrote:

Hi,
I don't think there's any problem with your empty message. I wrote a service using a similar declaration and it works. I may suggest you two things :
- see your application server logs, it can be more explicit than Axis
- try to rename your message : getAllCustomersRequest for example (although I doubt it will change anything)
Regards


Yves

----- Original Message ----- From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 02, 2005 11:23 AM
Subject: Problems with Axis with document/literal-wrapped


Hi,

I'm trying out a bit with document/literal-wrapped style, but Axis gives me a few problems.

I'm creating a WSDL file with 2 methods: createCustomer() and getAllCustomers(). getAllCustomers() has no parameters (so no input), only a return (output). But Axis doesn't seem to like this. I get two errors: one when I press "WSDL" of this service on "And now .. some services" on my Axis page on my Tomcat Web server:


AXIS error

Sorry, something seems to have gone wrong... here are the details:

Fault - makeTypeElement() was told to create a type "{http://www.apogado.com/ws/order.xsd}>Customer", with no containing element

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString: makeTypeElement() was told to create a type "{http://www.apogado.com/ws/order.xsd}>Customer", with no containing element
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:Helios



But, I can call createCustomer() without any problems in my java program (which I created with WSDL2Java). But when I try to run getAllCustomers(), then I get the following error:



AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString: No operation name specified!
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:No operation name specified!
at org.apache.axis.client.Call.invoke(Call.java:1755)
at com.apogado.www.ws.order_wsdl.OrderBindingStub.getAllCustomers(OrderBindingStub.java:190)


at src.ClientDemo.main(ClientDemo.java:43)

{http://xml.apache.org/axis/}hostname:Helios

No operation name specified!
at org.apache.axis.client.Call.invoke(Call.java:1755)
at com.apogado.www.ws.order_wsdl.OrderBindingStub.getAllCustomers(OrderBindingStub.java:190)


at src.ClientDemo.main(ClientDemo.java:43)
Exception in thread "main"



I think the problem is because getAllCustomers() has no input parameters, do I do this in the correct way? If not so: what is the correct way to specify a method that has no input parameters?


This is my WSDL file:


<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="orderservice" targetNamespace="http://www.apogado.com/ws/order.wsdl";
xmlns:tns="http://www.apogado.com/ws/order.wsdl";
xmlns:xsd1="http://www.apogado.com/ws/order.xsd";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
<wsdl:types>
<xsd:schema targetNamespace="http://www.apogado.com/ws/order.xsd";>


<!-- Definition of types -->
<xsd:element name="Address">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="type" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="1" name="street" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="1" name="number" type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="1" name="zip" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="1" name="city" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Customer">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="name" type="xsd:string"/>
<xsd:element maxOccurs="unbounded" minOccurs="1" ref="xsd1:Address" />
<xsd:element maxOccurs="1" minOccurs="1" name="telephone" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="1" name="password" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>


<!-- definition of methods, as defined by Document/literal wrapped -->
<xsd:element name="createCustomer">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="xsd1:Customer" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>


           <xsd:element name="createCustomerResponse">
               <xsd:complexType>
                   <xsd:sequence>
                       <xsd:element name="CustomerID" type="xsd:long"/>
                   </xsd:sequence>
               </xsd:complexType>
           </xsd:element>

<xsd:element name="getAllCustomersResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xsd1:Customer" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>


       </xsd:schema>
   </wsdl:types>

<wsdl:message name="createCustomerRequest">
<wsdl:part name="CustomerRequestPart" element="xsd1:createCustomer"/>
</wsdl:message>


<wsdl:message name="createCustomerResponse">
<wsdl:part name="customerResponsePart" element="xsd1:createCustomerResponse"/>
</wsdl:message>


   <wsdl:message name="empty" />

<wsdl:message name="getAllCustomersResponse">
<wsdl:part name="getAllCustomers" element="xsd1:getAllCustomersResponse"/>
</wsdl:message>


   <wsdl:portType name="orderPortType">
       <wsdl:operation name="createCustomer">
           <wsdl:input message="tns:createCustomerRequest"/>
           <wsdl:output message="tns:createCustomerResponse"/>
       </wsdl:operation>

       <wsdl:operation name="getAllCustomers">
           <wsdl:input message="tns:empty"/>
           <wsdl:output message="tns:getAllCustomersResponse"/>
       </wsdl:operation>
   </wsdl:portType>

<wsdl:binding name="orderBinding" type="tns:orderPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="createCustomer">
<soap:operation soapAction="http://www.apogado.com/ws/order_service/createCustomer"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getAllCustomers">
<soap:operation soapAction="http://www.apogado.com/ws/order_service/getAllCustomers"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>


<wsdl:service name="OrderService">
<wsdl:port binding="tns:orderBinding" name="Order">
<soap:address location="http://localhost:8080/axis/services/Order"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>





Can anyone help me please, these two errors are driving me nuts! Thanks in advance ;)




Reply via email to