How can I debug QXmlSchema's load method? - c++

I'm trying to load the following XML Schema with QXmlSchema, however QXmlSchema::load(const QUrl & source) always returns false. Is there any way to have Qt provide some about what actually went wrong? The schema checks out fine in several validators as far as I can tell (the w3c one provided mysterious output that looked like it passed).
<?xml version="1.0" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="message">
<xsd:complexType>
<xsd:choice>
<xsd:element name="login-reply">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Accepted" />
<xsd:enumeration value="Rejected" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="login-request" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="username" type="xsd:string" nillable="false"/>
<xsd:element name="password" type="xsd:string" nillable="false"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="logout-request">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="username" type="xsd:string" nillable="false"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="logout-reply">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Accepted" />
<xsd:enumeration value="Rejected" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="tasklist-request" />
<xsd:element name="tasklist-reply">
<xsd:complexType>
<xsd:sequence minOccurs="1">
<xsd:element name="package" minOccurs="1" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="taskgroup" minOccurs="1" nillable="false">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="id" type="xsd:integer" minOccurs="1" />
<xsd:element name="task" type="xsd:string" minOccurs="1" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:integer" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:integer" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="starttask-request">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="task-id" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="starttask-reply">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Accepted" />
<xsd:enumeration value="Rejected" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>

bool QXmlSchema::load() itself returns only boolean result that is not really useful for debugging. But there this is more better way to get more appropriate error message.
You could use method void QXmlSchema::setMessageHandler(QAbstractMessageHandler *handler).
Here is example from my project.
First subclassing QAbstractMessageHandler
class MessageHandler : public QAbstractMessageHandler
{
public:
MessageHandler()
: QAbstractMessageHandler(),
m_messageType(QtMsgType()),
m_description(),
m_sourceLocation(QSourceLocation())
{}
QString statusMessage() const
{
return m_description;
}
qint64 line() const
{
return m_sourceLocation.line();
}
qint64 column() const
{
return m_sourceLocation.column();
}
protected:
virtual void handleMessage(QtMsgType type,
const QString &description,
const QUrl &identifier,
const QSourceLocation &sourceLocation) Q_DECL_OVERRIDE
{
Q_UNUSED(type);
Q_UNUSED(identifier);
m_messageType = type;
m_description = description;
m_sourceLocation = sourceLocation;
}
private:
QtMsgType m_messageType;
QString m_description;
QSourceLocation m_sourceLocation;
};
Then before loading set message handler.
QFile file("myschema.xsd");
file.open(QIODevice::ReadOnly);
MessageHandler messageHandler;
QXmlSchema sch;
sch.setMessageHandler(&messageHandler);
if (sch.load(&file, QUrl::fromLocalFile(file.fileName()))==false)
{
QString error = messageHandler.statusMessage();
qint64 line = messageHandler.line();
qint64 column = messageHandler.column();
/*Do what need if error*/
}

bool QXmlSchema::load() returns false on multiple conditions according to this source documentation
So the answer to my question: No, there is no way to get an error message from Qts parser per Qt 4.7.3 and there is no way via Qts APIs to differentiate between an I/O error and a schema error, since load returns false on both.

Related

How to remove unused namespaces from xsd using xslt. Keeping schema reference namespaces entact

I have an xsd file such as :-
<?xml version="1.0" encoding="UTF-8"?>
<xsd:element xmlns:ns2="http://www.tibco.com/ns/no_namespace_schema_location/UnitTest/TestProcess-End.xsd"
xmlns:ns="http://www.tibco.com/ns/no_namespace_schema_location/UnitTest/TestProcess-Map Data.xsd"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:pd="http://xmlns.tibco.com/bw/process/2003"
xmlns:ns="http://www.tibco.com/namespaces/tnt/plugins/jms"
name="group">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="root">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="a" type="xsd:string" minOccurs="0"/>
<xsd:element name="b" type="xsd:string" minOccurs="0"/>
<xsd:element name="c" type="xsd:string" minOccurs="0"/>
<xsd:element name="d" type="xsd:string" minOccurs="0"/>
<xsd:element name="e" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element ref="ns:root"/>
<xsd:element ref="ns2:root"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
This contains some un used namespaces, can any one explain how to achieve it with xslt:-
the output desired is :- Please note the namespaces which are used for schema references should be entact.
<?xml version="1.0" encoding="UTF-8"?>
<xsd:element xmlns:ns2="http://www.tibco.com/ns/no_namespace_schema_location/UnitTest/TestProcess-End.xsd"
xmlns:ns="http://www.tibco.com/ns/no_namespace_schema_location/UnitTest/TestProcess-Map Data.xsd"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="group">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="root">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="a" type="xsd:string" minOccurs="0"/>
<xsd:element name="b" type="xsd:string" minOccurs="0"/>
<xsd:element name="c" type="xsd:string" minOccurs="0"/>
<xsd:element name="d" type="xsd:string" minOccurs="0"/>
<xsd:element name="e" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element ref="ns:root"/>
<xsd:element ref="ns2:root"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Use exclude-result-prefixes in xslt declaration
In XSLT 2.0, you can do <xsl:copy-of select="/" copy-namespaces="no"/> which will copy the entire document, excluding any namespaces that aren't used in element or attribute names. However, it might remove namespaces that are used only in attribute content, for example ref="ns2:root". Detecting those cases reliably is quite tricky, especially if they are used inside XPath expressions (e.g. in xs:key and xs:keyref constraints).
If you want to remove all "unused" namespaces except those in a $retain list, you could do something like (again XSLT 2.0):
<xsl:template match="*">
<xsl:copy copy-namespaces="no">
<xsl:copy-of select="#*"/>
<xsl:copy-of select="namespace::*[not(name()=$retain)]"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
and you could perhaps initialize $retain to contain all strings in the stylesheet that match [A-Za-z0-9]:, minus the colon.

Delphi Soap Web Services with xsd shema

First Of All sorry about my bad English :D and Thanks for your help...
I have to write a Delphi web service with xsd schema and the wsdl similar to wsdl at the bottom. Is it possible with Delphi. I have to write a service according to the existing web service client, the wsdl at the bottom belongs to an php web service with nusoap library.
I seem to hear you write this web service with php nusoap, but as you know that Delphi web service can be standalone exe and I need it's ability for our product.
I can write this web service with php no problem, but if it is possible, I want to write this web service with Delphi as a standalone.
I could write this web service with Delphi as standalone.The problem is that WSDL. My service's WSDL have to similar with the WSDL at the bottom. Can I do my service's wsdl similar to wsdl at the bottom? If it is possible,how can I do?
I'm using Delphi XE4.
Thanks again.
<?xml version="1.0" encoding="windows-1252"?>
<definitions 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:tns="urn:wnposwsdl2" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:wnposwsdl2">
<types>
<xsd:schema targetNamespace="urn:wnposwsdl2">
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>
<xsd:complexType name="wnposreply">
<xsd:all>
<xsd:element name="rtype" type="xsd:string"/>
<xsd:element name="rid" type="xsd:string"/>
<xsd:element name="rval1" type="xsd:string"/>
<xsd:element name="rval2" type="xsd:string"/>
<xsd:element name="rmessage1" type="xsd:string"/>
<xsd:element name="rmessage2" type="xsd:string"/>
<xsd:element name="rmessage3" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="posregister">
<xsd:all>
<xsd:element name="serialno" type="xsd:string"/>
<xsd:element name="posid" type="xsd:string"/>
<xsd:element name="siteid" type="xsd:string"/>
<xsd:element name="sitename" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="customercard">
<xsd:all>
<xsd:element name="cctype" type="xsd:string"/>
<xsd:element name="customercode" type="xsd:string"/>
<xsd:element name="ccnumber" type="xsd:string"/>
<xsd:element name="validfrom" type="xsd:string"/>
<xsd:element name="validto" type="xsd:string"/>
<xsd:element name="pin" type="xsd:string"/>
<xsd:element name="ccstatus" type="xsd:string"/>
<xsd:element name="total_d" type="xsd:float"/>
<xsd:element name="total_c" type="xsd:float"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="customer">
<xsd:all>
<xsd:element name="code" type="xsd:string"/>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="address1" type="xsd:string"/>
<xsd:element name="address2" type="xsd:string"/>
<xsd:element name="county" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="zip" type="xsd:string"/>
<xsd:element name="tel" type="xsd:string"/>
<xsd:element name="gsm" type="xsd:string"/>
<xsd:element name="email" type="xsd:string"/>
<xsd:element name="web" type="xsd:string"/>
<xsd:element name="listprice" type="xsd:string"/>
<xsd:element name="defdiscount" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="payment">
<xsd:all>
<xsd:element name="id" type="xsd:int"/>
<xsd:element name="val" type="xsd:float"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="ccard">
<xsd:all>
<xsd:element name="customercard" type="tns:customercard"/>
<xsd:element name="customer" type="tns:customer"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="ccardarray">
<xsd:complexContent>
<xsd:restriction base="SOAP-ENC:Array">
<xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:ccard[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="customertrans">
<xsd:all>
<xsd:element name="ccnumber" type="xsd:string"/>
<xsd:element name="posserialno" type="xsd:string"/>
<xsd:element name="ftransid" type="xsd:string"/>
<xsd:element name="ftype" type="xsd:string"/>
<xsd:element name="ftm" type="xsd:string"/>
<xsd:element name="fno" type="xsd:string"/>
<xsd:element name="excode" type="xsd:string"/>
<xsd:element name="genexp" type="xsd:string"/>
<xsd:element name="sign" type="xsd:string"/>
<xsd:element name="amount" type="xsd:float"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="customertransarray">
<xsd:complexContent>
<xsd:restriction base="SOAP-ENC:Array">
<xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:customertrans[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="payments">
<xsd:complexContent>
<xsd:restriction base="SOAP-ENC:Array">
<xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:payment[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="itemtrans">
<xsd:all>
<xsd:element name="ttype" type="xsd:string"/>
<xsd:element name="subtype" type="xsd:string"/>
<xsd:element name="code" type="xsd:string"/>
<xsd:element name="quantity" type="xsd:float"/>
<xsd:element name="bprice" type="xsd:float"/>
<xsd:element name="itemgroupcode" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="itemtransarray">
<xsd:complexContent>
<xsd:restriction base="SOAP-ENC:Array">
<xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:itemtrans[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="receiptheader">
<xsd:all>
<xsd:element name="fno" type="xsd:string"/>
<xsd:element name="ftm" type="xsd:string"/>
<xsd:element name="siteid" type="xsd:string"/>
<xsd:element name="customercard" type="tns:customercard"/>
<xsd:element name="payments" type="tns:payments"/>
<xsd:element name="nettotal" type="xsd:float"/>
<xsd:element name="calculatedtotalpoint" type="xsd:float"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="receipt">
<xsd:all>
<xsd:element name="ftransid" type="xsd:int"/>
<xsd:element name="serialno" type="xsd:string"/>
<xsd:element name="ctranstype" type="xsd:string"/>
<xsd:element name="header" type="tns:receiptheader"/>
<xsd:element name="items" type="tns:itemtransarray"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="receiptarray">
<xsd:complexContent>
<xsd:restriction base="SOAP-ENC:Array">
<xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:receipt[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="spendingcheck">
<xsd:all>
<xsd:element name="ctrans" type="tns:customertrans"/>
<xsd:element name="basket" type="tns:receipt"/>
</xsd:all>
</xsd:complexType>
</xsd:schema>
</types>
<message name="register_posRequest">
<part name="posrecord" type="tns:posregister"/></message>
<message name="register_posResponse">
<part name="return" type="tns:wnposreply"/></message>
<message name="query_cardRequest">
<part name="customercard" type="tns:customercard"/></message>
<message name="query_cardResponse">
<part name="return" type="tns:wnposreply"/></message>
<message name="register_customerRequest">
<part name="ccardarray" type="tns:ccardarray"/></message>
<message name="register_customerResponse">
<part name="return" type="tns:wnposreply"/></message>
<message name="check_receiptRequest">
<part name="receipt" type="tns:receiptarray"/></message>
<message name="check_receiptResponse">
<part name="return" type="tns:wnposreply"/></message>
<message name="add_ctransRequest">
<part name="customertrans" type="tns:customertrans"/></message>
<message name="add_ctransResponse">
<part name="return" type="tns:wnposreply"/></message>
<message name="update_ctransRequest">
<part name="customertrans" type="tns:customertrans"/></message>
<message name="update_ctransResponse">
<part name="return" type="tns:wnposreply"/></message>
<message name="add_spendingRequest">
<part name="spendingcheck" type="tns:spendingcheck"/></message>
<message name="add_spendingResponse">
<part name="return" type="tns:wnposreply"/></message>
<portType name="wnposwsdl2PortType">
<operation name="register_pos">
<documentation>Register pos...</documentation>
<input message="tns:register_posRequest"/>
<output message="tns:register_posResponse"/>
</operation>
<operation name="query_card">
<documentation>Query customer card...</documentation>
<input message="tns:query_cardRequest"/>
<output message="tns:query_cardResponse"/>
</operation>
<operation name="register_customer">
<documentation>Registers customer(s)/card(s)/giftcard(s) to be used by the server, approval required by the db manager....</documentation>
<input message="tns:register_customerRequest"/>
<output message="tns:register_customerResponse"/>
</operation>
<operation name="check_receipt">
<documentation>Check receipt for gift or point collection..</documentation>
<input message="tns:check_receiptRequest"/>
<output message="tns:check_receiptResponse"/>
</operation>
<operation name="add_ctrans">
<documentation>Add trans..</documentation>
<input message="tns:add_ctransRequest"/>
<output message="tns:add_ctransResponse"/>
</operation>
<operation name="update_ctrans">
<documentation>Update added trans change stage...</documentation>
<input message="tns:update_ctransRequest"/>
<output message="tns:update_ctransResponse"/>
</operation>
<operation name="add_spending">
<documentation>Add spending ..</documentation>
<input message="tns:add_spendingRequest"/>
<output message="tns:add_spendingResponse"/>
</operation>
</portType>
<binding name="wnposwsdl2Binding" type="tns:wnposwsdl2PortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="register_pos">
<soap:operation soapAction="urn:wnposwsdl2#register_pos" style="rpc"/>
<input><soap:body use="encoded" namespace="urn:wnposwsdl2" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
<output><soap:body use="encoded" namespace="urn:wnposwsdl2" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
</operation>
<operation name="query_card">
<soap:operation soapAction="urn:wnposwsdl2#query_card" style="rpc"/>
<input><soap:body use="encoded" namespace="urn:wnposwsdl2" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
<output><soap:body use="encoded" namespace="urn:wnposwsdl2" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
</operation>
<operation name="register_customer">
<soap:operation soapAction="urn:wnposwsdl2#register_customer" style="rpc"/>
<input><soap:body use="encoded" namespace="urn:wnposwsdl2" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
<output><soap:body use="encoded" namespace="urn:wnposwsdl2" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
</operation>
<operation name="check_receipt">
<soap:operation soapAction="urn:wnposwsdl2#check_receipt" style="rpc"/>
<input><soap:body use="encoded" namespace="urn:wnposwsdl2" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
<output><soap:body use="encoded" namespace="urn:wnposwsdl2" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
</operation>
<operation name="add_ctrans">
<soap:operation soapAction="urn:wnposwsdl2#customertrans" style="rpc"/>
<input><soap:body use="encoded" namespace="urn:wnposwsdl2" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
<output><soap:body use="encoded" namespace="urn:wnposwsdl2" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
</operation>
<operation name="update_ctrans">
<soap:operation soapAction="urn:wnposwsdl2#customertrans" style="rpc"/>
<input><soap:body use="encoded" namespace="urn:wnposwsdl2" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
<output><soap:body use="encoded" namespace="urn:wnposwsdl2" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
</operation>
<operation name="add_spending">
<soap:operation soapAction="urn:wnposwsdl2#spendingcheck" style="rpc"/>
<input><soap:body use="encoded" namespace="urn:wnposwsdl2" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
<output><soap:body use="encoded" namespace="urn:wnposwsdl2" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
</operation>
</binding>
<service name="wnposwsdl2">
<port name="wnposwsdl2Port" binding="tns:wnposwsdl2Binding">
<soap:address location="http://ksistemdomain.com:88/web.biz/server/wnposserver.php"/>
</port>
</service>
</definitions>
Sure, you can use Delphi to write a SOAP Service out of your wsdl file.
then you can use the result dll to call your service.
you can check out this link for more info.

How can I add additional payment information in admin order view page during order creation with magento SOAP(V2) service API?

I am trying to add extra data in Payment Information section like Bank Name: xxxxx and Account Number: xxxxx. But I don't know the exact operation to add the extra data. The steps I followed:
Added two params (param1, param2) in the file app/code/core/Mage/Checkout/etc/wsdl.xml :
<message name="shoppingCartPaymentMethodRequest">
<part name="sessionId" type="xsd:string"/>
<part name="quoteId" type="xsd:int"/>
<part name="method" type="typens:shoppingCartPaymentMethodEntity"/>
<part name="storeId" type="xsd:string"/>
<part name="param1" type="xsd:string"/>
<part name="param2" type="xsd:string"/>
</message>
Also added for WS-I complience. file : app/code/core/Mage/Checkout/etc/wsi.xml
<xsd:element name="shoppingCartPaymentMethodRequestParam">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="1" maxOccurs="1" name="sessionId" type="xsd:string" />
<xsd:element minOccurs="1" maxOccurs="1" name="quoteId" type="xsd:int" />
<xsd:element minOccurs="1" maxOccurs="1" name="paymentData" type="typens:shoppingCartPaymentMethodEntity" />
<xsd:element minOccurs="0" maxOccurs="1" name="store" type="xsd:string" />
<xsd:element minOccurs="0" maxOccurs="1" name="param1" type="xsd:string" />
<xsd:element minOccurs="0" maxOccurs="1" name="param2" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Here I tried to catch the params like this but didnt get any value.
file name: app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php
public function setPaymentMethod($quoteId, $paymentData, $store = null, $param1, $param2)
{
Mage::log($param1);
Mage::log($param2);
// extra code
}
Here is my client code order-test.php:
<?php
$user = 'user';
$password = '123456789';
$proxy = new SoapClient('http://example.com/index.php/api/v2_soap/?wsdl');
$sessionId = $proxy->login($user, $password);
// extra codes
$paymentMethod = array(
'method' => 'checkmo',
// also tried here passing two params (param1, param2)
);
// add payment method
$proxy->shoppingCartPaymentMethod($sessionId, $cartId, $paymentMethod, null, $param1, $param2);
// place the order
$orderId = $proxy->shoppingCartOrder($sessionId, $cartId, null, null);
var_dump($orderId);
?>
Can anybody help on this topic ?
Thank You.
Note: Without passing extra parameters its working fine.

gsoap how to generate structure instead of a class for complex type

I have a complex type that is not optional but wsdl2h is always generating a class for it instead of structure. I want minimum usage of pointers in my C++ webservice.
sample wsdl
<xsd:complexType name="TestInformation">
<xsd:sequence>
<xsd:element name="name" type="tns:name" minOccurs="1"
nillable="false" />
<xsd:element name="address" type="tns:address"
minOccurs="1" nillable="false" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="TestRequest">
<xsd:sequence>
<xsd:element name="test" type="tns:TestInformation"
minOccurs="1" nillable="false" />
</xsd:complexType>
generated header file:
class TestInformation
{ public:
ns2__name name 1; ///< Required element.
ns2__address address 1; ///< Required element.
struct soap *soap ;
};
I want class TestInformation to struct TestInformation & not pointer of it in stubs.

xs:choice embedded in xs:sequence prevents the use of a union

I have the following xsd
<xsd:complexType name="myID">
<xsd:choice>
<xsd:element name="testID" type="priv:testID"/>
<xsd:sequence>
<xsd:element name="newID" type="priv:newID"/>
<xsd:element name="testID" type="priv:testID" minOccurs="0"/>
</xsd:sequence>
</xsd:choice>
</xsd:complexType>
Everything is under priv namespace. The problem is that it looks like that myID is a union. It might be a testID or a sequence with newID and testID. When I compile it with wsdl2h from gsoap I am taking the message:
Note: <xs:choice> with embedded
<xs:sequence> or <xs:group>
prevents the use of a union
Is the above XSD correct?
In general the XML type myID can be declared as you described. The conflict exist probably in connection with your definition of the types priv:testID and priv:testID which definition you not included. For example the schema
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema targetNamespace="http://www.ok-soft-gmbh.com/xml/xsd/1.0/XMLSchema.xsd"
elementFormDefault="qualified"
xmlns:priv="http://www.ok-soft-gmbh.com/xml/xsd/1.0/XMLSchema.xsd"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<xsd:simpleType name="testID">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="newID">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:complexType name="myID">
<xsd:choice>
<xsd:element name="testID" type="priv:testID"/>
<xsd:sequence>
<xsd:element name="newID" type="priv:newID"/>
<xsd:element name="testID" type="priv:testID" minOccurs="0"/>
</xsd:sequence>
</xsd:choice>
</xsd:complexType>
<xsd:element name="root" type="priv:myID"/>
</xsd:schema>
will be correct. So if an error exist, it is not in the part which you posted.