Zhou feng, Andrew

Client is WSE 3.0, Server is WCF.

I got the following exception, when return an object which contains an xml string.

WSE910: An error happened during the processing of a response message, and you can find the error in the inner exception. You can also find the response message in the Response property.

stack trace:

at Microsoft.Web.Services3.Xml.SoapEnvelopeReaderWrapper..ctor(SoapClientMessage message, String messageContentType)
at Microsoft.Web.Services3.WebServicesClientProtocol.GetReaderForMessage(SoapClientMessage message, Int32 bufferSize)
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at WorkItem.Client.WorkItemService.WorkItemServiceWse.GetFormVersionItemById(String versionId) in D:\MIS\HSL MIS V2\src\Main\InfoSys\WorkItem\Client\Web References\WorkItemService\Reference.cs:line 1390
at WorkItem.Client.WorkItemServiceAgent.GetFormVersionItemById(Guid id) in D:\MIS\HSL MIS V2\src\Main\InfoSys\WorkItem\Client\WorkItemServiceAgent.cs:line 781

Inner Exception: "The signature or decryption was invalid"

stack trace:

at Microsoft.Web.Services3.Security.Security.LoadXml(XmlElement element)
at Microsoft.Web.Services3.Security.Security.CreateFrom(SoapEnvelope envelope, String localActor, String serviceActor)
at Microsoft.Web.Services3.Security.ReceiveSecurityFilter.ProcessMessage(SoapEnvelope envelope)
at Microsoft.Web.Services3.Pipeline.ProcessInputMessage(SoapEnvelope envelope)
at Microsoft.Web.Services3.Xml.SoapEnvelopeReaderWrapper..ctor(SoapClientMessage message, String messageContentType)

Response OuterXml:

<s:Envelope xmlnsTongue Tied="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><s:Header><Action a:mustUnderstand="1" u:Id="_4" xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:a="http://schemas.xmlsoap.org/soap/envelope/">http://WorkItem/WorkItemService/IWorkItemService/GetFormVersionItemByIdResponse</Action><RelatesTo u:Id="_5" xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">urn:uuid:0c70cadf-211d-4b72-8eea-0adf28f13c1d</RelatesTo><To a:mustUnderstand="1" u:Id="_6" xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:a="http://schemas.xmlsoap.org/soap/envelope/">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</To><oTongue Tiedecurity s:mustUnderstand="1" xmlnsSurprise="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><u:Timestamp u:Id="uuid-39d6966d-db5f-42e1-bdcf-a674dde7a452-501"><u:Created>2007-09-11T11:07:28.346Z</u:Created><u:Expires>2007-09-11T11:12:28.346Z</u:Expires></u:Timestamp><cBig SmileerivedKeyToken u:Id="_0" xmlns:c="http://schemas.xmlsoap.org/ws/2005/02/sc"><oTongue TiedecurityTokenReference><o:Reference URI="urn:uuid:09f9536a-f9ad-40ec-8842-23d7c6bed71d" ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/sct" /></oTongue TiedecurityTokenReference><cSurpriseffset>0</cSurpriseffset><c:Length>24</c:Length><c:Nonce>OHZDXxH1/KqIBFsbtycyAA==</c:Nonce></cBig SmileerivedKeyToken><cBig SmileerivedKeyToken u:Id="_1" xmlns:c="http://schemas.xmlsoap.org/ws/2005/02/sc"><oTongue TiedecurityTokenReference><o:Reference URI="urn:uuid:09f9536a-f9ad-40ec-8842-23d7c6bed71d" ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/sct" /></oTongue TiedecurityTokenReference><c:Nonce>PrZ5jQE2QOXTkMnLMIVf8g==</c:Nonce></cBig SmileerivedKeyToken><e:ReferenceList xmlns:e="http://www.w3.org/2001/04/xmlenc#"><eBig SmileataReference URI="#_3" /></e:ReferenceList><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1" /><Reference URI="#_2"><Transforms><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>zpaq4DzYUACSLkqox6haINzY7n0=</DigestValue></Reference><Reference URI="#_4"><Transforms><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>vZgSF9Ly+DV2c81IIAZTf7ipYb4=</DigestValue></Reference><Reference URI="#_5"><Transforms><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>pSyrSl4/yYLNqxRZPjWVv3vR1Dc=</DigestValue></Reference><Reference URI="#_6"><Transforms><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>0nYmXEdW5nLVyX8EsBbbpNY/hQ8=</DigestValue></Reference><Reference URI="#uuid-39d6966d-db5f-42e1-bdcf-a674dde7a452-501"><Transforms><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>sSQ9sSktLlpnblb+/KXiGvCYRF0=</DigestValue></Reference></SignedInfo><SignatureValue>hkJzFxPslxlZDfig8FQQYPDXjtc=</SignatureValue><KeyInfo><oTongue TiedecurityTokenReference><o:Reference URI="#_0" /></oTongue TiedecurityTokenReference></KeyInfo></Signature></oTongue Tiedecurity></s:Header><s:Body u:Id="_2"><GetFormVersionItemByIdResponse xmlns="http://WorkItem/WorkItemService"><GetFormVersionItemByIdResult xmlns:a="http://schemas.datacontract.org/2004/07/InfoForm.Core" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><aBig SmileefinitionId>fe996534-05ae-4e3f-8dba-13491f661d42</aBig SmileefinitionId><a:id>7c3d4456-8834-4069-ad8b-d8c054f20481</a:id><a:name>070820(根据流程代理)</a:name><a:xsf>&lt; xml version="1.0" encoding="utf-8" &gt;
&lt;InfoForm
xmlns:xsf='InfoForm.ComponentModel, InfoSys.InfoForm.ComponentModel'
xmlnsTongue Tiedys='System.Data, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'&gt;

&lt;!--Data Model Definition Segment--&gt;
&lt;Data MainTableName='Form_Custom_AbsenceRequest' DetailTableName='Form_Custom_Deputy'&gt;
&lt;/Data&gt;

&lt;SmartForm Views='View!EditView|ReadOnlyView|DirectorView' ProviderName='InfoHR.Attendance.SelfService.LeavingForm, InfoHR.Attendance.SelfService'
BindingSource='=DataSet!Form_Custom_AbsenceRequest' IsHavePanel='true' PanelWidth='700'
ProviderRunAtServer='InfoHR.Attendance.Providers.DecideWorkflow, InfoHR.Attendance.Providers'&gt;
&lt;Control&gt;
&lt;!-- Form title --&gt;
&lt;xsfTongue TiedmartLabel Name='nameLabel' Caption=' 假申 ' Font='宋体, 12pt' Style='Bold'
SizeX='{Width=340, Height=30}'/&gt;
&lt;xsfTongue TiedmartTextBox Name='FormIdentityTextBox' Caption='表 :' ReadOnlyX='true'
LocationX='{X=10, Y=10}' WidthX='120' HeightX='20' TextX='=DataSet!Form_Custom_AbsenceRequest.leave_form_identity'/&gt;
&lt;!-- Personal Info --&gt;
&lt;SmartRegion Name='nameRegion1' Caption=' 人信息' TitleBackColor='Lavender' WidthX='540' HeightX='170'&gt;
&lt;Controls&gt;
&lt;xsfTongue TiedmartEmployeeBox Name='infoBox' ReadOnlyX='false'
ShowEmployeeExtension='false' ShowEmployeeEmail='false' ShowEmployeeLocation='false' HeightX='160' WidthX='530'
LocationX='{X=10, Y=40}'
EmployeeNameText='=DataSet!Form_Custom_AbsenceRequest.leave_employee_name'
Value ='=DataSet!Form_Custom_AbsenceRequest.leave_employee_guid'
EmployeeDepartmentText='=DataSet!Form_Custom_AbsenceRequest.leave_department'
EmployeeCodeText='=DataSet!Form_Custom_AbsenceRequest.leave_employee_id'
EmployeePositionText='=DataSet!Form_Custom_AbsenceRequest.leave_position' /&gt;
&lt;/Controls&gt;
&lt;/SmartRegion&gt;

&lt;!-- Type of leave --&gt;
&lt;SmartRegion Name='nameRegion2' Caption='假 信息' TitleBackColor='Lavender' WidthX='540' HeightX='180'&gt;
&lt;Controls&gt;
&lt;xsfTongue TiedmartTextBox Name='leaveTypeTextBox' Caption=' 假 :' AidType='List' ReadOnlyX ='=View!view|EditView'
LocationX='{X=15, Y=40}' WidthX='140' HeightX='20' TextX='=DataSet!Form_Custom_AbsenceRequest.leave_type'/&gt;
&lt;!--&lt;xsfTongue TiedmartTextBox Name='leaveProjectTextBox' Caption=' 前 目:' AidType='List' ReadOnlyX ='=View!view|EditView'
LocationX='{X=320, Y=40}' WidthX='200' HeightX='20' TextX='=DataSet!Form_Custom_AbsenceRequest.leave_project'/&gt;--&gt;
&lt;xsfTongue TiedmartTextBox Name='timeUsedTextBox' Caption='已 :' ReadOnlyX='true'
LocationX='{X=15, Y=70}' WidthX='140' HeightX='20' TextX='=DataSet!Form_Custom_AbsenceRequest.leave_history_time'/&gt;
&lt;xsfTongue TiedmartTextBox Name='timeleftTextBox' Caption='可 :' ReadOnlyX='true'
LocationX='{X=280,Y=70}' WidthX='140' HeightX='20' TextX='=DataSet!Form_Custom_AbsenceRequest.leave_allow_time'/&gt;
&lt;xsfTongue TiedmartTextBox Name='remarkTextBox1' Caption='假 注:' MultiLine='true'
ReadOnlyX='true' LocationX='{X=15, Y=110}' WidthX='405' HeightX='50' TextX='=DataSet!Form_Custom_AbsenceRequest.leave_type_remark'/&gt;
&lt;!--
&lt;xsfTongue TiedmartTextBox Name='deputyTextBox' Caption=' 代理人:' ReadOnlyX ='=View!view|EditView'
LocationX='{X=15, Y=170}' WidthX='110' HeightX='20' TextX='=DataSet!Form_Custom_AbsenceRequest.leave_deputy'/&gt;
&lt;xsfTongue TiedmartTextBox Name='handlerTextBox' Caption='提交 :(班主任)' VisibleX='False'
LocationX='{X=15, Y=170}' WidthX='110' HeightX='20' TextX='=DataSet!Form_Custom_AbsenceRequest.leave_handler'/&gt;
--&gt;

&lt;/Controls&gt;
&lt;/SmartRegion&gt;


&lt;!-- Leave time --&gt;
&lt;SmartRegion Name='nameRegion4' Caption=' 假 ' TitleBackColor='Lavender' WidthX='540' HeightX='210'&gt;
&lt;Controls&gt;
&lt;xsfTongue TiedmartTextBox Name='startDateTextBox' Caption=' 始日期:' AidType='Date' ReadOnlyX ='=View!view|EditView'
LocationX='{X=15, Y=40}' WidthX='140' HeightX='20' TextX='=DataSet!Form_Custom_AbsenceRequest.leave_begin_date'/&gt;
&lt;xsfTongue TiedmartTextBox Name='startTimeTextBox' Caption=' 始 :' AidType='List' ReadOnlyX ='=View!view|EditView'
LocationX='{X=280, Y=40}' WidthX='140' HeightX='20' TextX='=DataSet!Form_Custom_AbsenceRequest.leave_begin_time'/&gt;
&lt;xsfTongue TiedmartTextBox Name='endDateTextBox' Caption=' 束日期:' AidType='Date' ReadOnlyX ='=View!view|EditView'
LocationX='{X=15, Y=70}' WidthX='140' HeightX='20' TextX='=DataSet!Form_Custom_AbsenceRequest.leave_end_date'/&gt;
&lt;xsfTongue TiedmartTextBox Name='endTimeTextBox' Caption=' 束 :' AidType='List' ReadOnlyX ='=View!view|EditView'
LocationX='{X=280, Y=70}' WidthX='140' HeightX='20' TextX='=DataSet!Form_Custom_AbsenceRequest.leave_end_time'/&gt;
&lt;xsfTongue TiedmartTextBox Name='sumDateTimeTextBox' Caption=' (H):' ReadOnlyX='true'
LocationX='{X=15, Y=100}' WidthX='120' HeightX='20' TextX='=DataSet!Form_Custom_AbsenceRequest.leave_sum_time'/&gt;
&lt;xsfTongue TiedmartTextBox Name='reasonTextBox' Caption='具体原因:' MultiLine='true' ReadOnlyX ='=View!view|EditView'
LocationX='{X=15, Y=140}' WidthX='405' HeightX='50' TextX='=DataSet!Form_Custom_AbsenceRequest.leave_excuse'/&gt;
&lt;!--&lt;xsfTongue TiedmartTextBox Name='leaveTypeFlagTextBox' Caption='假 志:' VisibleX='False' ReadOnlyX ='=View!view|EditView'
LocationX='{X=8, Y=140}' WidthX='450' HeightX='50' /&gt;--&gt;
&lt;/Controls&gt;
&lt;/SmartRegion&gt;


&lt;!-- Type of leave --&gt;
&lt;SmartRegion Name='DeputyRegion' Caption='代理信息' TitleBackColor='Lavender' WidthX='540' HeightX='250'&gt;
&lt;Controls&gt;
&lt;xsfTongue TiedmartDataGridView ReadOnlyX= 'true' MenuShow='false' Name='Dg_Deputy' LocationX='{X=15, Y=0}' WidthX='510' HeightX='160' AutoGenerateColumns='false' BindingSource='=CustomData!Form_Custom_Deputy'&gt;
&lt;Columns&gt;
&lt;xsfTongue TiedmartDataGridViewTextBoxColumn WidthX='100' Name='roleColumn' HeaderText="代理人" DataPropertyName='deputy_supply_employee_cnname' AidType='EmployeeName'/&gt;
&lt;!--
&lt;xsfTongue TiedmartDataGridViewTextBoxColumn WidthX='80' Name='countColumn' HeaderText="起始日期" DataPropertyName='deputy_start_date'/&gt;
&lt;xsfTongue TiedmartDataGridViewTextBoxColumn WidthX='70' Name='countColumn' HeaderText="起始 " DataPropertyName='deputy_start_time'/&gt;
&lt;xsfTongue TiedmartDataGridViewTextBoxColumn WidthX='80' Name='startColumn' HeaderText=" 束日期" DataPropertyName='deputy_end_date'/&gt;
&lt;xsfTongue TiedmartDataGridViewTextBoxColumn WidthX='70' Name='startColumn' HeaderText=" 束 " DataPropertyName='deputy_end_time'/&gt;
--&gt;
&lt;xsfTongue TiedmartDataGridViewComboBoxColumn WidthX='160' Name='endColumn' HeaderText="代理 容" DataPropertyName='deputy_task'/&gt;
&lt;/Columns&gt;
&lt;/xsfTongue TiedmartDataGridView&gt;
&lt;/Controls&gt;
&lt;/SmartRegion&gt;

&lt;/Control&gt;
&lt;/SmartForm&gt;
&lt;/InfoForm&gt;</a:xsf></GetFormVersionItemByIdResult></GetFormVersionItemByIdResponse></s:Body></s:Envelope>



Re: ASMX Web Services and XML Serialization Get exception while return an object which contains a big XML format string.

Zhou feng, Andrew

Is there anyone help me





Re: ASMX Web Services and XML Serialization Get exception while return an object which contains a big XML format string.

Zhou feng, Andrew

I have found the reason, but i don't know how to fix the problem.

The reason is that there is "\r\n" in the string. i replace the "\r\n" with "\n", then it works fine.

Why the WSE 3.0 can't recevie the "\r\n" string does anybody help me out

the following is the service configuration:

<system.serviceModel>

<services>
<service name="WorkItem.Service.WorkItemService" behaviorConfiguration="ServiceBehavior">
<endpoint contract="WorkItem.Service.IWorkItemService" binding="customBinding" address=""
bindingConfiguration="ServiceBinding"/>
</service>
</services>

<bindings>
<basicHttpBinding>
<binding name="Basic_Unsecured">
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="WSHttpBinding_IInfoFormService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="6553600"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="6553600" maxArrayLength="6553600"
maxBytesPerRead="6553600" maxNameTableCharCount="6553600" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
<binding name="wsHttpBinding" maxReceivedMessageSize="256666" maxBufferPoolSize="256665"></binding>
</wsHttpBinding>
<customBinding>
<binding name="ServiceBinding">
<security authenticationMode="SecureConversation" requireSecurityContextCancellation="false" defaultAlgorithmSuite="Basic256Rsa15"
messageProtectionOrder="SignBeforeEncrypt"
messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
requireDerivedKeys="true">
<secureConversationBootstrap authenticationMode="UserNameForCertificate" messageProtectionOrder="SignBeforeEncrypt" defaultAlgorithmSuite="Basic256Rsa15"
messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
requireDerivedKeys="true">
</secureConversationBootstrap>
</security>
<mtomMessageEncoding messageVersion ="Soap11WSAddressingAugust2004">
<readerQuotas maxDepth="32" maxStringContentLength="1048576"
maxArrayLength="1048576" maxBytesPerRead="1048576" maxNameTableCharCount="1048576" />
</mtomMessageEncoding>
<httpTransport maxReceivedMessageSize="1048576" />
</binding>
</customBinding>
</bindings>

<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceDebug includeExceptionDetailInFaults="false"/>
<serviceMetadata httpGetEnabled="false" />
<serviceCredentials>
<serviceCertificate findValue="CN=Hanna Strategies InfoSys Server Develop" storeLocation="LocalMachine"
storeName="My" x509FindType="FindBySubjectDistinguishedName" />
<userNameAuthentication userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType="InfoSys.InfoServer.StartUp.DebugUserNamePasswordValidator, InfoServer"/>
</serviceCredentials>
<serviceAuthorization principalPermissionMode="UseAspNetRoles"
roleProviderName="SqlRoleProvider" />
</behavior>
</serviceBehaviors>
</behaviors>

</system.serviceModel>

the following is the client configuration:

<microsoft.web.services3>
<policy fileName="InfoClient.exe.Alpha.policy.config" />
<security>
<binarySecurityTokenManager>
<add valueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3">
<keyAlgorithm name="RSA15" />
</add>
</binarySecurityTokenManager>
</security>
<diagnostics>
<trace enabled="false" input="InputTrace.webinfo" output="OutputTrace.webinfo" />
</diagnostics>
<messaging>
<mtom clientMode="On" />
</messaging>
</microsoft.web.services3>

here is the policy file:

<policies xmlns="http://schemas.microsoft.com/wse/2005/06/policy">
<extensions>
<extension name="usernameForCertificateSecurity" type="Microsoft.Web.Services3.Design.UsernameForCertificateAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension name="x509" type="Microsoft.Web.Services3.Design.X509TokenProvider, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension name="requireActionHeader" type="Microsoft.Web.Services3.Design.RequireActionHeaderAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</extensions>
<policy name="ClientPolicy">
<usernameForCertificateSecurity establishSecurityContext="true" renewExpiredSecurityContext="true" requireSignatureConfirmation="false" messageProtectionOrder="SignBeforeEncrypt" requireDerivedKeys="true" ttlInSeconds="300">
<serviceToken>
<x509 storeLocation="LocalMachine" storeName="My" findValue="CN=Hanna Strategies InfoSys Server Develop" findType="FindBySubjectDistinguishedName" />
</serviceToken>
<protection>
<request signatureOptions="IncludeAddressing, IncludeTimestamp, IncludeSoapBody" encryptBody="true" />
<response signatureOptions="IncludeAddressing, IncludeTimestamp, IncludeSoapBody" encryptBody="true" />
<fault signatureOptions="IncludeAddressing, IncludeTimestamp, IncludeSoapBody" encryptBody="false" />
</protection>
</usernameForCertificateSecurity>
<requireActionHeader />
</policy>
</policies>