Hi,
I am consuming a java WebService through WSDL in asp.net project. I have created a proxy through Visual Studio wsdl utility and added all message header that has value like version, username, password. I am able to run this service through SOAP UI 4.5 but not able to get connected with code and getting below exception without detailed information.
Getting Error: Exception of type 'System.Web.Services.Protocols.SoapHeaderException' was thrown.
I have strict deadline for code delivery. Any input is usefull for me. Thanks in advance.
Input that i passed in SOAP UI: (getting correct output with this input)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mes="http://csi.cingular.com/CSI/Namespaces/Types/Public/MessageHeader.xsd" xmlns:cin="http://csi.cingular.com/CSI/Namespaces/Types/Public/CingularDataModel.xsd" xmlns:inq="http://csi.cingular.com/CSI/Namespaces/Container/Public/InquireWirelineAccountAssociationsRequest.xsd">
<soapenv:Header>
<mes:MessageHeader>
<mes:TrackingMessageHeader>
<!--Optional:-->
<cin:infrastructureVersion></cin:infrastructureVersion>
<!--Optional:-->
<cin:originalInfrastructureVersion></cin:originalInfrastructureVersion>
<!--Optional:-->
<cin:applicationName>XXX</cin:applicationName>
<cin:version>XXX</cin:version>
<!--Optional:-->
<cin:originalVersion></cin:originalVersion>
<cin:messageId>XXX:14-1402329285911</cin:messageId>
<!--Optional:-->
<cin:originatorId></cin:originatorId>
<!--Optional:-->
<cin:responseTo></cin:responseTo>
<!--Optional:-->
<cin:returnURL></cin:returnURL>
<!--Optional:-->
<cin:timeToLive>300000</cin:timeToLive>
<!--Optional:-->
<cin:conversationId></cin:conversationId>
<!--Zero or more repetitions:-->
<cin:routingRegionOverride></cin:routingRegionOverride>
<cin:dateTimeStamp>2014-06-12T15:54:45Z</cin:dateTimeStamp>
<!--Optional:-->
<cin:uniqueTransactionId></cin:uniqueTransactionId>
</mes:TrackingMessageHeader>
<mes:SecurityMessageHeader>
<cin:userName>XXX</cin:userName>
<cin:userPassword>XXXXXX</cin:userPassword>
</mes:SecurityMessageHeader>
<mes:SequenceMessageHeader>
<cin:sequenceNumber>1</cin:sequenceNumber>
<cin:totalInSequence>1</cin:totalInSequence>
</mes:SequenceMessageHeader>
</mes:MessageHeader>
</soapenv:Header>
<soapenv:Body>
<inq:InquireWirelineAccountAssociationsRequest>
<inq:BillingTelephoneNumber>
<cin:workingTelephoneNumber>3217221354</cin:workingTelephoneNumber>
</inq:BillingTelephoneNumber>
<inq:backendInstanceOverrideTag></inq:backendInstanceOverrideTag>
</inq:InquireWirelineAccountAssociationsRequest>
</soapenv:Body>
</soapenv:Envelope>
ASP.net Code that not working:
WirelineBillingTelephoneNumberInfo custWTN=new WirelineBillingTelephoneNumberInfo();
custWTN.workingTelephoneNumber=3132127412;
InquireWirelineAccountAssociationsRequestInfo IRequestInfo =new InquireWirelineAccountAssociationsRequestInfo();
IRequestInfo.BillingTelephoneNumber=custWTN;
//Creating MessageHeader
MessageHeaderTracking iMsgHdrTrk = new MessageHeaderTracking();
iMsgHdrTrk.applicationName="xxx";
iMsgHdrTrk.version="xxx";
iMsgHdrTrk.timeToLive = "300000";
iMsgHdrTrk.dateTimeStamp = DateTime.UtcNow;
//Creating Unique MessageID
string msgIDPrefix = "ccf";
string threadID = System.Threading.Thread.CurrentThread.ManagedThreadId.ToString();
string timeInMilli = DateTime.Now.Ticks.ToString();
string msgID = msgIDPrefix + ":" + threadID + "-" + timeInMilli;
iMsgHdrTrk.messageId = msgID;
MessageHeaderSequence iMsgHdrSeq = new MessageHeaderSequence();
iMsgHdrSeq.sequenceNumber="1";
iMsgHdrSeq.totalInSequence="1";
MessageHeaderSecurity iMsgHdrSec = new MessageHeaderSecurity();
iMsgHdrSec.userName="xxx";
iMsgHdrSec.userPassword="xxxxxx";
MessageHeaderInfo iMsgHdr =new MessageHeaderInfo();
WirelineBillingTelephoneNumberInfo btnInfo = null;
try
{
iMsgHdr.SecurityMessageHeader=iMsgHdrSec;
iMsgHdr.SequenceMessageHeader=iMsgHdrSeq;
iMsgHdr.TrackingMessageHeader=iMsgHdrTrk;
iAccountAss.MessageHeader= iMsgHdr;
IAsyncResult ar = iAccountAss.BeginInquireWirelineAccountAssociations(IRequestInfo, null, null);
iWResponse = iAccountAss.EndInquireWirelineAccountAssociations(ar);
}
catch (Exception ex)
{
string dddd = ex.Message;
}
return btnInfo.workingTelephoneNumber;