TestComplete: Adding headers to Message bug?
Hi, I'm trying to test my WebServices over net.tcp protocol, so I've choosen TestComplete to get it done. I do not want to create XML files manually, so I'm using simple call to service methods. Most of them need custom header with authorization details, so I've attached toOnWebServiceRequest method, and using WebServiceHelperObj.AddHeader(Name,Namespace,Value) method I'm trying to get it done. Now,the problem: After using the method mentioned above, my header does not look like it should. An example: Calling : Helper.AddHeader("UserID", "http://tempuri.org/", "jsmith"); Helper.AddHeader("Password", "http://tempuri.org/", "25jeL3n"); results in header: <s:Header> <a:Action s:mustUnderstand="1">http://tempuri.org/MethodContract/MethodName</a:Action> <a:MessageID>urn:uuid:9244f15d-ae34-422c-ad9d-cd32f616b042</a:MessageID> <a:ReplyTo> <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address> </a:ReplyTo> <UserID xmlns="http://tempuri.org/"> <UserID>jsmith</UserID> </UserID> <Password xmlns="http://tempuri.org/"> <Password>25jeL3n</Password> </Password> <a:To s:mustUnderstand="1">net.tcp://ADDRESS.svc</a:To> </s:Header> As you can see, the header elements are nested, which is not the result I would want to achieve. Second problem: the header i require to add is nested structure, as follows: <s:Header> <MyHeader> <UserName>NAME</UserName> <Password>Password</Password> </MyHeader> </s:Header> how can I achieve this using AddHelper method?2.5KViews0likes8CommentsSoapUI WCF using SSL certificate
After looking around the forums and the internet in general, I was unable to find anything that answered my problem, so I have resorted to placing my question here. Firstly, sorry if this has already had a answer supplied. My problem is this. I have an existing C# WCF service hosting in IIS and secured by an SSL. This is working code and is currently in our Live, UAT, Test and Development environments. I have been asked to use SoapUI for testing firstly on existing services and any new services that we are about to build. So far, I have created the project by supplying the WDSL, setup the keystore with the SSL cert, created an outgoing and incoming WS-Sec config. When in the request, I have created a basic authorization using the defined outgoing and incoming configs created above. After clicking on the submit button, I get the following response. <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"> <s:Header> <a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/soap/fault</a:Action> </s:Header> <s:Body> <s:Fault> <s:Code> <s:Value>s:Sender</s:Value> <s:Subcode> <s:Value xmlns:a="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">a:InvalidSecurity</s:Value> </s:Subcode> </s:Code> <s:Reason> <s:Text xml:lang="en-GB">An error occurred when verifying security for the message.</s:Text> </s:Reason> </s:Fault> </s:Body> </s:Envelope> I did see an article that inferred that I should switchthe 'Enable WS_A addressing' switch off. I did this, but this just caused the submit request to timeout. I have checked that the service is running by viewing the WSDL from the IIS server and also using the application to call the service and all is OK. I am sure that I missed a simple step, so would be grateful for any help. Thanks Paul. P.S. I have just tried what is described in the following link and it still does not work: Update vmoptions file Came across this article: Message Security Sam's comments about: <serviceSecurityAudit auditLogLocation="Application" serviceAuthorizationAuditLevel="Failure" messageAuthenticationAuditLevel="Failure" suppressAuditFailure="true"/> Worked great. On looking at the Application Evnt Log the following message was recorded: The description for Event ID 4 from source ServiceModel Audit 4.0.0.0 cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer. If the event originated on another computer, the display information had to be saved with the event. The following information was included with the event: http://localhost:57978/WCFService.svc http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequence <null> MessageSecurityException: Security processor was unable to find a security header in the message. This might be because the message is an unsecured fault or because there is a binding mismatch between the communicating parties. This can occur if the service is configured for security and the client is not using security. The locale specific resource for the desired message is not present Which leads me back to the fact that I have missed comething. Ay ideas?3.2KViews0likes2CommentsMIME part with Content-ID 'cid:xxxxx' not found. What does that mean? Any help appreciated. Thanks
Below is my soap request <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:Header> <tem:documentName>hello</tem:documentName> <tem:UserName>test</tem:UserName> <tem:Password>test123</tem:Password> </soapenv:Header> <soapenv:Body> <tem:DocumentUpload> <tem:data>cid:859375762160</tem:data> </tem:DocumentUpload> </soapenv:Body> </soapenv:Envelope> And I am getting an error in the response. The error occurs at the place where stream is read. <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <s:Fault> <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode> <faultstring xml:lang="en-US">An exception has been thrown when reading the stream.</faultstring> <detail> <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <HelpLink i:nil="true"/> <InnerException> <HelpLink i:nil="true"/> <InnerException i:nil="true"/> <Message>MIME part with Content-ID 'cid:859375762160' not found.</Message> <StackTrace>at System.Xml.XmlMtomReader.ReadMimePart(String uri) at System.Xml.XmlMtomReader.Read() at System.Xml.XmlReader.ReadStartElement(String localname, String ns) at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Read(Byte[] buffer, Int32 offset, Int32 count)</StackTrace> <Type>System.Xml.XmlException</Type> </InnerException> <Message>An exception has been thrown when reading the stream.</Message> <StackTrace>at System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream.Read(Byte[] buffer, Int32 offset, Int32 count) at WcfService1.Service1.UploadFile(DocumentUpload request) in \\hcldc\users$\rekasambath\documents\visual studio 2015\Projects\WcfService1\WcfService1\Service1.svc.cs:line 25 at SyncInvokeUploadFile(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace> <Type>System.IO.IOException</Type> </ExceptionDetail> </detail> </s:Fault> </s:Body> </s:Envelope> What does this error mean? Am I missing something? Any Help appreciated. Thanks3.5KViews0likes2Commentssoap ui error while using wcf with wshttpbinding for Kerberos authentication
Hi, Using Soap UI as a client accessing the WCF service with the wshttpbindingwith the below configuration: <wsHttpBinding> <binding name="Binding1" receiveTimeout="00:30:00" sendTimeout="00:30:00" closeTimeout="00:30:00" openTimeout="00:30:00" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647"> <security mode="TransportWithMessageCredential"> <message clientCredentialType="Windows" negotiateServiceCredential="false" establishSecurityContext="false" /> </security> </binding> </wsHttpBinding> We need to authenticate using the Kerberos token but we are getting the below error: <s:Fault> <s:Code> <s:Value>s:Sender</s:Value> <s:Subcode> <s:Value xmlns:a="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">a:InvalidSecurity</s:Value> </s:Subcode> </s:Code> <s:Reason> <s:Text xml:lang="en-GB">An error occurred when verifying security for the message.</s:Text> </s:Reason> </s:Fault> I tried the following way from the websites such as : 1.wss-passwordtype to passwordtext 2.https://www.soapui.org/soap-and-wsdl/spnego/kerberos-authentication.html ,I referred thi ssite and made all the changes. But nothing works. Can you please help to fix this issue.1.7KViews0likes0CommentsHow do I configure certificate as part of request?
I need to test a WCF service which has certificate authentication enabled. I'm able to authenticate by writing C# test client which loads up certificate from my system certificate store. Since the certificate is already trusted and stored in my Windows machine cert store locally, how can I point SoapUI to use that cert like the way C# code read from the store? Any pointers would be of great help. I have also tried a number of online forums and their solutions but none of them ever worked. I'm on SoapUI 5.3.0. If SoapUI can't read certs from the local machine store, I have PFX file provide by my Admin, which I used to install cert on my local store. Can I use PFX to authenticate alternatively?33KViews0likes2Commentsdon't get attachment while sending mtom message with wcf in soapUI
I'm implementing a service which receives some string as request and should return back a pdf file in mtom attachment format. When I test it on my own machine with the client forms I can read the data from the content of message but when I checked the output in SOAPUI I found that the message is not sending in mtom format and is sending message in inline format . The raw view of the out put is as follows: HTTP/1.1 200 OK Cache-Control: private Content-Length: 1252359 Content-Type: text/xml; charset=utf-8 Server: Microsoft-IIS/7.5 Set-Cookie: ASP.NET_SessionId=itqdxvdxyovixbj1iglyy5n0; path=/; HttpOnly X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Date: Wed, 20 Jan 2016 13:13:58 GMT <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><GetMaintenanceProtocolPdfAttachmentResponse xmlns="http://xmlns.scania.com/maintenance/schema/technicalinformationmsgs/v1"><GetMaintenanceProtocolPdfAttachmentResult>JVBERi0xLjQNCiXi48/TDQo How can I activate mtom to get the attachment in the output? ( I changed the messageEncoding to Mtom but doesn't work I think)952Views0likes1Comment