For some reason Keith¹s and my replies to my original article jumped thread. So here they are to see if anyone can help.
Hi Keith, Thanks for the suggestion. Changing the WSDL as described (shown below) causes the error java.lang.RuntimeException: Cannot find part [asset] for operation [GetAsset] using MIMEContent type [application/octet-stream] to be returned from the Axis1 WSDL2Java tool. Is there a way to change the multi-part MIME definitions to refer to an element rather than a part or is a different solution required? <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:tns="~/WebServices/" targetNamespace="~/WebServices/"> <wsdl:types> <s:schema elementFormDefault="qualified" targetNamespace="~/WebServices/"> <s:complexType name="NameTypeValue"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="name" type="s:string"/> <s:element minOccurs="1" maxOccurs="1" name="type" type="tns:FieldType"/> <s:element minOccurs="1" maxOccurs="1" name="value" type="s:string"/> </s:sequence> </s:complexType> <s:simpleType name="FieldType"> <s:restriction base="s:string"> <s:enumeration value="Text"/> <s:enumeration value="Number"/> <s:enumeration value="Boolean"/> <s:enumeration value="Date"/> <s:enumeration value="Time"/> </s:restriction> </s:simpleType> <s:element name="GetAsset"> <s:complexType> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="sessionID" type="s:string"/> <s:element minOccurs="1" maxOccurs="1" name="assetRef" type="s:string"/> <s:element minOccurs="1" maxOccurs="1" name="checkOut" type="s:boolean"/> </s:sequence> </s:complexType> </s:element> <s:element name="GetAssetResponse"> <s:complexType> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="checkedOut" type="s:boolean"/> <s:element minOccurs="0" maxOccurs="1" name="failureReason" type="s:string"/> <s:element name="asset" type="s:base64Binary"/> </s:sequence> </s:complexType> </s:element> <s:element name="StoreAsset"> <s:complexType> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="sessionID" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="assetRef" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="leafName" type="s:string"/> <s:element minOccurs="1" maxOccurs="1" name="checkIn" type="s:boolean"/> <s:element minOccurs="0" maxOccurs="unbounded" name="values" type="tns:NameTypeValue"/> <s:element name="asset" type="s:base64Binary"/> </s:sequence> </s:complexType> </s:element> <s:element name="StoreAssetResponse"> <s:complexType> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="assetRef" type="s:string"/> <s:element minOccurs="1" maxOccurs="1" name="checkedIn" type="s:boolean"/> <s:element minOccurs="0" maxOccurs="1" name="failureReason" type="s:string"/> </s:sequence> </s:complexType> </s:element> </s:schema> </wsdl:types> <wsdl:message name="GetAssetSoapIn"> <wsdl:part name="parameters" element="tns:GetAsset"/> </wsdl:message> <wsdl:message name="GetAssetSoapOut"> <wsdl:part name="parameters" element="tns:GetAssetResponse"/> </wsdl:message> <wsdl:message name="StoreAssetSoapIn"> <wsdl:part name="parameters" element="tns:StoreAsset"/> </wsdl:message> <wsdl:message name="StoreAssetSoapOut"> <wsdl:part name="parameters" element="tns:StoreAssetResponse"/> </wsdl:message> <wsdl:portType name="VersionCueService"> <wsdl:operation name="GetAsset"> <wsdl:input message="tns:GetAssetSoapIn"/> <wsdl:output message="tns:GetAssetSoapOut"/> </wsdl:operation> <wsdl:operation name="StoreAsset"> <wsdl:input message="tns:StoreAssetSoapIn"/> <wsdl:output message="tns:StoreAssetSoapOut"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="VersionCueService" type="tns:VersionCueService"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="GetAsset"> <soap:operation soapAction="~/WebServices/GetAsset" style="document"/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <mime:multipartRelated> <mime:part> <soap:body use="literal"/> </mime:part> <mime:part> <mime:content part="asset" type="application/octet-stream"/> </mime:part> </mime:multipartRelated> </wsdl:output> </wsdl:operation> <wsdl:operation name="StoreAsset"> <soap:operation soapAction="~/WebServices/StoreAsset" style="document"/> <wsdl:input> <mime:multipartRelated> <mime:part> <soap:body use="literal"/> </mime:part> <mime:part> <mime:content part="asset" type="application/octet-stream"/> </mime:part> </mime:multipartRelated> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="VersionCueService"> <wsdl:port name="VersionCueService" binding="tns:VersionCueService"> <soap:address location="http://localhost:8080/axis/services/VersionCueService"/> </wsdl:port> </wsdl:service> </wsdl:definitions> Thanks, Ian From: keith chapman <[EMAIL PROTECTED]> Reply-To: <[EMAIL PROTECTED]> Date: Tue, 2 Sep 2008 18:15:56 +0530 To: <[EMAIL PROTECTED]> Subject: Re: WSDL for attachments and WSDL2Java Hi, I guess the problem is caused by the following messages in your WSDL, <wsdl:message name="GetAssetSoapOut"> <wsdl:part name="parameters" element="tns:GetAssetResponse"/> <wsdl:part name="asset" type="s:base64Binary"/> </wsdl:message> <wsdl:message name="StoreAssetSoapIn"> <wsdl:part name="parameters" element="tns:StoreAsset"/> <wsdl:part name="asset" type="s:base64Binary"/> </wsdl:message> Modifying it to something like <wsdl:message name="GetAssetSoapOut"> <wsdl:part name="parameters" element="tns:GetAssetResponse"/> </wsdl:message> <wsdl:message name="StoreAssetSoapIn"> <wsdl:part name="parameters" element="tns:StoreAsset"/> </wsdl:message> and making asset a element of GetAssetResponse and StoreAsset should fix the issue (At least from the point of Axis2. I'm not sure weather this would break Axis1, but I doubt it will). Thanks, Keith. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
