The Artima Developer Community
Sponsored Link

Web Services Forum
Gsoap Service and WCF Client

1 reply on 1 page. Most recent reply: Jul 7, 2011 12:51 AM by david mich

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
david mich

Posts: 2
Nickname: davidmich
Registered: Jun, 2011

Gsoap Service and WCF Client Posted: Jun 17, 2011 3:25 AM
Reply to this message Reply
Advertisement
Hello All,
I am trying to access a gsoap service that returns a complex data type ie a vector. The client is developed on WCF .net 4.0 C#.

After calling the service, the WCF client returns NULL, although the XML response contains the correct data.

I have checked eveywhere on the internet and I think there is something wrong that I am doing but I do not know where.

Is there someone who can help. I will post the wsdl file of the service and the gsoap service header file below.
Any pointers will be very valuable for me as I am stuck here and I have tried all combinations in the header file!!!

An interesting thing is that this only happens when the return is a complex data type. For simple int and string the results are correctly displayed.

Server wsdl
------------

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="DocManager"
targetNamespace="urn:docmgr"
xmlns:tns="urn:docmgr"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns="urn:docmgr"
xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/">

<types>

<schema targetNamespace="urn:docmgr"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns="urn:docmgr"
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="docKeyInfo">
<sequence>
<element name="path" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
<element name="key" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
</sequence>
</complexType>
<complexType name="MultiResult">
<sequence>
<element name="results" type="ns:docKeyInfo" minOccurs="1" maxOccurs="unbounded"/>
</sequence>
</complexType>
</schema>

</types>

<message name="RenameDocumentRequest">
<part name="user" type="xsd:string"/>
<part name="from" type="xsd:string"/>
<part name="to" type="xsd:string"/>
</message>

<message name="RenameDocumentResponse">
<part name="renresult" type="xsd:int"/>
</message>

<message name="GetDocKeyRequest">
<part name="user" type="xsd:string"/>
<part name="docPath" type="xsd:string"/>
</message>

<message name="GetDocKeyResponse">
<part name="getresult" type="xsd:string"/>
</message>

<message name="GetDocKeys">
<part name="user" type="xsd:string"/>
<part name="numEntries" type="xsd:long"/>
</message>

<message name="GetDocKeysResponse">
<part name="multiresultobj" type="ns:MultiResult"/>
</message>

<message name="GetParentDocKeys">
<part name="user" type="xsd:string"/>
<part name="docPath" type="xsd:string"/>
</message>

<message name="GetParentDocKeysResponse">
<part name="multiresultobj" type="ns:MultiResult"/>
</message>

<message name="CreateDocKeyRequest">
<part name="user" type="xsd:string"/>
<part name="docPath" type="xsd:string"/>
</message>

<message name="CreateDocKeyResponse">
<part name="crresult" type="xsd:string"/>
</message>

<message name="HasDocPrivilegesRequest">
<part name="user" type="xsd:string"/>
<part name="docPath" type="xsd:string"/>
<part name="privilege-mask" type="xsd:unsignedInt"/>
</message>

<message name="HasDocPrivilegesResponse">
<part name="hsresult" type="xsd:boolean"/>
</message>

<message name="GetDocPrivilegesRequest">
<part name="docPath" type="xsd:string"/>
<part name="user" type="xsd:string"/>
</message>

<message name="GetDocPrivilegesResponse">
<part name="dpresult" type="xsd:unsignedInt"/>
</message>

<message name="DeleteDocKeyRequest">
<part name="docPath" type="xsd:string"/>
<part name="user" type="xsd:string"/>
</message>

<message name="DeleteDocKeyResponse">
<part name="delresult" type="xsd:int"/>
</message>

<message name="InsertDocKeyRequest">
<part name="docPath" type="xsd:string"/>
<part name="key" type="xsd:string"/>
<part name="user" type="xsd:string"/>
</message>

<message name="InsertDocKeyResponse">
<part name="insresult" type="xsd:int"/>
</message>

<portType name="DocManagerPortType">
<operation name="RenameDocument">
<documentation>Service definition of function ns__RenameDocument</documentation>
<input message="tns:RenameDocumentRequest"/>
<output message="tns:RenameDocumentResponse"/>
</operation>
<operation name="GetDocKey">
<documentation>Service definition of function ns__GetDocKey</documentation>
<input message="tns:GetDocKeyRequest"/>
<output message="tns:GetDocKeyResponse"/>
</operation>
<operation name="GetDocKeys">
<documentation>Service definition of function ns__GetDocKeys</documentation>
<input message="tns:GetDocKeys"/>
<output message="tns:GetDocKeysResponse"/>
</operation>
<operation name="GetParentDocKeys">
<documentation>Service definition of function ns__GetParentDocKeys</documentation>
<input message="tns:GetParentDocKeys"/>
<output message="tns:GetParentDocKeysResponse"/>
</operation>
<operation name="CreateDocKey">
<documentation>Service definition of function ns__CreateDocKey</documentation>
<input message="tns:CreateDocKeyRequest"/>
<output message="tns:CreateDocKeyResponse"/>
</operation>
<operation name="HasDocPrivileges">
<documentation>Service definition of function ns__HasDocPrivileges</documentation>
<input message="tns:HasDocPrivilegesRequest"/>
<output message="tns:HasDocPrivilegesResponse"/>
</operation>
<operation name="GetDocPrivileges">
<documentation>Service definition of function ns__GetDocPrivileges</documentation>
<input message="tns:GetDocPrivilegesRequest"/>
<output message="tns:GetDocPrivilegesResponse"/>
</operation>
<operation name="DeleteDocKey">
<documentation>Service definition of function ns__DeleteDocKey</documentation>
<input message="tns:DeleteDocKeyRequest"/>
<output message="tns:DeleteDocKeyResponse"/>
</operation>
<operation name="InsertDocKey">
<documentation>Service definition of function ns__InsertDocKey</documentation>
<input message="tns:InsertDocKeyRequest"/>
<output message="tns:InsertDocKeyResponse"/>
</operation>
</portType>

<binding name="DocManager" type="tns:DocManagerPortType">
<SOAP:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="RenameDocument">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="GetDocKey">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="GetDocKeys">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="GetParentDocKeys">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="CreateDocKey">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="HasDocPrivileges">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="GetDocPrivileges">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="DeleteDocKey">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="InsertDocKey">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:docmgr" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>

<service name="DocManager">
<documentation>gSOAP 2.7.17 generated service definition</documentation>
<port name="DocManager" binding="tns:DocManager">
<SOAP:address location="http://xx.xxx.xxx.xxx:8080/docmgr"/>
</port>
</service>

</definitions>




Gsoap Server Header
--------------------

//gsoap ns service style: rpc
//gsoap ns service encoding: encoded
//gsoap ns service namespace: urn:docmgr
//gsoap ns service port: http://xx.xxx.xxx.xxx:8080/docmgr
//gsoap ns service name: DocManager


class ns__docKeyInfo
{
public:
char *path;
char *key;
};
#import "/home/tools/gsoap-2.7/gsoap/import/stlvector.h"
class ns__MultiResult
{
public:
std::vector<ns__docKeyInfo *> *results 1;
struct soap *soap;
};
struct ns__GetDocKeysResponse{ns__MultiResult *multiresultobj;};
struct ns__GetParentDocKeysResponse{ns__MultiResult *multiresultobj;};
//gsoap ns service method-style: RenameDocument rpc
//gsoap ns service method-encoding: RenameDocument encoded
//gsoap ns service method-action: RenameDocument ""
int ns__RenameDocument(char *user,char *from,char *to, int &renresult);
//gsoap ns service method-style: GetDocKey rpc
//gsoap ns service method-encoding: GetDocKey encoded
//gsoap ns service method-action: GetDocKey ""
int ns__GetDocKey(char *user,char *docPath,char ** getresult);
//gsoap ns service method-style: GetDocKeys rpc
//gsoap ns service method-encoding: GetDocKeys encoded
//gsoap ns service method-action: GetDocKeys ""
int ns__GetDocKeys(char *user,long numEntries,struct ns__GetDocKeysResponse &mulresult);
//gsoap ns service method-style: GetParentDocKeys rpc
//gsoap ns service method-encoding: GetParentDocKeys encoded
//gsoap ns service method-action: GetParentDocKeys ""
int ns__GetParentDocKeys(char *user,char * docPath,struct ns__GetParentDocKeysResponse &mul2result);
//gsoap ns service method-style: CreateDocKey rpc
//gsoap ns service method-encoding: CreateDocKey encoded
//gsoap ns service method-action: CreateDocKey ""
int ns__CreateDocKey(char *user,char *docPath,char ** crresult);
//gsoap ns service method-style: HasDocPrivileges rpc
//gsoap ns service method-encoding: HasDocPrivileges encoded
//gsoap ns service method-action: HasDocPrivileges ""
int ns__HasDocPrivileges(char *user,char *docPath,unsigned int privilege_mask,bool &hsresult);
//gsoap ns service method-style: GetDocPrivileges rpc
//gsoap ns service method-encoding: GetDocPrivileges encoded
//gsoap ns service method-action: GetDocPrivileges ""
int ns__GetDocPrivileges(char *docPath,char *user,unsigned int &dpresult);
//gsoap ns service method-style: DeleteDocKey rpc
//gsoap ns service method-encoding: DeleteDocKey encoded
//gsoap ns service method-action: DeleteDocKey ""
int ns__DeleteDocKey(char *docPath,char *user,int &delresult);
//gsoap ns service method-style: InsertDocKey rpc
//gsoap ns service method-encoding: InsertDocKey encoded
//gsoap ns service method-action: InsertDocKey ""
int ns__InsertDocKey(char *docPath,char *key, char *user,int &insresult);


david mich

Posts: 2
Nickname: davidmich
Registered: Jun, 2011

Re: Gsoap Service and WCF Client Posted: Jul 7, 2011 12:51 AM
Reply to this message Reply
http://social.msdn.microsoft.com/Forums/en/wcf/thread/7aff1038-2fb6-445b-bdd2-e7d7cc18eeef

Flat View: This topic has 1 reply on 1 page
Topic: About change the servlet version from 2.2 to 2.3 Previous Topic   Next Topic Topic: org.apache.axis2.AxisFault: Processing Failure

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use