I wrote a simple patch to Axis to enable it to process the wsdl file as-is. If you'd like to work on the client while waiting for the wsdl to be fixed, or if they don't fix the wsdl, this should enable you to generate the client stubs.
The patch consists of a single method that checks the wsdl file (as a Document instance) to ascertain if it's the one in question, and if so, it removes the name attributes from the <input...> and <output...> elements in the binding section. It also changes the type attribute value in the <mime:content...> elements from "application/binary" to "application/octetstream."
It checks the wsdl <definition...> element for the values of the targetNamespace and name attributes given in the wsdl you're trying to use. Since this is a URI, it won't do anything unless that specific wsdl file is detected. I tested it on your wsdl as well as some others, and it seems to work fine.
To load the patch, add the fixDoc() method given below to org.apache.axis.wsdl.symbolTable.SymbolTable.java. Then add the statemt
doc = fixDoc(doc);
immediately following the statement
Document doc = XMLUtils.newDocument(uri, username, password);
in the method
public void populate(String uri, String username, String password)
You will also need to add the following import statements at the beginning of the SymbolTable class
import javax.wsdl.extensions.ExtensibilityElement; import com.ibm.wsdl.extensions.mime.MIMEContentImpl;
If you have any questions, let me know.
-Mark
//Remove the "name" attribute from <Input...> and <output...> elements
//that are child elements of an <operation...> element.
private Document fixDoc(Document doc){
NodeList opList, childList, mimeList;
Node opNode, childNode, mimeNode;
NamedNodeMap attList;
//If the problem wsdl file is not detected, do nothing
try{
if (! (doc.getDocumentElement().getAttributeNode("name").getValue().equals(
"IXMLWSservice")) & (doc.getDocumentElement().getAttributeNode("targetNamespace").getValue().equals(
"http://tempuri.org/"))) {
return doc;
}
}
catch (NullPointerException e){}
opList = doc.getElementsByTagName("operation");
for (int i =0; i<opList.getLength();i++){
opNode = opList.item(i);
childList = opNode.getChildNodes();
for (int j=0; j < childList.getLength(); j++){
childNode = childList.item(j);
if (childNode.getNodeName().equals("input") | childNode.getNodeName().equals("output")){
try{
childNode.getAttributes().removeNamedItem(childNode.getAttributes().
getNamedItem("name").getNodeName());
}
catch (NullPointerException e){}
}
}
}
mimeList = doc.getElementsByTagName("mime:content");
for (int i=0; i < mimeList.getLength(); i++){
mimeNode = mimeList.item(i);
if (mimeNode.hasAttributes()){
if (mimeNode.getAttributes().getNamedItem("type").getNodeValue().equals("application/binary")){
mimeNode.getAttributes().getNamedItem("type").setNodeValue("application/octetstream");
}
}
}
return doc;
}// fixDoc()From: "Mark Leone" <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: Beginners help Date: Fri, 16 Apr 2004 20:36:41 -0400
Oops, sorry about that. Here's the cirrect wsdl file. BTW, the mime:content type attribute having the wrong value is, I think, the reason that XML Spy was complaining about the <mime:content...> element as you irignally reported.
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="IXMLWSservice" targetNamespace="http://tempuri.org/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ns1="http://www.borland.com/namespaces/Types">
<types>
<xs:schema targetNamespace="http://www.borland.com/namespaces/Types" xmlns="http://www.borland.com/namespaces/Types">
<xs:complexType name="TStringDynArray">
<xs:complexContent>
<xs:restriction base="soapenc:Array">
<xs:sequence/>
<xs:attribute ref="soapenc:arrayType" n1:arrayType="xs:string[]" xmlns:n1="http://schemas.xmlsoap.org/wsdl/"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:schema>
</types>
<message name="Register0Request">
<part name="Account" type="xs:string"/>
<part name="Password" type="xs:string"/>
<part name="RegData" type="ns1:TStringDynArray"/>
</message>
<message name="Register0Response">
<part name="Account" type="xs:string"/>
<part name="Password" type="xs:string"/>
<part name="return" type="xs:int"/>
</message>
<message name="Send1Request">
<part name="Account" type="xs:string"/>
<part name="Password" type="xs:string"/>
<part name="JobArt" type="xs:int"/>
<part name="EmpfaengerNr" type="xs:string"/>
<part name="EmpfaengerListe" type="xs:base64Binary"/>
<part name="SendText" type="xs:string"/>
<part name="SendFile1" type="xs:base64Binary"/>
<part name="SendFile2" type="xs:base64Binary"/>
<part name="SendFile3" type="xs:base64Binary"/>
<part name="SendeDatumZeit" type="xs:dateTime"/>
<part name="Schalter" type="xs:string"/>
</message>
<message name="Send1Response">
<part name="JobId" type="xs:int"/>
<part name="AnzahlEmpfaenger" type="xs:int"/>
<part name="AnzahlSeiten" type="xs:int"/>
<part name="CheckDocFile" type="xs:base64Binary"/>
<part name="return" type="xs:int"/>
</message>
<message name="FaxReceive2Request">
<part name="Account" type="xs:string"/>
<part name="Password" type="xs:string"/>
</message>
<message name="FaxReceive2Response">
<part name="FaxFile" type="xs:string"/>
<part name="ReceiveDate" type="xs:dateTime"/>
<part name="FaxImage" type="xs:base64Binary"/>
<part name="return" type="xs:int"/>
</message>
<message name="FaxDelete3Request">
<part name="Account" type="xs:string"/>
<part name="Password" type="xs:string"/>
<part name="FaxFile" type="xs:string"/>
</message>
<message name="FaxDelete3Response">
<part name="return" type="xs:int"/>
</message>
<message name="Status4Request">
<part name="Account" type="xs:string"/>
<part name="Password" type="xs:string"/>
<part name="JobId" type="xs:int"/>
</message>
<message name="Status4Response">
<part name="Protokoll" type="xs:base64Binary"/>
<part name="return" type="xs:int"/>
</message>
<message name="Journal5Request">
<part name="Account" type="xs:string"/>
<part name="Password" type="xs:string"/>
<part name="AnzLines" type="xs:int"/>
<part name="Offset" type="xs:int"/>
</message>
<message name="Journal5Response">
<part name="JournalTab" type="ns1:TStringDynArray"/>
<part name="return" type="xs:int"/>
</message>
<message name="Kundenname6Request">
<part name="Account" type="xs:string"/>
<part name="Password" type="xs:string"/>
</message>
<message name="Kundenname6Response">
<part name="KdName" type="xs:string"/>
<part name="return" type="xs:int"/>
</message>
<message name="Kundendaten7Request">
<part name="Account" type="xs:string"/>
<part name="Password" type="xs:string"/>
</message>
<message name="Kundendaten7Response">
<part name="KdDaten" type="ns1:TStringDynArray"/>
<part name="return" type="xs:int"/>
</message>
<message name="KundenAccount8Request">
<part name="Account" type="xs:string"/>
<part name="Password" type="xs:string"/>
</message>
<message name="KundenAccount8Response">
<part name="AccountData" type="ns1:TStringDynArray"/>
<part name="return" type="xs:int"/>
</message>
<message name="SendWelcomeMail9Request">
<part name="Account" type="xs:string"/>
</message>
<message name="SendWelcomeMail9Response">
<part name="return" type="xs:int"/>
</message>
<message name="SetPassword10Request">
<part name="Account" type="xs:string"/>
<part name="OldPassword" type="xs:string"/>
<part name="NewPassword" type="xs:string"/>
</message>
<message name="SetPassword10Response">
<part name="return" type="xs:int"/>
</message>
<message name="Kontostand11Request">
<part name="Account" type="xs:string"/>
<part name="Password" type="xs:string"/>
</message>
<message name="Kontostand11Response">
<part name="KdKontostand" type="xs:double"/>
<part name="return" type="xs:int"/>
</message>
<message name="CheckPromoCode12Request">
<part name="Account" type="xs:string"/>
<part name="PromoCode" type="xs:string"/>
</message>
<message name="CheckPromoCode12Response">
<part name="return" type="xs:int"/>
</message>
<portType name="IXMLWS">
<operation name="Register">
<input message="tns:Register0Request"/>
<output message="tns:Register0Response"/>
</operation>
<operation name="Send">
<input message="tns:Send1Request"/>
<output message="tns:Send1Response"/>
</operation>
<operation name="FaxReceive">
<input message="tns:FaxReceive2Request"/>
<output message="tns:FaxReceive2Response"/>
</operation>
<operation name="FaxDelete">
<input message="tns:FaxDelete3Request"/>
<output message="tns:FaxDelete3Response"/>
</operation>
<operation name="Status">
<input message="tns:Status4Request"/>
<output message="tns:Status4Response"/>
</operation>
<operation name="Journal">
<input message="tns:Journal5Request"/>
<output message="tns:Journal5Response"/>
</operation>
<operation name="Kundenname">
<input message="tns:Kundenname6Request"/>
<output message="tns:Kundenname6Response"/>
</operation>
<operation name="Kundendaten">
<input message="tns:Kundendaten7Request"/>
<output message="tns:Kundendaten7Response"/>
</operation>
<operation name="KundenAccount">
<input message="tns:KundenAccount8Request"/>
<output message="tns:KundenAccount8Response"/>
</operation>
<operation name="SendWelcomeMail">
<input message="tns:SendWelcomeMail9Request"/>
<output message="tns:SendWelcomeMail9Response"/>
</operation>
<operation name="SetPassword">
<input message="tns:SetPassword10Request"/>
<output message="tns:SetPassword10Response"/>
</operation>
<operation name="Kontostand">
<input message="tns:Kontostand11Request"/>
<output message="tns:Kontostand11Response"/>
</operation>
<operation name="CheckPromoCode">
<input message="tns:CheckPromoCode12Request"/>
<output message="tns:CheckPromoCode12Response"/>
</operation>
</portType>
<binding name="IXMLWSbinding" type="tns:IXMLWS">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="Register">
<soap:operation soapAction="urn:XMLWSIntf-IXMLWS#Register" style="rpc"/>
<input message="tns:Register0Request">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</input>
<output message="tns:Register0Response">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</output>
</operation>
<operation name="Send">
<soap:operation soapAction="urn:XMLWSIntf-IXMLWS#Send" style="rpc"/>
<input message="tns:Send1Request">
<mime:multipartRelated>
<mime:part>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</mime:part>
<mime:part>
<mime:content part="EmpfaengerListe" type="application/octetstream"/>
</mime:part>
<mime:part>
<mime:content part="SendFile1" type="application/octetstream"/>
</mime:part>
<mime:part>
<mime:content part="SendFile2" type="application/octetstream"/>
</mime:part>
<mime:part>
<mime:content part="SendFile3" type="application/octetstream"/>
</mime:part>
</mime:multipartRelated>
</input>
<output message="tns:Send1Response">
<mime:multipartRelated>
<mime:part>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</mime:part>
<mime:part>
<mime:content part="CheckDocFile" type="application/octetstream"/>
</mime:part>
</mime:multipartRelated>
</output>
</operation>
<operation name="FaxReceive">
<soap:operation soapAction="urn:XMLWSIntf-IXMLWS#FaxReceive" style="rpc"/>
<input message="tns:FaxReceive2Request">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</input>
<output message="tns:FaxReceive2Response">
<mime:multipartRelated>
<mime:part>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</mime:part>
<mime:part>
<mime:content part="FaxImage" type="application/octetstream"/>
</mime:part>
</mime:multipartRelated>
</output>
</operation>
<operation name="FaxDelete">
<soap:operation soapAction="urn:XMLWSIntf-IXMLWS#FaxDelete" style="rpc"/>
<input message="tns:FaxDelete3Request">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</input>
<output message="tns:FaxDelete3Response">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</output>
</operation>
<operation name="Status">
<soap:operation soapAction="urn:XMLWSIntf-IXMLWS#Status" style="rpc"/>
<input message="tns:Status4Request">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</input>
<output message="tns:Status4Response">
<mime:multipartRelated>
<mime:part>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</mime:part>
<mime:part>
<mime:content part="Protokoll" type="application/octetstream"/>
</mime:part>
</mime:multipartRelated>
</output>
</operation>
<operation name="Journal">
<soap:operation soapAction="urn:XMLWSIntf-IXMLWS#Journal" style="rpc"/>
<input message="tns:Journal5Request">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</input>
<output message="tns:Journal5Response">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</output>
</operation>
<operation name="Kundenname">
<soap:operation soapAction="urn:XMLWSIntf-IXMLWS#Kundenname" style="rpc"/>
<input message="tns:Kundenname6Request">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</input>
<output message="tns:Kundenname6Response">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</output>
</operation>
<operation name="Kundendaten">
<soap:operation soapAction="urn:XMLWSIntf-IXMLWS#Kundendaten" style="rpc"/>
<input message="tns:Kundendaten7Request">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</input>
<output message="tns:Kundendaten7Response">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</output>
</operation>
<operation name="KundenAccount">
<soap:operation soapAction="urn:XMLWSIntf-IXMLWS#KundenAccount" style="rpc"/>
<input message="tns:KundenAccount8Request">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</input>
<output message="tns:KundenAccount8Response">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</output>
</operation>
<operation name="SendWelcomeMail">
<soap:operation soapAction="urn:XMLWSIntf-IXMLWS#SendWelcomeMail" style="rpc"/>
<input message="tns:SendWelcomeMail9Request">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</input>
<output message="tns:SendWelcomeMail9Response">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</output>
</operation>
<operation name="SetPassword">
<soap:operation soapAction="urn:XMLWSIntf-IXMLWS#SetPassword" style="rpc"/>
<input message="tns:SetPassword10Request">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</input>
<output message="tns:SetPassword10Response">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</output>
</operation>
<operation name="Kontostand">
<soap:operation soapAction="urn:XMLWSIntf-IXMLWS#Kontostand" style="rpc"/>
<input message="tns:Kontostand11Request">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</input>
<output message="tns:Kontostand11Response">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</output>
</operation>
<operation name="CheckPromoCode">
<soap:operation soapAction="urn:XMLWSIntf-IXMLWS#CheckPromoCode" style="rpc"/>
<input message="tns:CheckPromoCode12Request">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</input>
<output message="tns:CheckPromoCode12Response">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:XMLWSIntf-IXMLWS"/>
</output>
</operation>
</binding>
<service name="IXMLWSservice">
<port name="IXMLWSPort" binding="tns:IXMLWSbinding">
<soap:address location="http://ccs.fax.de/xmlws.exe/soap/IXMLWS"/>
</port>
</service>
</definitions>
From: "Steffen Heil" <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: <[EMAIL PROTECTED]> Subject: RE: Beginners help Date: Fri, 16 Apr 2004 16:11:28 +0200
Hi
> The good news is that I discovered the real problem in the wsdl you're trying to use. It is definitely non-compliant, both with the W3C note for WSDL 1.1 and the MIME standard (RFC 1521, find it here: http://www.faqs.org/rfcs/rfc1521.html)
I will contact that service provider, as soon as I understood what was wrong
- when wsdl2java can compile the wsdl file.
> Here's the modified wsdl that incorporates the above fixes, and runs successfully with Axis 1.1. I think you now have sufficient warrant to request the wsdl be changed, and there is clearly no change to the service behavior associated with this change.
Sorry, this is the original file, not the modified one. Would you mind resending the correct one?
Regards, Steffen
_________________________________________________________________
Get rid of annoying pop-up ads with the new MSN Toolbar � FREE! http://toolbar.msn.com/go/onm00200414ave/direct/01/
_________________________________________________________________
Watch LIVE baseball games on your computer with MLB.TV, included with MSN Premium! http://join.msn.com/?page=features/mlb&pgmarket=en-us/go/onm00200439ave/direct/01/
