I've downloaded this new version and tried it in Visual C# but I
received the following error similar to 1.1.1:
-- output --
The document at the url http://localhost:8080/WebServices/account/SCAtest.php?wsdl
was not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from 'DISCO Document' is 'Discovery document at the URL
http://localhost:8080/WebServices/account/SCAtest.php?wsdl could not
be found.'.
- The document format is not recognized.
- Report from 'WSDL Document' is 'There is an error in XML document
(39, 10).'.
- The specified type was not recognized: name='tBody',
namespace='http://schemas.xmlsoap.org/wsdl/soap/', at <body
xmlns='http://schemas.xmlsoap.org/wsdl/soap/'>.
- Report from 'XML Schema' is 'The root element of a W3C XML Schema
should be <schema> and its namespace should be 'http://www.w3.org/2001/
XMLSchema'.'.
-- source --
<?php
include_once ('app_loader.inc.php');
include_once ('SCA/SCA.php');
/**
* Scaffold implementation for a remote StockQuote Web service.
*
* @service
* @binding.ws
*
*/
class SCAtest {
/**
* Get a stock quote for a given ticker symbol.
*
* @param string $ticker The ticker symbol.
* @return float The stock quote.
*/
function getQuote($ticker) {
return 80.9;
}
}
?>
-- wsdl --
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns2="http://SCAtest" xmlns:tns="http://schemas.xmlsoap.org/
wsdl/" xmlns:tns3="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
targetNamespace="http://SCAtest">
<types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://SCAtest"
elementFormDefault="qualified">
<xs:element name="getQuote">
<xs:complexType>
<xs:sequence>
<xs:element name="ticker" type="xs:string" nillable="true"/
>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getQuoteResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="getQuoteReturn" type="xs:float"
nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</types>
<message name="getQuoteRequest">
<part name="getQuoteRequest" element="tns2:getQuote"/>
</message>
<message name="getQuoteResponse">
<part name="return" element="tns2:getQuoteResponse"/>
</message>
<portType name="SCAtestPortType">
<operation name="getQuote">
<input message="tns2:getQuoteRequest"/>
<output message="tns2:getQuoteResponse"/>
</operation>
</portType>
<binding name="SCAtestBinding" type="tns2:SCAtestPortType">
<operation name="getQuote">
<input>
<tns3:body xsi:type="tns3:tBody" use="literal"/>
</input>
<output>
<tns3:body xsi:type="tns3:tBody" use="literal"/>
</output>
<tns3:operation xsi:type="tns3:tOperation" soapAction=""/>
</operation>
<tns3:binding xsi:type="tns3:tBinding" transport="http://
schemas.xmlsoap.org/soap/http" style="document"/>
</binding>
<service name="SCAtestService">
<port name="SCAtestPort" binding="tns2:SCAtestBinding">
<tns3:address xsi:type="tns3:tAddress" location="http://
localhost:8080/WebServices/account/SCAtest.php"/>
</port>
</service>
</definitions>
<!-- this line identifies this file as WSDL generated by SCA for PHP.
Do not remove -->
Well I can confirm that you do have "the fix", because it previously
generated:
<tns3:body xsi:type="tBody" use="literal"/>
and your error message said that it couldn't find type tBody in the
wsdl namespace. This was correct, because tBody is not in the soap
namespace.
Now what's generated is:
<tns3:body xsi:type="tns3:tBody" use="literal"/>
but it seems that is still not good enough. I don't see why it's
telling you that it can't find the tBody type in the soap namespace -
it is present there as a complexType. Can anyone explain?
Hi Geoff,
I get the same error when I try to add a web reference in Visual
Studio 7, 2002. For interest can you say what version of Microsoft
software you are using? I'll have a look at it and see if I can work
out what's wrong now.
Regards
Simon
OK, so the only way I can get this to work is by removing all of the
xsi:type attributes from the WSDL. This WSDL still works for PHP SCA
by the way. I expect the xsi:type attributes are
generated by SDO because the SOAP exlements in WSDL are generated in
an open type and SDO then thinks it needs to tell us what type they
when it writes out the XML. Is there a flag to turn this behaviour off?
I did the test on Microsoft Visual C# 2005 Express Edition. I haven't
tried with Axis2 for Java yet - but that is on my todo list.
Cheers,
- Geoff
OK thanks Geoff, so it's not some point in time Microsoft thing. I'll
be interested to hear what happens with Axis.
Simon
if (reader.getAttributeValue("http://www.w3.org/2001/
XMLSchema-instance","type")!=null){
java.lang.String fullTypeName =
reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance",
"type");
if (fullTypeName!=null){
java.lang.String nsPrefix =
fullTypeName.substring(0,fullTypeName.indexOf(":"));
nsPrefix = nsPrefix==null?"":nsPrefix;
Am I missing something here?
Hi Geoff, sorry, I missed these posts in my reader in a flurry of
other stuff. So you are saying, with the exception of the problem with
the generated code, your Axis->PHP/SCA test worked. Thanks for that.
Good news but we still need to sort out some way round the .Net
problem without having to manually edit the WSDL.
On the generated code problem. It seems that it is trying to find a
":" in an xsi:type attribute. I don't see any in the WSDL without a
namespace prefix but maybe this piece of code has already processed
them out. Anyhow, as you say It would seem to be coded to handle the
fact case where there might not be one (which is a good idea :-) so
I'm not sure what's going here. If we fix the WSDL for the .Net case
no doubt this will go away also.
Simon
Sorry for bringing up an old thread. But, I am working through the
same issue right now. Is the standing solution to grab the WSDL and
scrape out:
xsi:type="tns3:tBody"
xsi:type="tns3:tAddress"
from the generated WSDL so that Visual Studio can import it?
Is a more elegant solution possible?
Thanks,
Mike
> > > > > >Studio7, 2002. For interest can you say what version of Microsoft
Thanks,
Mike
E-mail messages may contain viruses, worms, or other malicious code. By reading the message and opening any attachments, the recipient accepts full responsibility for taking protective action against such code. Henry Schein is not liable for any loss or damage arising from this message.
The information in this email is confidential and may be legally privileged. It is intended solely for the addressee(s). Access to this e-mail by anyone else is unauthorized.
It seems that this is still the case. I didn't get a good answer to
whether we can turn the behaviour off so I'll go and take a look at
the code and see if we can request the omission of the type
annotations. It may be that they specified this bhaviour in the SDO
spec but it's probably easier to fix SDO than fix the MS dev tools.
Simon
Thanks for the feedback. I logged this as feature request #11012 in
PECL.
Best,
Mike
Thanks for doing that Mike
Simon