Webservice client calling error

I am calling webservice methods by using proxy.
In my proxy class iam using WSE3.0 username tokens to call the soap header.


Iam getting below error:

Encountered error preparing request, no valid response retrieved from server. Exception: EligibilityBase.EligibilityNoResponseException: Encountered error sending or receiving transaction, no valid response retrieved from server. Exception: System.InvalidOperationException: Client found response content type of 'multipart/related; boundary="MIMEBoundaryurn_uuid_A21DAFBFF9538048ED1319647533317"; type="application/xop+xml"; start="<0.urn:uuid:A21DAFBFF9538048ED1319647533318@apache.org>"; start-info="application/soap+xml";action="http://www.caqh.org/SOAP/WSDL/CORETransactions/RealTimeTransactionResponse"', but expected 'application/soap+xml'.
The request failed with the error message:
--
--MIMEBoundaryurn_uuid_A21DAFBFF9538048ED1319647533317
content-type: application/xop+xml; charset=utf-8; type="application/soap+xml"
content-transfer-encoding: binary
content-id: <0.urn:uuid:A21DAFBFF9538048ED1319647533318@apache.org>

Thanks in advance.
NettodotnetAsked:
Who is Participating?
 
Kumaraswamy RConnect With a Mentor Commented:
Hi


which code part get error, provide the ur code

as per my understanding bellow url give some idea

http://stackoverflow.com/questions/2139190/adding-soapheader-username-and-password-with-wse-3-0
0
 
NettodotnetAuthor Commented:
Here is my code:
 COREEnvelopeRealTimeRequest req = new COREEnvelopeRealTimeRequest();
                req.PayloadType = TNCaidSettings.PayloadType;  
                req.ProcessingMode = TNCaidSettings.ProcessingMode;
                req.PayloadID = _transactionNumber.ToString();
                req.TimeStamp = _pickupDate.ToString();
                req.SenderID = TNCaidSettings.SubmitterId;
                req.ReceiverID = TNCaidSettings.ReceiverId.ToString();
                req.CORERuleVersion = TNCaidSettings.CoreRuleVersion;
                req.Payload = _rawTransaction;

                MyCore client = new MyCore();
                try
                {
                   

                    UsernameToken tok = new UsernameToken(TNCaidSettings.UserName, TNCaidSettings.Password, PasswordOption.SendPlainText);
                    client.RequestSoapContext.Security.EncodedMustUnderstand= "false";
                    client.RequestSoapContext.Security.Tokens.Add(tok);
                    client.RequestSoapContext.Addressing.Action = "false";
                    client.Url = TNCaidSettings.RemoteAddress;
                   
                    COREEnvelopeRealTimeResponse resp = client.RealTimeTransaction(req);--Here iam getting above error.
                    return resp.Payload;



Here is the soap message i looked into fiddler:
 
--MIMEBoundaryurn_uuid_A21DAFBFF9538048ED1319721751122

content-type: application/xop+xml; charset=utf-8; type="application/soap+xml"
content-transfer-encoding: binary

content-id: <0.urn:uuid:A21DAFBFF9538048ED1319721751123@apache.org>
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<soapenv:Header><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsa:MessageID>urn:uuid:A21DAFBFF9538048ED1319721751120</wsa:MessageID><wsa:Action>http://www.caqh.org/SOAP/WSDL/CORETransactions/RealTimeTransactionResponse</wsa:Action><wsa:RelatesTo>urn:uuid:57992efe-9e47-4adb-a79b-322047bdb352</wsa:RelatesTo>
</soapenv:Header>
<soapenv:Body><ns2:COREEnvelopeRealTimeResponse xmlns:ns2="http://www.caqh.org/SOAP/WSDL/CORERule2.0.1.xsd"><PayloadType>X12_10</PayloadType><ProcessingMode>RealTime</ProcessingMode><PayloadID>12319</PayloadID><TimeStamp>2011-10-27T09:22:06-0400</TimeStamp><SenderID>300</SenderID><ReceiverID>13476</ReceiverID><CORERuleVersion>2.0.1</CORERuleVersion><Payload>&lt;![CDATA[--some payload data--
]]&gt;</Payload><ErrorCode>Success</ErrorCode><ErrorMessage>Request was processed successfully</ErrorMessage></ns2:COREEnvelopeRealTimeResponse>
</soapenv:Body>
</soapenv:Envelope>
--MIMEBoundaryurn_uuid_A21DAFBFF9538048ED1319721751122--
                   
0
 
NettodotnetAuthor Commented:
The link is very use full to me
0
 
mbr1022Commented:
Were you able to resolve this issue?  If so, can you give me some more detail about your solution?  Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.