Hi!
I have a slightly different requirement: I received wsdl's from a service
provider that implements the TR-069 spec, this spec define the use of
rpc/encoded style. I need to invoke this service but I am not able to
generate the client, I tried to generate the client for the sample
stockAvailableNotification.wsdl extracted from the Building Web Services
with Java book, but I get the following error:
Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:140)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
Parser SAX Error: org.xml.sax.SAXException: Fatal Error:
URI=file:///home/albertop/axis2/wsdl-rpc/examples/src/ch6/ex2/stockAvailableNotification.wsdl
Line=24: The prefix "wsdl" for attribute "wsdl:arrayType" associated with an
element type "attribute" is not bound.
at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.readInTheWSDLFile(CodeGenerationEngine.java:300)
at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:97)
... 2 more
Caused by: org.xml.sax.SAXException: Fatal Error:
URI=file:///home/albertop/axis2/wsdl-rpc/examples/src/ch6/ex2/stockAvailableNotification.wsdl
Line=24: The prefix "wsdl" for attribute "wsdl:arrayType" associated with an
element type "attribute" is not bound.
The wsdl from the book is:
<?xml version="1.0" ?>
<definitions name="StockAvailableNotification"
targetNamespace=
"http://www.skatestown.com/services/StockAvailableNotification"
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
xmlns:reg="http://www.skatestown.com/ns/registrationRequest"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<!-- Type definitions from the registration schema-->
<types>
<xsd:schema
targetNamespace="http://www.skatestown.com/ns/registrationRequest"
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
xmlns="http://www.skatestown.com/schemas/ns/registrationRequest">
<xsd:complexType name="registrationRequest">
<xsd:sequence>
<xsd:element name="items">
<xsd:complexType name="ArrayOfItem">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="xsd:string[]"/>
</restriction>
</complexContent>
</complexType>
</xsd:element>
<xsd:element name="address" type="xsd:uriReference"/>
<xsd:element name="transport"
default="http://schemas.xmlsoap.org/soap/smtp"
minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:uriReference">
<xsd:enumeration
value="http://schemas.xmlsoap.org/soap/http"/>
<xsd:enumeration
value="http://schemas.xmlsoap.org/soap/smtp"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="clientArg" type="xsd:string"
minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="correlationID">
<xsd:restriction base="xsd:string">
<!-- some appropriate restriction -->
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
</types>
<!-- Message definitions -->
<message name="StockAvailableRegistrationRequest">
<part name="registration" element="reg:registrationRequest"/>
<part name="expiration" type="xsd:timeInstant"/>
</message>
<message name="StockAvailableRegistrationResponse">
<part name="correlationID" type="reg:correlationID"/>
</message>
<message name="StockAvailableRegistrationError">
<part name="errorString" type="xsd:string"/>
</message>
<message name="StockAvailableExpirationError">
<part name="errorString" type="xsd:string"/>
</message>
<message name="StockAvailableNotification">
<part name="timeStamp" type="xsd:timeInstant"/>
<part name="correlationID" type="reg:correlationID"/>
<part name="items" type="reg:items"/>
<part name="clientArg" type="xsd:string"/>
</message>
<message name="StockAvailableExpirationNotification">
<part name="timeStamp" type="xsd:timeInstant"/>
<part name="correlationID" type="reg:correlationID"/>
<part name="items" type="reg:ArrayOfItem"/>
<part name="clientArg" type="xsd:string"/>
</message>
<message name="StockAvailableCancellation">
<part name="correlationID" type="reg:correlationID"/>
</message>
<!-- Port type definitions -->
<portType name="StockAvailableNotificationPortType">
<!--Registration Operation -->
<operation name="registration">
<input message="StockAvailableRegistrationRequest"/>
<output message="StockAvailableRegistrationResponse"/>
<fault message="StockAvailableRegistrationError"
name="StockAvailableNotificationErrorMessage"/>
<fault message="StockAvailableExpirationError"
name="StockAvailableExpirationError"/>
</operation>
<!--Notification Operation -->
<operation name="notification">
<output message="StockAvailableNotification"/>
</operation>
<!--Expiration Notification Operation -->
<operation name="expirationNotification">
<output message="StockAvailableExpirationNotification"/>
</operation>
<!--Cancellation Operation -->
<operation name="cancellation">
<input message=" StockAvailableCancellation"/>
</operation>
</portType>
<!-- Binding definitions -->
<binding name="StockAvailableNotificationSOAPBinding"
type="StockAvailableNotificationPortType">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<documentation>Note: the requestor must invoke the registration
operation first.
</documentation>
<operation name="registration">
<soap:operation
soapAction=
"http://www.skatesTown.com/StockAvailableNotification/registration">
<input>
<soap:header message="StockAvailableRegistrationRequest"
part="expiration" use="encoded"
namespace="http://www.skatestown.com/ns/registrationRequest"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
<soap:headerfault message="StockAvailableExpirationError"
part="errorString" use="encoded"
namespace="http://www.skatestown.com/ns/registrationRequest"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</soap:header>
<soap:body parts="registration" use="literal" style="document"/>
</input>
<output>
<soap:body use="encoded"
namespace="http://www.skatestown.com/ns/registrationRequest"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
<fault name="StockAvailableNotificationErrorMessage">
<soap:fault name="StockAvailableNotificationErrorMessage"
namespace="http://www.skatestown.com/ns/registrationRequest"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</fault>
</operation>
<operation name="notification">
<output>
<soap:body use="encoded"
namespace="http://www.skatestown.com/ns/registrationRequest"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="cancellation">
<soap:operation
soapAction=
"http://www.skatesTown.com/StockAvailableNotification/cancellation">
<input>
<soap:body use="encoded"
namespace="http://www.skatestown.com/ns/registrationRequest"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
</operation>
</binding>
<!-- Service definition -->
<service name="StockAvailableNotificationService">
<port name="StockAvailableNotificationPort" binding="
StockAvailableNotificationSOAPBinding ">
<soap:address
location="http://www.skatestown.com/axis/services/StockNotification"/>
</port>
</service>
</definitions>
Thanks!!
You will have to update the .NET client to use the new WSDL.
.NET has an easy-to-use utility call wsdl.exe that generates client
stubs for you.
--
View this message in context:
http://www.nabble.com/rpc-encoded-vs-rpc-literal-vs-document-literal-migrate-Axis1.4-wsdl-%28rpc-encoded%29-to-Axis2-doc-lit-tf4113634.html#a11856779
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]