You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Tian Chi <ch...@gmail.com> on 2008/11/19 07:26:36 UTC
Help! How to define the WSDL so my SOAP XML schema can be correct?
Hi all,
I'm a new user of Axis2. I created a WSDL for Axis2 but it turned out my XML
schema has one more layer (tag) than I expected.
Following is the XML I got
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/
">
<SOAP-ENV:Body>
<ns:MMRequest xmlns:ns="http://ws.iplant.com">
<ns:MMRequest/>
</ns:MMRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Noticed there is an extra <ns:MMRequest> inside <ns:MMRequest>, but I just
need one <ns:MMequest> such as
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/
">
<SOAP-ENV:Body>
<ns:MMRequest xmlns:ns="http://ws.iplant.com">
...... # This is where I put my data #
</ns:MMRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Can anyone tell me what I'm doing wrong and how to fix it?
Following is my WSDL file.
===================================================================
<wsdl:definitions
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://xml.equipmentalley.com/ws/schema/EquipmentAlley"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://xml.equipmentalley.com/ws/schema/EquipmentAlley/
">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="
http://xml.equipmentalley.com/ws/schema/EquipmentAlley"
elementFormDefault="qualified">
<xsd:include schemaLocation="stateType.xsd"/>
<xsd:include schemaLocation="countryType.xsd"/>
<xsd:include schemaLocation="categoryType.xsd"/>
<xsd:element name="MMRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="tns:username" />
<xsd:element ref="tns:password" />
<xsd:element name="transactionList"
type="tns:Transaction" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="MMRequestResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="tns:status"/>
<xsd:element ref="tns:message"/>
<xsd:element name="transactionResponseList"
type="tns:TransactionResponse" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="Transaction">
<xsd:sequence>
<xsd:element ref="tns:action"/>
<xsd:element name="client" type="tns:Client" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="TransactionResponse">
<xsd:sequence>
<xsd:element ref="tns:status"/>
<xsd:element ref="tns:message"/>
<xsd:element name="client" type="tns:Client"
minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Client">
<xsd:sequence>
<xsd:element ref="tns:companyName" minOccurs="0"/>
<xsd:element ref="tns:firstName" minOccurs="0"/>
<xsd:element ref="tns:lastName" minOccurs="0"/>
<xsd:element ref="tns:email" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<!-- Action -->
<xsd:element name="action" type="xsd:string" />
<!-- Message Response -->
<xsd:element name="status" type="xsd:int" />
<xsd:element name="message" type="xsd:string" />
<!-- Client -->
<xsd:element name="companyName" type="xsd:string" />
<xsd:element name="firstName" type="xsd:string" />
<xsd:element name="lastName" type="xsd:string" />
<xsd:element name="email" type="xsd:string" />
<!-- Login -->
<xsd:element name="username" type="xsd:string" />
<xsd:element name="password" type="xsd:string" />
</xsd:schema>
</wsdl:types>
<wsdl:message name="MMRequestMessage">
<wsdl:part name="part1" element="tns:MMRequest" />
</wsdl:message>
<wsdl:message name="MMRequestResponseMessage">
<wsdl:part name="part1" element="tns:MMRequestResponse" />
</wsdl:message>
<wsdl:portType name="CLServicePortType">
<wsdl:operation name="MMRequest">
<wsdl:input message="tns:MMRequestMessage" />
<wsdl:output message="tns:MMRequestResponseMessage" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CLServiceSOAP12Binding"
type="tns:ServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
<wsdl:operation name="MMRequest">
<soap12:operation soapAction="
http://www.iplant.com/ws/soaplisting#transaction"
style="document" />
<wsdl:input>
<soap12:body use="literal"
namespace="
http://xml.equipmentalley.com/ws/schema/EquipmentAlley/" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"
namespace="
http://xml.equipmentalley.com/ws/schema/EquipmentAlley/" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CLService">
<wsdl:port name="CNHListingServiceSOAP12port"
binding="tns:CNHListingServiceSOAP12Binding">
<soap12:address
location="http://www.iplant.com/services/CLService" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
================================================================
I'd really appreciate it if someone can give me some guidance or suggesions.
thanks in advance,
-Tian
Re: Help! How to define the WSDL so my SOAP XML schema can be correct?
Posted by Tian Chi <ch...@gmail.com>.
Hi Amila and all,
Thank you so much for your response.
I got the request message from a web service testing too, Stylus Studio.
When I type in my WSDL's URL, the tool will display how the request message
should look like. That' how I got it and think there must be something wrong
with my WSDL.
>From what you said, it sounds like Stylus Studio is not working right.
Do you know any other (Not from Axis2) web service testing tool I can use to
test my Axis2
SOAP server?
Basically I just want to make sure my SOAP service is working correctly.
I used the Axis2 client requests to test my Axis2 service and it works fine.
I want to make sure the service also works with SOAP requests from other
kinds of clients or tools.
thanks,
-Tian
On Wed, Nov 19, 2008 at 4:24 AM, Amila Suriarachchi <
amilasuriarachchi@gmail.com> wrote:
> there is no problem with your wsdl. The request message is invalid.
>
> <ns:MMRequest xmlns:ns="http://ws.iplant.com">
> <ns:MMRequest/>
> </ns:MMRequest>
>
> even the namespace is not match.
>
>
> On 11/19/08, Tian Chi <ch...@gmail.com> wrote:
> > Hi all,
> >
> > I'm a new user of Axis2. I created a WSDL for Axis2 but it turned out my
> XML
> > schema has one more layer (tag) than I expected.
> > Following is the XML I got
> >
> > <?xml version="1.0"?>
> > <SOAP-ENV:Envelope xmlns:SOAP-ENV="
> http://schemas.xmlsoap.org/soap/envelope/
> > ">
> > <SOAP-ENV:Body>
> > <ns:MMRequest xmlns:ns="http://ws.iplant.com">
> > <ns:MMRequest/>
> > </ns:MMRequest>
> > </SOAP-ENV:Body>
> > </SOAP-ENV:Envelope>
> >
> > Noticed there is an extra <ns:MMRequest> inside <ns:MMRequest>, but I
> just
> > need one <ns:MMequest> such as
> >
> > <?xml version="1.0"?>
> > <SOAP-ENV:Envelope xmlns:SOAP-ENV="
> http://schemas.xmlsoap.org/soap/envelope/
> > ">
> > <SOAP-ENV:Body>
> > <ns:MMRequest xmlns:ns="http://ws.iplant.com">
> > ...... # This is where I put my data #
> > </ns:MMRequest>
> > </SOAP-ENV:Body>
> > </SOAP-ENV:Envelope>
> >
> > Can anyone tell me what I'm doing wrong and how to fix it?
> > Following is my WSDL file.
> >
> > ===================================================================
> > <wsdl:definitions
> > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
> > xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> > xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> > xmlns:tns="http://xml.equipmentalley.com/ws/schema/EquipmentAlley"
> > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > targetNamespace="
> http://xml.equipmentalley.com/ws/schema/EquipmentAlley/
> > ">
> > <wsdl:types>
> > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > targetNamespace="
> > http://xml.equipmentalley.com/ws/schema/EquipmentAlley"
> >
> > elementFormDefault="qualified">
> >
> > <xsd:include schemaLocation="stateType.xsd"/>
> > <xsd:include schemaLocation="countryType.xsd"/>
> > <xsd:include schemaLocation="categoryType.xsd"/>
> >
> > <xsd:element name="MMRequest">
> > <xsd:complexType>
> > <xsd:sequence>
> > <xsd:element ref="tns:username" />
> > <xsd:element ref="tns:password" />
> > <xsd:element name="transactionList"
> > type="tns:Transaction" maxOccurs="unbounded"/>
> > </xsd:sequence>
> > </xsd:complexType>
> > </xsd:element>
> > <xsd:element name="MMRequestResponse">
> > <xsd:complexType>
> > <xsd:sequence>
> > <xsd:element ref="tns:status"/>
> > <xsd:element ref="tns:message"/>
> > <xsd:element name="transactionResponseList"
> > type="tns:TransactionResponse" minOccurs="0" maxOccurs="unbounded"/>
> > </xsd:sequence>
> > </xsd:complexType>
> > </xsd:element>
> >
> > <xsd:complexType name="Transaction">
> > <xsd:sequence>
> > <xsd:element ref="tns:action"/>
> > <xsd:element name="client" type="tns:Client" />
> > </xsd:sequence>
> > </xsd:complexType>
> >
> > <xsd:complexType name="TransactionResponse">
> > <xsd:sequence>
> > <xsd:element ref="tns:status"/>
> > <xsd:element ref="tns:message"/>
> > <xsd:element name="client" type="tns:Client"
> > minOccurs="0"/>
> > </xsd:sequence>
> > </xsd:complexType>
> >
> > <xsd:complexType name="Client">
> > <xsd:sequence>
> > <xsd:element ref="tns:companyName" minOccurs="0"/>
> > <xsd:element ref="tns:firstName" minOccurs="0"/>
> > <xsd:element ref="tns:lastName" minOccurs="0"/>
> > <xsd:element ref="tns:email" minOccurs="0"/>
> > </xsd:sequence>
> > </xsd:complexType>
> >
> > <!-- Action -->
> > <xsd:element name="action" type="xsd:string" />
> >
> > <!-- Message Response -->
> > <xsd:element name="status" type="xsd:int" />
> > <xsd:element name="message" type="xsd:string" />
> >
> > <!-- Client -->
> > <xsd:element name="companyName" type="xsd:string" />
> > <xsd:element name="firstName" type="xsd:string" />
> > <xsd:element name="lastName" type="xsd:string" />
> > <xsd:element name="email" type="xsd:string" />
> >
> > <!-- Login -->
> > <xsd:element name="username" type="xsd:string" />
> > <xsd:element name="password" type="xsd:string" />
> > </xsd:schema>
> > </wsdl:types>
> > <wsdl:message name="MMRequestMessage">
> > <wsdl:part name="part1" element="tns:MMRequest" />
> > </wsdl:message>
> > <wsdl:message name="MMRequestResponseMessage">
> > <wsdl:part name="part1" element="tns:MMRequestResponse" />
> > </wsdl:message>
> > <wsdl:portType name="CLServicePortType">
> > <wsdl:operation name="MMRequest">
> > <wsdl:input message="tns:MMRequestMessage" />
> > <wsdl:output message="tns:MMRequestResponseMessage" />
> > </wsdl:operation>
> > </wsdl:portType>
> > <wsdl:binding name="CLServiceSOAP12Binding"
> > type="tns:ServicePortType">
> > <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"
> > style="document" />
> > <wsdl:operation name="MMRequest">
> > <soap12:operation soapAction="
> > http://www.iplant.com/ws/soaplisting#transaction"
> > style="document" />
> > <wsdl:input>
> > <soap12:body use="literal"
> > namespace="
> > http://xml.equipmentalley.com/ws/schema/EquipmentAlley/" />
> > </wsdl:input>
> > <wsdl:output>
> > <soap12:body use="literal"
> > namespace="
> > http://xml.equipmentalley.com/ws/schema/EquipmentAlley/" />
> > </wsdl:output>
> > </wsdl:operation>
> > </wsdl:binding>
> > <wsdl:service name="CLService">
> > <wsdl:port name="CNHListingServiceSOAP12port"
> > binding="tns:CNHListingServiceSOAP12Binding">
> > <soap12:address
> > location="http://www.iplant.com/services/CLService" />
> > </wsdl:port>
> > </wsdl:service>
> > </wsdl:definitions>
> > ================================================================
> >
> > I'd really appreciate it if someone can give me some guidance or
> suggesions.
> >
> > thanks in advance,
> >
> > -Tian
> >
>
>
> --
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
Re: Help! How to define the WSDL so my SOAP XML schema can be correct?
Posted by Amila Suriarachchi <am...@gmail.com>.
there is no problem with your wsdl. The request message is invalid.
<ns:MMRequest xmlns:ns="http://ws.iplant.com">
<ns:MMRequest/>
</ns:MMRequest>
even the namespace is not match.
On 11/19/08, Tian Chi <ch...@gmail.com> wrote:
> Hi all,
>
> I'm a new user of Axis2. I created a WSDL for Axis2 but it turned out my XML
> schema has one more layer (tag) than I expected.
> Following is the XML I got
>
> <?xml version="1.0"?>
> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/
> ">
> <SOAP-ENV:Body>
> <ns:MMRequest xmlns:ns="http://ws.iplant.com">
> <ns:MMRequest/>
> </ns:MMRequest>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
> Noticed there is an extra <ns:MMRequest> inside <ns:MMRequest>, but I just
> need one <ns:MMequest> such as
>
> <?xml version="1.0"?>
> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/
> ">
> <SOAP-ENV:Body>
> <ns:MMRequest xmlns:ns="http://ws.iplant.com">
> ...... # This is where I put my data #
> </ns:MMRequest>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
> Can anyone tell me what I'm doing wrong and how to fix it?
> Following is my WSDL file.
>
> ===================================================================
> <wsdl:definitions
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> xmlns:tns="http://xml.equipmentalley.com/ws/schema/EquipmentAlley"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> targetNamespace="http://xml.equipmentalley.com/ws/schema/EquipmentAlley/
> ">
> <wsdl:types>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> targetNamespace="
> http://xml.equipmentalley.com/ws/schema/EquipmentAlley"
>
> elementFormDefault="qualified">
>
> <xsd:include schemaLocation="stateType.xsd"/>
> <xsd:include schemaLocation="countryType.xsd"/>
> <xsd:include schemaLocation="categoryType.xsd"/>
>
> <xsd:element name="MMRequest">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element ref="tns:username" />
> <xsd:element ref="tns:password" />
> <xsd:element name="transactionList"
> type="tns:Transaction" maxOccurs="unbounded"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> <xsd:element name="MMRequestResponse">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element ref="tns:status"/>
> <xsd:element ref="tns:message"/>
> <xsd:element name="transactionResponseList"
> type="tns:TransactionResponse" minOccurs="0" maxOccurs="unbounded"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
>
> <xsd:complexType name="Transaction">
> <xsd:sequence>
> <xsd:element ref="tns:action"/>
> <xsd:element name="client" type="tns:Client" />
> </xsd:sequence>
> </xsd:complexType>
>
> <xsd:complexType name="TransactionResponse">
> <xsd:sequence>
> <xsd:element ref="tns:status"/>
> <xsd:element ref="tns:message"/>
> <xsd:element name="client" type="tns:Client"
> minOccurs="0"/>
> </xsd:sequence>
> </xsd:complexType>
>
> <xsd:complexType name="Client">
> <xsd:sequence>
> <xsd:element ref="tns:companyName" minOccurs="0"/>
> <xsd:element ref="tns:firstName" minOccurs="0"/>
> <xsd:element ref="tns:lastName" minOccurs="0"/>
> <xsd:element ref="tns:email" minOccurs="0"/>
> </xsd:sequence>
> </xsd:complexType>
>
> <!-- Action -->
> <xsd:element name="action" type="xsd:string" />
>
> <!-- Message Response -->
> <xsd:element name="status" type="xsd:int" />
> <xsd:element name="message" type="xsd:string" />
>
> <!-- Client -->
> <xsd:element name="companyName" type="xsd:string" />
> <xsd:element name="firstName" type="xsd:string" />
> <xsd:element name="lastName" type="xsd:string" />
> <xsd:element name="email" type="xsd:string" />
>
> <!-- Login -->
> <xsd:element name="username" type="xsd:string" />
> <xsd:element name="password" type="xsd:string" />
> </xsd:schema>
> </wsdl:types>
> <wsdl:message name="MMRequestMessage">
> <wsdl:part name="part1" element="tns:MMRequest" />
> </wsdl:message>
> <wsdl:message name="MMRequestResponseMessage">
> <wsdl:part name="part1" element="tns:MMRequestResponse" />
> </wsdl:message>
> <wsdl:portType name="CLServicePortType">
> <wsdl:operation name="MMRequest">
> <wsdl:input message="tns:MMRequestMessage" />
> <wsdl:output message="tns:MMRequestResponseMessage" />
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="CLServiceSOAP12Binding"
> type="tns:ServicePortType">
> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"
> style="document" />
> <wsdl:operation name="MMRequest">
> <soap12:operation soapAction="
> http://www.iplant.com/ws/soaplisting#transaction"
> style="document" />
> <wsdl:input>
> <soap12:body use="literal"
> namespace="
> http://xml.equipmentalley.com/ws/schema/EquipmentAlley/" />
> </wsdl:input>
> <wsdl:output>
> <soap12:body use="literal"
> namespace="
> http://xml.equipmentalley.com/ws/schema/EquipmentAlley/" />
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="CLService">
> <wsdl:port name="CNHListingServiceSOAP12port"
> binding="tns:CNHListingServiceSOAP12Binding">
> <soap12:address
> location="http://www.iplant.com/services/CLService" />
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
> ================================================================
>
> I'd really appreciate it if someone can give me some guidance or suggesions.
>
> thanks in advance,
>
> -Tian
>
--
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org