You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Jason Wang <ja...@soprano.com.au> on 2008/02/26 02:41:16 UTC
[Axis2] two java2wsdl questions
Hi,
Please have a look at the attached services.wsdl generated by wsdl2java
and help me with the following questions:
1. When I validated services.wsdl using xml spy, it has the error as
shown in attached WSDLError.doc. I found out the error is caused by
these two sections:
<wsdl:message name="sendmsgRequest">
<wsdl:part name="parameters" element="ns0:sendmsg"/>
</wsdl:message>
<wsdl:message name="sendmsgResponse">
<wsdl:part name="parameters" element="ns0:sendmsgResponse"/>
</wsdl:message>
................
<wsdl:operation name="sendmsg">
<http:operation location="CGPWebSMSInterface/sendmsg"/>
<wsdl:input>
<mime:content type="text/xml" part="sendmsg"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="sendmsg"/>
</wsdl:output>
</wsdl:operation>
The part name defined in wsdl:part is "parameters" but in mime:content
it is referred as "sendmsg", which causes the validation fails. If I
changed it to <mime:content type="text/xml" part="parameters"/> the
validation could pass. Is this a bug of wsdl2java?
2. The response from the server is as follows:
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns:sendmsgResponse
xmlns:ns="http://cgpwebservices.web.cgp.soprano.com.au">
<ns:return
xmlns:ax21="http://cgpwebservices.web.cgp.soprano.com.au/xsd"
type="au.com.soprano.cgp.web.cgpwebservices.Response">
<ax21:messageId/>
<ax21:responseCode>040</ax21:responseCode>
<ax21:responseString>ERROR</ax21:responseString>
<ax21:successCode>1</ax21:successCode>
</ns:return>
</ns:sendmsgResponse>
</soapenv:Body>
</soapenv:Envelope>
But in ns:return tag there's a type attribute which is not defined in
the schema of services.wsdl. So the xml validation fails. Here's the
error I got:
cvc-complex-type 3: element
{http://cgpwebservices.web.cgp.soprano.com.au}return of type
{http://cgpwebservices.web.cgp.soprano.com.au/xsd}Response had undefined
attribute type Schema Validation Error Execution of
'local:///SopranoCGPWebServices_apac.wsdl' aborted:
http://10.120.116.200:6069/: cvc-complex-type 3: element
{http://cgpwebservices.web.cgp.soprano.com.au}return of type
{http://cgpwebservices.web.cgp.soprano.com.au/xsd}Response had undefined
attribute type
If I add <xs:attribute name="type" type="xs:string"/> into the
<xs:complexType name="Response"> the validation could pass. My question
is why the definition of attribute type is not generated automatically
by wsdl2java. Thanks a lot!
Best Regards,
Jason Wang