.NET integration and SCA_SDO 1.1.2

4 views
Skip to first unread message

geoff w

unread,
Feb 14, 2007, 11:59:21 AM2/14/07
to phpsoa
Can you confirm that this new version of SCA 1.1.2 will fix the issue
with exposing web services to a .NET environment?

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 -->

cem

unread,
Feb 14, 2007, 2:26:28 PM2/14/07
to phpsoa
On Feb 14, 4:59 pm, "geoff w" <geoff.whitting...@gmail.com> wrote:
> Can you confirm that this new version of SCA 1.1.2 will fix the issue
> with exposing web services to a .NET environment?
>
> 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 urlhttp://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 URLhttp://localhost:8080/WebServices/account/SCAtest.php?wsdlcould 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'.'.

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?

simon...@googlemail.com

unread,
Feb 15, 2007, 5:31:31 AM2/15/07
to phpsoa

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

simon...@googlemail.com

unread,
Feb 15, 2007, 5:51:25 AM2/15/07
to phpsoa

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?

geoff w

unread,
Feb 15, 2007, 12:23:43 PM2/15/07
to phpsoa
Hi Simon,

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

simon...@googlemail.com

unread,
Feb 16, 2007, 5:48:57 AM2/16/07
to phpsoa

OK thanks Geoff, so it's not some point in time Microsoft thing. I'll
be interested to hear what happens with Axis.

Simon

geoff w

unread,
Feb 16, 2007, 1:11:01 PM2/16/07
to phpsoa
Ok - I gave Axis2 1.1.1 a whirl. I used the latest Axis2 Eclipse plug-
in to generate the code and I got an error. On the following line of
code with the 'substring' I get a
'java.lang.StringIndexOutOfBoundsException'. It appears that this is a
breakdown in the generated code because the next line of code seems to
be okay with the idea nsPrefix could be null.

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?

geoff w

unread,
Feb 16, 2007, 2:02:19 PM2/16/07
to phpsoa
Sorry - as a follow-up when I relaxed the code so that the 'substring'
exception wouldn't get thrown Axis2->PHP/SCA worked.

simon...@googlemail.com

unread,
Feb 21, 2007, 7:05:49 AM2/21/07
to phpsoa

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

Michael Caplan

unread,
May 10, 2007, 4:08:45 PM5/10/07
to simon...@googlemail.com, php...@googlegroups.com
Hey there,

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

Caplan, Michael

unread,
May 10, 2007, 7:48:02 PM5/10/07
to php...@googlegroups.com
Hey there,


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.

simon...@googlemail.com

unread,
May 11, 2007, 5:26:21 AM5/11/07
to phpsoa
Hi Mike

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

Caplan, Michael

unread,
May 11, 2007, 7:26:54 AM5/11/07
to php...@googlegroups.com
Hi Simon,

Thanks for the feedback. I logged this as feature request #11012 in
PECL.

Best,

Mike

simon...@googlemail.com

unread,
May 11, 2007, 7:31:00 AM5/11/07
to phpsoa

Thanks for doing that Mike

Simon

Reply all
Reply to author
Forward
0 new messages