NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
ELement Created twice when making call


Joined: 21 Aug 2007
Posts: 11
Reply with quote
Dear Consider the following:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<SubscriptionSignUp xmlns="http://localhost/">
<ISPID>yy</ISPID>
<ISPPassword>xx</ISPPassword>
<ISPUserID>XX0fgfgg3</ISPUserID>
<CancellationCode>0</CancellationCode>
<ClientReference> </ClientReference>
<SiteName> </SiteName>
</SubscriptionSignUp>
</soap:Body>
</soap:Envelope>

I am constructing the call as follows:

$wsdlfile="http://....xml";
$client=new soapclient($wsdlfile, true); //, true);
$client->soap_defencoding = 'utf-8';

$nameSpace = ".......";




$err = $client->getError();
if ($err) {

echo '<p><b>Constructor error: ' . $err . '</b></p>';

}



$Request = array(
'SubscriptionStatus'=>array(
'ISPID' => 'lighthouse',
'ISPPassword' => 'lighthouse',
'ISPUserID'=>'Angelo1')
);

$result = $client->call('SubscriptionStatus', $Request);


This all looks good but when the request is made, I do the following:

echo '<br><br><h2>Request</h2>';
echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';


and get:

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:si="http://soapinterop.org/xsd"
xmlns:ns6908="http://tempuri_org">
<SOAP-ENV:Body>
<SubscriptionStatus xmlns="...">
<SubscriptionStatus xmlns="..."/>
</SubscriptionStatus>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Is there any reason why the <SubscriptionStatus xmlns="..."> is present
twice? And also why does once have a / at the end and the other not? I
think the first one is using the namespace for the xmlns="" and the
second one gets it from the WSDL file.
Is this correct?

Another question, is it the way I am make an instance of the nusoap
client =>

$client=new soapclient($wsdlfile, true); //, true);


Any help would be mostly appreciated.

Thanks in advance.
View user's profileFind all posts by zlogicSend private message


Joined: 21 Aug 2007
Posts: 11
Reply with quote
I've changed the way I construct my array to:

$Request = array(
array(
'ISPID' => 'yy',
'ISPPassword' => 'xx',
'ISPUserID'=>'XX0fgfgg3')
);

The result I get is:

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:si="http://soapinterop.org/xsd"
xmlns:tns="http://devbit.openbit.com/SOS/">
<SOAP-ENV:Body>
<SubscriptionStatus xmlns="http://devbit.openbit.com/SOS/">
<SubscriptionStatus xmlns="http://devbit.openbit.com/SOS/">
<ISPID>yy</ISPID>
<ISPPassword>xx</ISPPassword>
<ISPUserID>XX0fgfgg3</ISPUserID>
</SubscriptionStatus>
</SubscriptionStatus>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Which is better because its sending the parameters through but still its making the <SubscriptionStatus ...> twice.

So perhaps anyone knows why its making it twice?

TIA
View user's profileFind all posts by zlogicSend private message


Joined: 21 Aug 2007
Posts: 11
Reply with quote
Could a possible problem be that the WSDL defined has more than 1 method in it:


this is the WSDL file below:

As you can see all the different calls are defined in 1 WSDL file.
IE:
-SubscriptionSignUp
-SubscriptionStatus
-SubscriptionRequest

Could this be the problem with the same element being sent twice?


<wsdl:definitions targetNamespace="">

<wsdl:types>

<s:schema elementFormDefault="qualified" targetNamespace="">
<s:import namespace="param:scssParamClass"/>

<s:element name="SubscriptionSignUp">

<s:complexType>

<s:sequence>
<s:element maxOccurs="1" minOccurs="1" name="ISPID" type="s:string"/>
<s:element maxOccurs="1" minOccurs="1" name="ISPPassword" type="s:string"/>
<s:element maxOccurs="1" minOccurs="1" name="ISPUserID" type="s:string"/>
<s:element maxOccurs="1" minOccurs="1" name="PackageList" type="s1:ArrayOfSignUpPackage"/>
<s:element maxOccurs="1" minOccurs="0" name="UserSubscriptionPIN" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="ClientReference" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="SiteName" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="CountryCode" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="CampaignID" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="DisplayTime" type="s:boolean"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Package" nillable="true" type="s1:Package"/>
<s:element name="SignUpPackage" nillable="true" type="s1:SignUpPackage"/>

<s:element name="SubscriptionSignUpResponse">

<s:complexType>

<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="SubscriptionSignUpResult" type="tns:Response"/>
</s:sequence>
</s:complexType>
</s:element>

<s:complexType name="Response">

<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="Ack" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="OldComputerName" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="UserSubscriptionPIN" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="SubscriptionList" type="tns:ArrayOfSubscription"/>
<s:element maxOccurs="1" minOccurs="0" name="ActiveSeat" type="tns:ActiveSeat"/>
<s:element maxOccurs="1" minOccurs="0" name="ActiveSeatList" type="tns:ArrayOfActiveSeat"/>
</s:sequence>
</s:complexType>

<s:complexType name="ArrayOfSubscription">

<s:sequence>
<s:element maxOccurs="unbounded" minOccurs="0" name="Subscription" nillable="true" type="tns:Subscription"/>
</s:sequence>
</s:complexType>

<s:complexType name="Subscription">

<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="Ack" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="SubscriptionID" type="s:int"/>
<s:element maxOccurs="1" minOccurs="0" name="Status" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="SignUpDate" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="ReEnableURL" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="Package" type="tns:Package"/>
</s:sequence>
</s:complexType>

<s:complexType name="Package">

<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="Ack" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="PackageID" type="s:int"/>
<s:element maxOccurs="1" minOccurs="0" name="PackageName" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="PackageDesc" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="ISPSku" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="CID" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="Seats" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="ProductList" type="tns:ArrayOfProduct"/>
</s:sequence>
</s:complexType>

<s:complexType name="ArrayOfProduct">

<s:sequence>
<s:element maxOccurs="unbounded" minOccurs="0" name="Product" nillable="true" type="tns:Product"/>
</s:sequence>
</s:complexType>

<s:complexType name="Product">

<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="ProductID" type="s:int"/>
<s:element maxOccurs="1" minOccurs="0" name="Name" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="Description" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="SeatList" type="tns:ArrayOfSeat"/>
</s:sequence>
</s:complexType>

<s:complexType name="ArrayOfSeat">

<s:sequence>
<s:element maxOccurs="unbounded" minOccurs="0" name="Seat" nillable="true" type="tns:Seat"/>
</s:sequence>
</s:complexType>

<s:complexType name="Seat">

<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="SeatID" type="s:int"/>
<s:element maxOccurs="1" minOccurs="0" name="SKUID" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="ComputerName" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="FingerPrint" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="InstallDate" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="Status" type="s:string"/>
</s:sequence>
</s:complexType>

<s:complexType name="ActiveSeat">

<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="SubscriptionID" type="s:int"/>
<s:element maxOccurs="1" minOccurs="0" name="PackageID" type="s:int"/>
<s:element maxOccurs="1" minOccurs="0" name="PackageName" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="ProductID" type="s:int"/>
<s:element maxOccurs="1" minOccurs="0" name="ProductName" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="RemainingSeatCount" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="SeatID" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="TID" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="NewComputerName" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="NewFingerPrint" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="OldComputerName" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="OldFingerPrint" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="InstallDate" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="Status" type="s:string"/>
</s:sequence>
</s:complexType>

<s:complexType name="ArrayOfActiveSeat">

<s:sequence>
<s:element maxOccurs="unbounded" minOccurs="0" name="ActiveSeat" nillable="true" type="tns:ActiveSeat"/>
</s:sequence>
</s:complexType>

<s:element name="SubscriptionCancel">

<s:complexType>

<s:sequence>
<s:element maxOccurs="1" minOccurs="1" name="ISPID" type="s:string"/>
<s:element maxOccurs="1" minOccurs="1" name="ISPPassword" type="s:string"/>
<s:element maxOccurs="1" minOccurs="1" name="ISPUserID" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="UserSubscriptionPIN" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="CancellationCode" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="Message" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="ReEnableURL" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="SubscriptionList" type="s1:ArrayOfSubscription"/>
<s:element maxOccurs="1" minOccurs="0" name="PackageList" type="s1:ArrayOfPackage"/>
<s:element maxOccurs="1" minOccurs="0" name="ClientReference" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="SiteName" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="CountryCode" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="DisplayTime" type="s:boolean"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Subscription" nillable="true" type="s1:Subscription"/>

<s:element name="SubscriptionCancelResponse">

<s:complexType>

<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="SubscriptionCancelResult" type="tns:Response"/>
</s:sequence>
</s:complexType>
</s:element>

<s:element name="SubscriptionStatus">

<s:complexType>

<s:sequence>
<s:element maxOccurs="1" minOccurs="1" name="ISPID" type="s:string"/>
<s:element maxOccurs="1" minOccurs="1" name="ISPPassword" type="s:string"/>
<s:element maxOccurs="1" minOccurs="1" name="ISPUserID" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="UserSubscriptionPIN" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="SubscriptionList" type="s1:ArrayOfSubscription"/>
<s:element maxOccurs="1" minOccurs="0" name="PackageList" type="s1:ArrayOfPackage"/>
<s:element maxOccurs="1" minOccurs="0" name="Status" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="DisplayTime" type="s:boolean"/>
<s:element maxOccurs="1" minOccurs="0" name="ResponseVersion" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>

<s:element name="SubscriptionStatusResponse">

<s:complexType>

<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="SubscriptionStatusResult" type="tns:Response"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>

<s:schema elementFormDefault="qualified" targetNamespace="param:scssParamClass">
<s:import namespace=""/>

<s:complexType name="ArrayOfPackage">

<s:sequence>
<s:element maxOccurs="unbounded" minOccurs="0" ref="tns:Package"/>
</s:sequence>
</s:complexType>

<s:complexType name="Package">

<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="PackageID" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="ISPSKU" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="PackageQty" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="FreePeriod" type="s:string"/>
</s:sequence>
</s:complexType>

<s:complexType name="ArrayOfSignUpPackage">

<s:sequence>
<s:element maxOccurs="1" minOccurs="1" ref="tns:SignUpPackage"/>
</s:sequence>
</s:complexType>

<s:complexType name="SignUpPackage">

<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="PackageID" type="s:string"/>
<s:element maxOccurs="1" minOccurs="1" name="ISPSKU" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="PackageQty" type="s:string"/>
<s:element maxOccurs="1" minOccurs="0" name="FreePeriod" type="s:string"/>
</s:sequence>
</s:complexType>

<s:complexType name="ArrayOfSubscription">

<s:sequence>
<s:element maxOccurs="unbounded" minOccurs="0" ref="tns:Subscription"/>
</s:sequence>
</s:complexType>

<s:complexType name="Subscription">

<s:sequence>
<s:element maxOccurs="1" minOccurs="0" name="SubscriptionID" type="s:int"/>
</s:sequence>
</s:complexType>
</s:schema>
</wsdl:types>

<wsdl:message name="SubscriptionSignUpSoapIn">
<wsdl:part element="tns:SubscriptionSignUp" name="parameters"/>
</wsdl:message>

<wsdl:message name="SubscriptionSignUpSoapOut">
<wsdl:part element="tns:SubscriptionSignUpResponse" name="parameters"/>
</wsdl:message>

<wsdl:message name="SubscriptionCancelSoapIn">
<wsdl:part element="tns:SubscriptionCancel" name="parameters"/>
</wsdl:message>

<wsdl:message name="SubscriptionCancelSoapOut">
<wsdl:part element="tns:SubscriptionCancelResponse" name="parameters"/>
</wsdl:message>

<wsdl:message name="SubscriptionStatusSoapIn">
<wsdl:part element="tns:SubscriptionStatus" name="parameters"/>
</wsdl:message>

<wsdl:message name="SubscriptionStatusSoapOut">
<wsdl:part element="tns:SubscriptionStatusResponse" name="parameters"/>
</wsdl:message>

<wsdl:portType name="lmBBSSUserAPISoap">

<wsdl:operation name="SubscriptionSignUp">

<documentation>
SubscriptionSignUp Function Creates a User Subscription
</documentation>
<wsdl:input message="tns:SubscriptionSignUpSoapIn"/>
<wsdl:output message="tns:SubscriptionSignUpSoapOut"/>
</wsdl:operation>

<wsdl:operation name="SubscriptionCancel">
<documentation>SubscriptionCancel cancels a user subscription</documentation>
<wsdl:input message="tns:SubscriptionCancelSoapIn"/>
<wsdl:output message="tns:SubscriptionCancelSoapOut"/>
</wsdl:operation>

<wsdl:operation name="SubscriptionStatus">

<documentation>
SubscriptionStatus Function Creates Subscription Status
</documentation>
<wsdl:input message="tns:SubscriptionStatusSoapIn"/>
<wsdl:output message="tns:SubscriptionStatusSoapOut"/>
</wsdl:operation>
</wsdl:portType>

<wsdl:binding name="lmBBSSUserAPISoap" type="tns:lmBBSSUserAPISoap">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

<wsdl:operation name="SubscriptionSignUp">
<soap:operation soapAction="SOSServlet"/>

<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>

<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>

<wsdl:operation name="SubscriptionCancel">
<soap:operation soapAction="SOSServlet"/>

<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>

<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>

<wsdl:operation name="SubscriptionStatus">
<soap:operation soapAction="SOSServlet"/>

<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>

<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>

<wsdl:service name="lmBBSSUserAPI">
<documentation/>

<wsdl:port binding="tns:lmBBSSUserAPISoap" name="lmBBSSUserAPISoap">
<soap:address location="SOSServlet"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
View user's profileFind all posts by zlogicSend private message
ELement Created twice when making call
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic