views:

117

answers:

1

I have a web service exposed by an external entity that is developed in java.

My client is a .Net client.

I am unable to create the proxy class for this webservice using WSDL tool it errors out when it tries to read the schema file referenced in the WSDL file as

<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:tns="uri:StateApiService.types"
          elementFormDefault="qualified" 
          attributeFormDefault="unqualified"
            targetNamespace="uri:StateApiService.types">
  <xsd:include schemaLocation="StateApiTypes.xsd"/>
</xsd:schema>            

I have both my wsdl and xsd file locally in the same directory and I am trying to run the WSDL tool to generate the proxy.

Here is the beginning part of the schema file (XSD), just in case someone can tell me if there is anything wrong with the namespace or something:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="uri:StateApiService.types"
elementFormDefault="qualified" 
attributeFormDefault="unqualified"
targetNamespace="uri:StateApiService.types">

    <xsd:element name="ServerException">
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="code" type="xsd:string"/>
            <xsd:element name="message" type="xsd:string" />
        </xsd:sequence>             
    </xsd:complexType>              
</xsd:element>

What I am looking for Is there a tool out there that will take the WSDL and its referenced schema XSD and put all the type definitions in the schema inline into the WSDL so that the WSDL.exe tool may have a better chance of success?

Thanks a lot in advance for looking up my problem.

A: 

I strongly recommend that you don't do this. It's like deciding that because you've gotten a compile error in your Java/.NET project that you should combine all of your classes into one massive class.

Instead, you should check that your WSDL (and referenced schemas) are valid. (Tools like wsdl2java will also give you pretty helpful error messages if the WSDL/schema is invalid - I'm not a .NET guy so I can't comment on those tools).

It would also be helpful if you could tell us what your tool is telling you when it "errors out".

Catchwa
The tool that I was using was WSDL that comes along with .Net.
Moiz Tankiwala
There were actually two errors that I was running into;
Moiz Tankiwala
1 - WSDL tool when it accepts the file path, cannot accept spaces in the path. My path contained spaces and hence the tool could not pick up the schema file.
Moiz Tankiwala
2 - The schema file had some error related to namespace. I got the schema file from the server (not from the web service interface) and then the tool worked correctly.
Moiz Tankiwala