
Dear Matthew, The snippet from the schema file seems to be alright. The problem is in the wsdl file. I think the sample you sent might be replaced with: "<?xml version="1.0"?> <definitions name="logingateway" targetNamespace="http://localhost/test3.wsdl" xmlns:gwns="http://localhost/test3.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:becta="http://localhost/bdefinitions" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <import namespace="http://localhost/bdefinitions" schemaLocation="http://10.0.250.144/bdefinitions.xsd"/> <import namespace="http://schemas.xmlsoap.org/wsdl/soap/" schemaLocation="http://10.0.250.144/soap.xsd"/> <!--Interface Messages--> <message name="loginuser"> <part name="loginname" type="xsd:string"/> <part name="password" type="xsd:string"/> <part name="site" type="becta:guidtype"/> </message>" These are the major differences from your file: --The "xsd:import" tags are replaced by "import" ones. The wsdl files have their own import statements. So prefixing the import statement with "xsd" is wrong. --The namespace attribute's value should be "http://localhost/bdefinitions" and not "http://localhost/bdefinitions.xsd". That's because it should be equal exactly with the target namespace declaration from the schema. --For the same reason the "xmlns:becta="http://localhost/bdefinitions.xsd"" attribute in the "definitions" tag should be "xmlns:becta="http://localhost/bdefinitions"" --The "type" attribute in the message part named "site" should change value from "b:guidtype" to "becta:guidtype" because the "b" prefix is not mapped to any namespace. For further information on wsdl you can read the following specification: "http://www.w3.org/TR/wsdl" Please try this and get back if you run into any more trouble. Regards, Radu. Matthew Riches wrote:
Thanks for your help. I just can't get it to work. I can see what you are saying, but no matter what way I try to implement it I get different errors thrown up.
Some code samples
In my xsd (called bdefinitions.xsd) [code] <xs:schema targetNamespace="http://localhost/bdefinitions" elementFormDefault="qualified" xmlns="http://localhost/bdefinitions.xsd" xmlns:mstns="http://tempuri.org/XMLSchema.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="guidtype"> <xs:restriction base="xs:string" > <xs:length value="34" /> </xs:restriction> </xs:simpleType>
In my wsdl (called test3.wsdl) [code] <?xml version="1.0"?>
<definitions name="logingateway" targetNamespace="http://localhost/test3.wsdl" xmlns:gwns="http://localhost/test3.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:becta="http://localhost/bdefinitions.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<xsd:import namespace="http://localhost/bdefinitions.xsd" schemaLocation="http://10.0.250.144/bdefinitions.xsd"/> <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/soap/" schemaLocation="http://10.0.250.144/soap.xsd"/>
<!--Interface Messages--> <message name="loginuser"> <part name="loginname" type="xsd:string"/> <part name="password" type="xsd:string"/> <part name="site" type="b:guidtype"/> </message>
Unfortunately, I am not an xml guru, as I'm sure you can tell, Im just trying to fill in some gaps in our knowledge temporarily
-----Original Message----- From: Radu Coravu [mailto:radu_coravu@sync.ro] Sent: 15 March 2005 07:11 To: Matthew Riches Cc: oxygen-user@oxygenxml.com Subject: Re: [oXygen-user] Problem Debugging WSDL
Hello Matthew,
Things should be pretty simple. Let's say the target namespace of the schema in which the simple type is
defined is : "http://test". Then, in the wsdl file in the "types" section you should have something like this:
"<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://test"> <include schemaLocation="a.xsd"/> </schema>"
The type will then be used like: " <message name="someMessage"> <part name="from" type="test:guidtype"/> </message>"
Of course you need to add the attribute ' xmlns:test="http://test" ' to
the "definitions" tag. There are other ways to use the types defined in the schema but this seems to me the easiest one.
If you are looking for something else maybe some more details about what
you are trying to achieve and the way in which you try to include/import
the schema file in the wsdl may be useful. Also maybe some code snippets from the wsdl file would be useful.
Regards, Radu.
Matthew Riches wrote:
Thanks, that's solved a lot of banging heads on keyboards...
Another quick question if I may?
I have a type defined in an xsd such that [code] <xs:simpleType name="guidtype"> <xs:restriction base="xs:string" > <xs:length value="34" /> </xs:restriction> </xs:simpleType>
And the file is imported into my wsdl (I have checked all the case this time)
But no matter what, I get an error message saying that it cannot solve type guidtype from namespace <the namespace> to a local definition.
I am certain that this is not a capitalisation issue, so any more hints on how to deal with this message would be appreciated. Matt
********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************
********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************