471,122 Members | 881 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,122 software developers and data experts.

Q: Empty SoapHeader Visual Studio 2003 C++?

I am trying to build a consumer to a webservice which use soapheader. I am
using Visual Studio 2003. Please see the wsdl-file below. Why is it that the
SOAPHEADER is empty when I use it int the header instead of as part of the
input message? Is there a limitation of VS2003?

Please any ideas are appreciated?!

TIA
Fred

The binding looks like this:
----------------------------------
<binding name="UnameCodeLoginSoapBinding" type="tns1:UnameCodeLoginPort">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="UnameCodeLogin">
<wsdlsoap:operation soapAction=""/>
<input name="unamecodeloginreq">
<wsdlsoap:header namespace="http://sa.edb.com/authent"
message="tns1:UnameCodeLoginReq" part="SoapHeader" use="literal"/>
<wsdlsoap:body namespace="http://sa.edb.com/authent"
parts="UnameCodeLoginIn" use="literal"/>
</input>
<output name="unamecodeloginres">
<wsdlsoap:body namespace="http://sa.edb.com/authent" use="literal"/>
</output>
</operation>
</binding>
The thing is that when I make the call:
HRESULT res = srv.UnameCodeLogin( req, soapHeader, &rsp);

All my soapheader is empty (see below, all AutHeader is nil):
----------------------------------
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soap:Header xmlns="http://sa.edb.com/authent">
<snp:AutHeader xmlns:snp="http://sa.edb.com/authent"
xmlns="http://sa.edb.com/authent">
<SourceApplication xsi:nil="1"/>
<DestinationApplication xsi:nil="1"/>
<Function xsi:nil="1"/>
<ClientContext>
<userid xsi:nil="1"/>
<credentials xsi:nil="1"/>
<channel xsi:nil="1"/>
<orgid xsi:nil="1"/>
<orgunit xsi:nil="1"/>
<customerid xsi:nil="1"/>
<locale xsi:nil="1"/>
<ip xsi:nil="1"/>
<item></item>
</ClientContext>
</snp:AutHeader>
</soap:Header>
<soap:Body>
<UnameCodeLogin xmlns="http://sa.edb.com/authent">
<Ident>111999600030010</Ident>
<Channel>NBA</Channel>
<Institution>46009020</Institution>
<UserAlias>QUICKB</UserAlias>
<UserId></UserId>
<Pwd>111111</Pwd>
<DeviceType></DeviceType>
<Netcentric></Netcentric>
<NumericalID>46009020</NumericalID>
</UnameCodeLogin>
</soap:Body></soap:Envelope>

If I put the AutHeader as an ordinary message input instead of a soapheader
I do get the header filled out:
----------------------------------
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soap:Body>
<UnameCodeLogin mlns="http://sa.edb.com/authent">
<Ident>111999600030010</Ident>
<Channel>NBA</Channel>
<Institution>46009020</Institution>
<UserAlias>QUICKB</UserAlias>
<UserId></UserId>
<Pwd>111111</Pwd>
<DeviceType></DeviceType>
<Netcentric></Netcentric>
<NumericalID>46009020</NumericalID>
</UnameCodeLogin>
<AutHeader xmlns="http://sa.edb.com/authent">
<SourceApplication>LFTEST_TFB</SourceApplication>
<DestinationApplication>SA</DestinationApplication>
<Function>UnameCodeLogin</Function>
<ClientContext>
<userid>QUICKB</userid>
<credentials>111111</credentials>
<channel>NBA</channel>
<orgid>46009020</orgid>
<orgunit>46009020</orgunit>
<customerid>0123456789</customerid>
<locale></locale>
<ip></ip>
<item></item>
</ClientContext>
</AutHeader>
</soap:Body></soap:Envelope>
WSDL:
----------------------------------
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soap:Body>
<UnameCodeLogin mlns="http://sa.edb.com/authent">
<Ident>111999600030010</Ident>
<Channel>NBA</Channel>
<Institution>46009020</Institution>
<UserAlias>QUICKB</UserAlias>
<UserId></UserId>
<Pwd>111111</Pwd>
<DeviceType></DeviceType>
<Netcentric></Netcentric>
<NumericalID>46009020</NumericalID>
</UnameCodeLogin>
<AutHeader xmlns="http://sa.edb.com/authent">
<SourceApplication>LFTEST_TFB</SourceApplication>
<DestinationApplication>SA</DestinationApplication>
<Function>UnameCodeLogin</Function>
<ClientContext>
<userid>QUICKB</userid>
<credentials>111111</credentials>
<channel>NBA</channel>
<orgid>46009020</orgid>
<orgunit>46009020</orgunit><customerid>0123456789</customerid>
<locale></locale>
<ip></ip>
<item></item>
</ClientContext>
</AutHeader>
</soap:Body></soap:Envelope>

My WSDL-file:
-----------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://sa.edb.com/authent"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"

xmlns:tns1="http://sa.edb.com/authent"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"

xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xmlns:edb="http://edb.com/ws/WSCommon_v10">
<types>
<schema targetNamespace="http://sa.edb.com/authent"
xmlns="http://www.w3.org/2001/XMLSchema">

<xsd:complexType name="UnameCodeLoginType">
<xsd:sequence>
<xsd:element name="Ident" type="xsd:string" minOccurs="1"/>
<xsd:element name="Channel" type="xsd:string" minOccurs="1"/>
<xsd:element name="Institution" type="xsd:string" minOccurs="1"/>
<xsd:element name="UserAlias" type="xsd:string" minOccurs="1"/>
<xsd:element name="UserId" type="xsd:string"/>
<xsd:element name="Pwd" type="xsd:string" minOccurs="1"/>
<xsd:element name="DeviceType" type="xsd:string"/>
<xsd:element name="Netcentric" type="xsd:string"/>
<xsd:element name="NumericalID" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="UnameCodeLoginResponseType">
<xsd:sequence>
<xsd:element name="UserId" type="xsd:string"/>
<xsd:element name="DeviceType" type="xsd:string"/>
<xsd:element name="Netcentric" type="xsd:string"/>
<xsd:element name="CodeNum" type="xsd:int"/>
<xsd:element name="NumericalID" type="xsd:string"/>
<xsd:element name="SaRet" type="xsd:int"/>
<xsd:element name="CryptoRet" type="xsd:string"/>
<xsd:element name="TextRet" type="xsd:string"/>
<xsd:element name="LastOkLogin" type="xsd:string"/>
<xsd:element name="LastBadLogin" type="xsd:string"/>
<xsd:element name="BadLogins" type="xsd:string"/>
<xsd:element name="NextStep" type="xsd:string"/>
<xsd:element name="SerialNum" type="xsd:string"/>
<xsd:element name="Version" type="xsd:string"/>
<xsd:element name="HostCode" type="xsd:string"/>
<xsd:element name="So" type="xsd:string"/>
<xsd:element name="ReturnState" type="tns1:ResponseStateType"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="ResponseStateType">
<xsd:sequence>
<xsd:element name="ErrorStatus" type="xsd:boolean"/>
<xsd:element name="ErrorCode" type="xsd:int"/>
<xsd:element name="Message" type="xsd:string"/>
<xsd:element name="NativeError" type="xsd:string"/>
<xsd:element name="LogSequence" type="xsd:long"/>
<xsd:element name="errorItem" type="tns1:errorItemType"
minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="errorItemType">
<xsd:attribute name="key" type="xsd:string" use="required"/>
<xsd:attribute name="value" type="xsd:string" use="required"/>
</xsd:complexType>
<xsd:complexType name="ClientContextType">
<xsd:sequence>
<xsd:element name="userid" type="xsd:string" minOccurs="0"/>
<xsd:element name="credentials" type="xsd:string" minOccurs="0"/>
<xsd:element name="channel" type="xsd:string" minOccurs="0"/>
<xsd:element name="orgid" type="xsd:string" minOccurs="0"/>
<xsd:element name="orgunit" type="xsd:string" minOccurs="0"/>
<xsd:element name="customerid" type="xsd:string" minOccurs="0"/>
<xsd:element name="locale" type="xsd:string" minOccurs="0"/>
<xsd:element name="ip" type="xsd:string" minOccurs="0"/>
<xsd:element name="item" type="tns1:itemType" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="itemType">
<xsd:attribute name="key" type="xsd:string" use="required"/>
<xsd:attribute name="value" type="xsd:string" use="required"/>
</xsd:complexType>
<xsd:complexType name="EDBHeaderType">
<xsd:sequence>
<xsd:element name="SourceApplication" type="xsd:string"/>
<xsd:element name="DestinationApplication" type="xsd:string"/>
<xsd:element name="Function" type="xsd:string"/>
<xsd:element name="ClientContext" type="tns1:ClientContextType"/>
</xsd:sequence>
</xsd:complexType>

<xsd:element name="AutHeader" type="tns1:EDBHeaderType"/>
<xsd:element name="UnameCodeLogin" type="tns1:UnameCodeLoginType"/>
<xsd:element name="UnameCodeLoginResponse"
type="tns1:UnameCodeLoginResponseType"/>

</schema>
</types>

<message name="UnameCodeLoginReq">
<part element="tns1:UnameCodeLogin" name="UnameCodeLoginIn"/>
<part element="tns1:AutHeader" name="SoapHeader"/>
</message>

<message name="UnameCodeLoginRes">
<part element="tns1:UnameCodeLoginResponse" name="UnameCodeLoginOut"/>
</message>

<portType name="UnameCodeLoginPort">
<operation name="UnameCodeLogin">
<input message="tns1:UnameCodeLoginReq" name="unamecodeloginreq"/>
<output message="tns1:UnameCodeLoginRes" name="unamecodeloginres"/>
</operation>
</portType>

<binding name="UnameCodeLoginSoapBinding" type="tns1:UnameCodeLoginPort">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="UnameCodeLogin">
<wsdlsoap:operation soapAction=""/>
<input name="unamecodeloginreq">
<wsdlsoap:header namespace="http://sa.edb.com/authent"
message="tns1:UnameCodeLoginReq" part="SoapHeader" use="literal"/>
<wsdlsoap:body namespace="http://sa.edb.com/authent"
parts="UnameCodeLoginIn" use="literal"/>
</input>
<output name="unamecodeloginres">
<wsdlsoap:body namespace="http://sa.edb.com/authent" use="literal"/>
</output>
</operation>
</binding>

<service name="UnameCodeLoginService">
<port binding="tns1:UnameCodeLoginSoapBinding"
name="UnameCodeLoginService">
<wsdlsoap:address location="XXXXXX">
</port>
</service>

</wsdl:definitions>

Feb 12 '07 #1
0 1783

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Ricardo Dias Marques | last post: by
1 post views Thread by Daniel A. Thomas | last post: by
26 posts views Thread by Bruno Jouhier [MVP] | last post: by
10 posts views Thread by Andy Kendall | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.