On 4 Oct, 14:12, [EMAIL PROTECTED] wrote:
> On 4 Oct, 12:27, maapi123 <[EMAIL PROTECTED]> wrote:
>
> > Hi All,
>
> > I have created a web service which returns the xml data by reading the
> > following article.
>
> >http://www.ibm.com/developerworks/web/library/ws-soa-scasdo/index.html
>
> > But, the Service is working for local services only. If I am trying to
> > access the services from a remote machine, I am getting the following
> > error.
>
> > ( ! ) Fatal error: Uncaught SCA_RuntimeException: SDO_Exception in
> > setWSDLTypes : Type not found:http://Bccbugsthrown in /usr/share/
> > pear/SCA_SDO-1.2.2/SCA/Bindings/soap/Proxy.php on line 104
>
> > Pl. do reply me.
>
> > My files are,
>
> > BugService.php
> > <?
> > include "SCA/SCA.php";
> > /**
> > * @service
> > * @binding.soap
> > *
> > * @typeshttp://Bcchttp://10.10.11.153/SOA/BugDetails.xsd
> > */
> > class BugService {
> > /**
> > * @param string $pcode Project Code
> > * @return bugshttp://Bcc
> > */
> > function getBugs($pcode) {
> > $bugs = SCA::createDataObject('http://Bcc','Bugs');
> > $bug1 = $bugs->createDataObject('bug');
> > $bug1->bid = 3;
> > $bug1->keywords = "keyword + Proj. code : ".$pcode;
> > $bug1->detail = "detail " ;
> > $bug1->version = "1.2";
> > $bug1->os = "xp" ;
> > $bug1->ram = "512";
> > $bug1->ebid = "12" ;
> > $bug1->level = "level2" ;
> > $bug1->bclass = "class1" ;
> > $bug1->reporter = 46 ;
> > $bug1->status = 524 ;
>
> > $bug2 = $bugs->createDataObject('bug');
> > $bug2->bid = 4;
> > $bug2->keywords = "keyword1 + Proj. code : ".$pcode;
> > $bug2->detail = "detail1 " ;
> > $bug2->version = "1.5";
> > $bug2->os = "Windows98" ;
> > $bug2->ram = "256";
> > $bug2->ebid = "1212" ;
> > $bug2->level = "level3" ;
> > $bug2->bclass = "class12" ;
> > $bug2->reporter = 46 ;
> > $bug2->status = 524 ;
> > return $bugs;
> > }}
>
> > ?>
>
> > BugDetails.xsd
>
> > <?xml version="1.0" encoding="UTF-8" ?>
> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > targetNamespace="http://Bcc" elementFormDefault="qualified">
>
> > <xs:element name="Bug" >
> > <xs:complexType>
> > <xs:sequence>
> > <xs:element name="bid" type="xs:integer"/>
> > <xs:element name="keywords" type="xs:string"/>
> > <xs:element name="detail" type="xs:string"/>
> > <xs:element name="version" type="xs:string"/>
> > <xs:element name="os" type="xs:string"/>
> > <xs:element name="ram" type="xs:string"/>
> > <xs:element name="ebid" type="xs:string"/>
> > <xs:element name="level" type="xs:string"/>
> > <xs:element name="bclass" type="xs:string"/>
> > <xs:element name="reporter" type="xs:integer"/>
> > <xs:element name="status" type="xs:integer"/>
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> > <xs:element name="Bugs">
> > <xs:complexType>
> > <xs:sequence>
> > <xs:element name="bug" type="ns1:Bug" maxOccurs="unbounded" />
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> > </xs:schema>
>
> > Client.php
> > <?php
> > include "SCA/SCA.php";
> > // $b = SCA::getService('BugService.php');
> > $b = SCA::getService('http://10.10.11.153/SOA/BugService.php?
> > wsdl');
> > $bugs = $b->getBugs('good');
> > echo "Received bugs from Web service:<br>";
> > foreach($bugs->bug as $Pair)
> > {
> > echo "\"Bid\": ". $Pair-> bid . " :\" Keywords \" " .
> > $Pair-> keywords . " : ";
> > echo " \"Detail\" ". $Pair-> detail . " :\" Version\" " .
> > $Pair-> version . " : ";
> > echo " \"OS\" ".$Pair-> os . " : \"RAM\" " . $Pair->
> > ram . " : ";
> > echo "\"E-BID\"".$Pair-> ebid . " : \"Level\" " . $Pair->
> > level . " : ";
> > echo "\"Class\" ".$Pair-> bclass . " : \"Reporter\"" .
> > $Pair-> reporter . " : ";
> > echo "\"Status\"". $Pair-> status . "<br>";
> > }
> > ?>
>
> > The WSDL is,
> > <wsdl:definitions targetNamespace="http://BugService">
> > -
> > <types>
> > -
> > <xs:schema targetNamespace="http://BugService"
> > elementFormDefault="qualified">
> > <xs:import schemaLocation="http://10.10.11.153/SOA/BugDetails.xsd"
> > namespace="http://Bcc"/>
> > -
> > <xs:element name="getBugs">
> > -
> > <xs:complexType>
> > -
> > <xs:sequence>
> > <xs:element name="pcode" type="xs:string"/>
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> > -
> > <xs:element name="getBugsResponse">
> > -
> > <xs:complexType>
> > -
> > <xs:sequence>
> > <xs:element name="getBugsReturn" type="ns0:bugs"/>
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> > </xs:schema>
> > </types>
> > -
> > <wsdl:message name="getBugsRequest">
> > <wsdl:part name="getBugsRequest" element="tns2:getBugs"/>
> > </wsdl:message>
> > -
> > <wsdl:message name="getBugsResponse">
> > <wsdl:part name="return" element="tns2:getBugsResponse"/>
> > </wsdl:message>
> > -
> > <wsdl:portType name="BugServicePortType">
> > -
> > <wsdl:operation name="getBugs">
> > <wsdl:input message="tns2:getBugsRequest"/>
> > <wsdl:output message="tns2:getBugsResponse"/>
> > </wsdl:operation>
> > </wsdl:portType>
> > -
> > <wsdl:binding name="BugServiceBinding"
> > type="tns2:BugServicePortType">
> > <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
> > style="document"/>
> > -
> > <wsdl:operation name="getBugs">
> > <soap:operation soapAction=""/>
> > -
> > <wsdl:input>
> > <soap:body use="literal"/>
> > </wsdl:input>
> > -
> > <wsdl:output>
> > <soap:body use="literal"/>
> > </wsdl:output>
> > </wsdl:operation>
> > </wsdl:binding>
> > -
> > <wsdl:service name="BugServiceService">
> > -
> > <wsdl:port name="BugServicePort" binding="tns2:BugServiceBinding">
> > <soap:address location="http://10.10.11.153/SOA/BugService.php"/>
> > </wsdl:port>
> > </wsdl:service>
> > </wsdl:definitions>
> > -
> > <!--
> > this line identifies this file as WSDL generated by SCA for PHP. Do
> > not remove
> > -->
>
> Thanks for the note. We'll give it a spin and see what happens.
>
> Regards
>
> Simon
It's amazing how what on the surface looks like such a simple example
can find interesting bugs. I've attached the files I've ended up with
below. Let me explain what I did to make it work..
BugService.xsd
Changed elements into types, using capitalization for the typenames,
as the types are referred to elsewhere
added missing xmlns:ns1=
Changed namespace from http://Bcc to http://Dcc
BugService.php
Fixed up to refer to http://Dcc
This namespace change was the real killer. After making the other
fixes it still didn't work and it took me a while to work out that
there is a bug in the SCA code that means that it won't work if the
namespace of the schema that describes the SDO objects comes earlier
in the alphabet that the generated namespace in the WSDL which in our
case here is "http://BugService". Strange eh! I've raised a pecl bug
for this.
Hope that helps
Simon
==============
<?php
include "SCA/SCA.php";
/**
* @service
* @binding.soap
*
* @types http://Dcc http://localhost/SOA/BugDetails.xsd
*/
class BugService {
/**
* @param string $pcode Project Code
* @return Bugs http://Dcc
*/
function getBugs($pcode) {
$bugs = SCA::createDataObject('http://Dcc','Bugs');
$bug1 = $bugs->createDataObject('bug');
$bug1->bid = 3;
$bug1->keywords = "keyword + Proj. code : ".$pcode;
$bug1->detail = "detail " ;
$bug1->version = "1.2";
$bug1->os = "xp" ;
$bug1->ram = "512";
$bug1->ebid = "12" ;
$bug1->level = "level2" ;
$bug1->bclass = "class1" ;
$bug1->reporter = 46 ;
$bug1->status = 524 ;
$bug2 = $bugs->createDataObject('bug');
$bug2->bid = 4;
$bug2->keywords = "keyword1 + Proj. code : ".$pcode;
$bug2->detail = "detail1 " ;
$bug2->version = "1.5";
$bug2->os = "Windows98" ;
$bug2->ram = "256";
$bug2->ebid = "1212" ;
$bug2->level = "level3" ;
$bug2->bclass = "class12" ;
$bug2->reporter = 46 ;
$bug2->status = 524 ;
return $bugs;
}
}
?>
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://Dcc"
xmlns:ns1="http://Dcc"
elementFormDefault="qualified">
<!--xs:element name="Bug" -->
<xs:complexType name="Bug">
<xs:sequence>
<xs:element name="bid" type="xs:integer"/>
<xs:element name="keywords" type="xs:string"/>
<xs:element name="detail" type="xs:string"/>
<xs:element name="version" type="xs:string"/>
<xs:element name="os" type="xs:string"/>
<xs:element name="ram" type="xs:string"/>
<xs:element name="ebid" type="xs:string"/>
<xs:element name="level" type="xs:string"/>
<xs:element name="bclass" type="xs:string"/>
<xs:element name="reporter" type="xs:integer"/>
<xs:element name="status" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
<!--/xs:element-->
<!--xs:element name="Bugs"-->
<xs:complexType name="Bugs">
<xs:sequence>
<xs:element name="bug" type="ns1:Bug" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<!--/xs:element-->
</xs:schema>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"phpsoa" group.
To post to this group, send email to phpsoa@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.co.uk/group/phpsoa?hl=en
-~----------~----~----~----~------~----~------~--~---