Just tried "wsdl2java.bat tempuri.wsdl" with locally saved wsdl and schemas.
Andrei. -----Original Message----- From: Ryan [mailto:[email protected]] Sent: Dienstag, 6. November 2012 18:18 To: Daniel Kulp Cc: [email protected] Subject: Re: Error generating CXF client for .Net WCF file upload service Daniel, I'll try that a bit later today, thanks. Andrei, what command line values did you use that succeeded? I'm curious to see if there are any differences between what you ran and what Eclipse used on my side. Ryan On Tue, Nov 6, 2012 at 11:09 AM, Daniel Kulp <[email protected]> wrote: > > Try removing the -validate flag from the command line. There are some > issues with the validation with 2.7.0. Actually, if you can, try the > 2.7.1-SNAPSHOTs. I hope the issues are fixed, but it would be great if > you could verify that. > > Dan > > > > On Nov 6, 2012, at 11:00 AM, Ryan <[email protected]> wrote: > > > You're right Andrei, somehow some of the prefix declarations in my > original > > message didn't make it. Oops. Here are my WSDL and XSDs again, > > hopefully with all of the info this time. > > > > WSDL: > > > > <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions name="File" > > targetNamespace="http://tempuri.org/" > > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" > > xmlns:wsu=" > > > http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-uti > lity-1.0.xsd > " > > > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" > > xmlns:tns="http://tempuri.org/" > > xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" > > xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" > > xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" > > xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" > > xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" > > xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" > > xmlns:wsa10="http://www.w3.org/2005/08/addressing" > > xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"> > > <wsp:Policy wsu:Id="FileEndpoint_policy"> > > <wsp:ExactlyOne> > > <wsp:All> > > <wsoma:OptimizedMimeSerialization xmlns:wsoma=" > > http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserializat > > ion > "/> > > </wsp:All> > > </wsp:ExactlyOne> > > </wsp:Policy> > > <wsdl:types> > > <xsd:schema targetNamespace="http://tempuri.org/Imports"> > > <xsd:import schemaLocation="1.xsd" namespace=" > > http://tempuri.org/"/> > > <xsd:import schemaLocation="0.xsd" namespace=" > > http://schemas.microsoft.com/Message"/> > > <xsd:import schemaLocation="2.xsd" namespace=" > > http://schemas.microsoft.com/2003/10/Serialization/"/> > > </xsd:schema> > > </wsdl:types> > > <wsdl:message name="RemoteFile"> > > <wsdl:part name="parameters" element="tns:RemoteFile"/> > > </wsdl:message> > > <wsdl:message name="RemoteFile_Headers"> > > <wsdl:part name="FileName" element="tns:FileName"/> > > <wsdl:part name="Length" element="tns:Length"/> > > </wsdl:message> > > <wsdl:message name="IFile_UploadFile_OutputMessage"/> > > <wsdl:portType name="IFile"> > > <wsdl:operation name="UploadFile"> > > <wsdl:input wsaw:Action="http://tempuri.org/IFile/UploadFile" > > name="RemoteFile" message="tns:RemoteFile"/> > > <wsdl:output wsaw:Action=" > > http://tempuri.org/IFile/UploadFileResponse" > > message="tns:IFile_UploadFile_OutputMessage"/> > > </wsdl:operation> > > </wsdl:portType> > > <wsdl:binding name="FileEndpoint" type="tns:IFile"> > > <wsp:PolicyReference URI="#FileEndpoint_policy"/> > > <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/> > > <wsdl:operation name="UploadFile"> > > <soap:operation soapAction=" > http://tempuri.org/IFile/UploadFile" > > style="document"/> > > <wsdl:input name="RemoteFile"> > > <soap:header message="tns:RemoteFile_Headers" > > part="FileName" use="literal"/> > > <soap:header message="tns:RemoteFile_Headers" > part="Length" > > use="literal"/> > > <soap:body use="literal"/> > > </wsdl:input> > > <wsdl:output> > > <soap:body use="literal"/> > > </wsdl:output> > > </wsdl:operation> > > </wsdl:binding> > > <wsdl:service name="File"> > > <wsdl:port name="FileEndpoint" binding="tns:FileEndpoint"> > > <soap:address location="http://localhost:10186/File.svc"/> > > </wsdl:port> > > </wsdl:service> > > </wsdl:definitions> > > > > XSD 0: > > > > <?xml version="1.0" encoding="UTF-8"?> <xs:schema > > elementFormDefault="qualified" > > targetNamespace="http://schemas.microsoft.com/Message" > > xmlns:xs="http://www.w3.org/2001/XMLSchema" > > xmlns:tns="http://schemas.microsoft.com/Message"> > > <xs:simpleType name="StreamBody"> > > <xs:restriction base="xs:base64Binary"/> > > </xs:simpleType> > > </xs:schema> > > > > XSD 1: > > > > <?xml version="1.0" encoding="UTF-8"?> <xs:schema > > elementFormDefault="qualified" > > targetNamespace="http://tempuri.org/" > > xmlns:xs="http://www.w3.org/2001/XMLSchema" > > xmlns:tns="http://tempuri.org/"> > > <xs:import schemaLocation="0.xsd" namespace=" > > http://schemas.microsoft.com/Message"/> > > <xs:element name="RemoteFile"> > > <xs:complexType> > > <xs:sequence> > > <xs:element name="FileByteStream" type="q1:StreamBody" > > xmlns:q1="http://schemas.microsoft.com/Message"/> > > </xs:sequence> > > </xs:complexType> > > </xs:element> > > <xs:element name="FileName" nillable="true" type="xs:string"/> > > <xs:element name="Length" type="xs:long"/> </xs:schema> > > > > XSD 2: > > > > <?xml version="1.0" encoding="UTF-8"?> <xs:schema > > attributeFormDefault="qualified" > > elementFormDefault="qualified" > > targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" > > xmlns:xs="http://www.w3.org/2001/XMLSchema" > > xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/"> > > <xs:element name="anyType" nillable="true" type="xs:anyType"/> > > <xs:element name="anyURI" nillable="true" type="xs:anyURI"/> > > <xs:element name="base64Binary" nillable="true" > type="xs:base64Binary"/> > > <xs:element name="boolean" nillable="true" type="xs:boolean"/> > > <xs:element name="byte" nillable="true" type="xs:byte"/> > > <xs:element name="dateTime" nillable="true" type="xs:dateTime"/> > > <xs:element name="decimal" nillable="true" type="xs:decimal"/> > > <xs:element name="double" nillable="true" type="xs:double"/> > > <xs:element name="float" nillable="true" type="xs:float"/> > > <xs:element name="int" nillable="true" type="xs:int"/> > > <xs:element name="long" nillable="true" type="xs:long"/> > > <xs:element name="QName" nillable="true" type="xs:QName"/> > > <xs:element name="short" nillable="true" type="xs:short"/> > > <xs:element name="string" nillable="true" type="xs:string"/> > > <xs:element name="unsignedByte" nillable="true" > type="xs:unsignedByte"/> > > <xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt"/> > > <xs:element name="unsignedLong" nillable="true" > type="xs:unsignedLong"/> > > <xs:element name="unsignedShort" nillable="true" > > type="xs:unsignedShort"/> > > <xs:element name="char" nillable="true" type="tns:char"/> > > <xs:simpleType name="char"> > > <xs:restriction base="xs:int"/> > > </xs:simpleType> > > <xs:element name="duration" nillable="true" type="tns:duration"/> > > <xs:simpleType name="duration"> > > <xs:restriction base="xs:duration"> > > <xs:pattern > > value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/> > > <xs:minInclusive value="-P10675199DT2H48M5.4775808S"/> > > <xs:maxInclusive value="P10675199DT2H48M5.4775807S"/> > > </xs:restriction> > > </xs:simpleType> > > <xs:element name="guid" nillable="true" type="tns:guid"/> > > <xs:simpleType name="guid"> > > <xs:restriction base="xs:string"> > > <xs:pattern > > > value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA > -F]{12}"/> > > </xs:restriction> > > </xs:simpleType> > > <xs:attribute name="FactoryType" type="xs:QName"/> > > <xs:attribute name="Id" type="xs:ID"/> > > <xs:attribute name="Ref" type="xs:IDREF"/> </xs:schema> > > > > I've downloaded the WSDL and the XSDs locally and validated it with > > no issues. I haven't have a chance to run wsdl2java directly against > > the > local > > copies instead of from within Eclipse yet. > > > > > > On Mon, Nov 5, 2012 at 7:16 AM, Andrei Shakirin > ><[email protected] > >wrote: > > > >> As far as I can see, "q1" namespace prefix is used, but not > >> declared in schema xsd=xsd1. > >> WSDL and schemas also miss number of prefixes declarations: wsdl; > >> xs; soap; wsp; wsu. > >> > >> I suggest you to validate your WSDL with any tool: Eclipse, XMLSpy, etc. > >> > >> Regards, > >> Andrei. > >> > >> -----Original Message----- > >> From: Ryan [mailto:[email protected]] > >> Sent: Montag, 5. November 2012 04:47 > >> To: [email protected] > >> Subject: Error generating CXF client for .Net WCF file upload > >> service > >> > >> I'm having some issues generating a CXF client for a file upload > >> service in WCF and am hoping for some guidance. I've been > >> troubleshooting from > the > >> WCF side for a couple weeks with help from MSDN and Asp.Net forums > >> and > have > >> run out of ideas on that side at least for now. > >> > >> The WSDLToJava command (from within Eclipse) and the exception I'm > getting > >> is as follows: > >> > >> wsdl2java -client -d C:\Users\Ryan\workspace\WcfProxy\.cxftmp/src > >> -classdir C:\Users\Ryan\workspace\WcfProxy\build\classes -p > >> http://tempuri.org/=org.tempuri -impl -validate -exsh false -dns > >> true -dex true -wsdlLocation > >> http://localhost:10186/UploadFile.svc?wsdl > >> -verbose -defaultValues -fe jaxws -db jaxb -wv 1.1 > >> http://localhost:10186/UploadFile.svc?wsdl > >> wsdl2java - Apache CXF 2.7.0 > >> > >> WSDLToJava Error: Schema Error : src-resolve: Cannot resolve the > >> name 'ns0:StreamBody' to a(n) 'type definition' component. > >> > >> My WSDL is: > >> > >> <?xml version="1.0" encoding="UTF-8"?><wsdl:definitions > >> name="UploadFile" targetNamespace="http://tempuri.org/"><wsp:Policy > >> wsu:Id="BasicHttpBinding_IUploadFile_policy"> > >> <wsp:ExactlyOne> > >> <wsp:All> > >> <wsoma:OptimizedMimeSerialization/> > >> </wsp:All> > >> </wsp:ExactlyOne></wsp:Policy><wsdl:types> > >> <xsd:schema targetNamespace="http://tempuri.org/Imports"> > >> <xsd:import > >> schemaLocation="http://localhost:10186/UploadFile.svc?xsd=xsd1" > >> namespace="http://tempuri.org/"/> > >> <xsd:import > >> schemaLocation="http://localhost:10186/UploadFile.svc?xsd=xsd0" > >> namespace="http://schemas.microsoft.com/Message"/> > >> <xsd:import > >> schemaLocation="http://localhost:10186/UploadFile.svc?xsd=xsd2" > >> namespace="http://schemas.microsoft.com/2003/10/Serialization/"/> > >> </xsd:schema></wsdl:types><wsdl:message name="RemoteFile"> > >> <wsdl:part name="parameters" > >> element="tns:RemoteFile"/></wsdl:message><wsdl:message > >> name="RemoteFile_Headers"> > >> <wsdl:part name="FileName" element="tns:FileName"/> > >> <wsdl:part name="Length" > >> element="tns:Length"/></wsdl:message><wsdl:message > >> name="IUploadFile_DownloadFile_InputMessage"/><wsdl:portType > >> name="IUploadFile"> > >> <wsdl:operation name="UploadFile"> > >> <wsdl:input > >> wsaw:Action="http://tempuri.org/IUploadFile/UploadFile" > >> name="RemoteFile" message="tns:RemoteFile"/> > >> </wsdl:operation> </wsdl:portType><wsdl:binding > >> name="BasicHttpBinding_IUploadFile" type="tns:IUploadFile"> > >> <wsp:PolicyReference URI="#BasicHttpBinding_IUploadFile_policy"/> > >> <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/> > >> <wsdl:operation name="UploadFile"> > >> <soap:operation > >> soapAction="http://tempuri.org/IUploadFile/UploadFile" > >> style="document"/> > >> <wsdl:input name="RemoteFile"> > >> <soap:header message="tns:RemoteFile_Headers" > >> part="FileName" use="literal"/> > >> <soap:header message="tns:RemoteFile_Headers" > >> part="Length" use="literal"/> > >> <soap:body use="literal"/> > >> </wsdl:input> > >> </wsdl:operation></wsdl:binding><wsdl:service name="UploadFile"> > >> <wsdl:port name="BasicHttpBinding_IUploadFile" > >> binding="tns:BasicHttpBinding_IUploadFile"> > >> <soap:address location="http://localhost:10186/UploadFile.svc"/> > >> </wsdl:port></wsdl:service></wsdl:definitions> > >> > >> My first thought was that there had to be a problem with the > >> xsd:import statements, so I followed those to see their content. > >> Here's the schema > at > >> "....=xsd1": > >> > >> <xs:schema elementFormDefault="qualified" targetNamespace=" > >> http://tempuri.org/"> > >> <xs:import schemaLocation=" > >> http://localhost:10186/UploadFile.svc?xsd=xsd0" > >> namespace="http://schemas.microsoft.com/Message"/> > >> <xs:element name="RemoteFile"> > >> <xs:complexType> > >> <xs:sequence> > >> <xs:element name="FileByteStream" type="q1:StreamBody"/> > >> </xs:sequence> > >> </xs:complexType> > >> </xs:element> > >> <xs:element name="FileName" nillable="true" type="xs:string"/> > >> <xs:element name="Length" type="xs:long"/> </xs:schema> > >> > >> And here's the schema that imports from "...=xsd0": > >> > >> <xs:schema elementFormDefault="qualified" > >> targetNamespace="http://schemas.microsoft.com/Message"> > >> <xs:simpleType name="StreamBody"> > >> <xs:restriction base="xs:base64Binary"/> </xs:simpleType> > >> </xs:schema> > >> > >> Now, I'm no WSDL expert, but it seems that everything in the WSDL > >> and imports matches up. I've created lots of .Net ASMX webservices > >> (the predecessor to WCF) that have interop'ed with Java clients > >> (and vice > versa) > >> just fine but this is the first attempt using WCF instead of ASMX. > >> The kicker is that .Net clients consume this service with no issue > >> of > course. > >> > >> If anyone has some insight into this, I'd greatly appreciate > >> another set of eyes on this. > >> > >> Thanks, > >> Ryan > >> > > -- > Daniel Kulp > [email protected] - http://dankulp.com/blog Talend Community Coder - > http://coders.talend.com > >
