从Web服务调用获取响应时出错

时间:2012-06-19 17:49:05

标签: web-services oracle asp.net-3.5

我正在尝试使用Web服务,虽然显然我的所有参数似乎都没问题,但我仍然将错误页面作为响应而不是字节数组,这是我期待的以及WebService应该是什么返回。

My objective is to Seal a file in order to make them only readable for the right people. I am using the IRM Oracle Web Services to acomplish that, but, though all my parameters semm alright, I can't get the reponse properly.

Acording to the Oraclel support, my request is fine, so it must be something on IIS I guess. Any help?

异常消息:

内容类型multipart / related; start =“”; type =“application / xop + xml”; boundary =“uuid:ab73a894-eaf4-4293-aa4e-c3358b95ec73”; start-info =“text / xml”响应消息的内容与绑定的内容类型不匹配(text / xml; charset = utf-8)。如果使用自定义编码器,请确保正确实现IsContentTypeSupported方法。响应的前748个字节是:' - uuid:ab73a894-eaf4-4293-aa4e-c3358b95ec73 Content-Id:Content-Type:application / xop + xml; charset = utf-8; type =“text / xml” Content-Transfer-Encoding:二进制'。

异常Stacktrace:

服务器堆栈跟踪:位于System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply的System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest请求,HttpWebResponse响应,HttpChannelFactory工厂,WebException responseException,ChannelBinding channelBinding)(TimeSpan超时) )System.ServiceModel.Channels.RequestChannel.Request(消息消息,TimeSpan超时),System.ServiceModel.Dispatcher.RequestChannelBinder.Request(消息消息,TimeSpan超时),位于System.ServiceModel.Channels.ServiceChannel.Call(String action,Boolean)在System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)异常的System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall,ProxyOperationRuntime操作)中,单向,ProxyOperationRuntime操作,Object [] ins,Object []出,TimeSpan超时)在[0]重新抛出:在System.Runtime.Remoting.Proxies.RealProxy.Hand System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke中的leReturnMessage(IMessage reqMsg,IMessage retMsg)(MessageData& msgData,Int32类型)HTMLToPDFComponenteConverter.sealing_services.SealingServices.Seal(SealRequest请求)HTMLToPDFComponenteConverter.sealing_services.SealingServicesClient.HTMLToPDFComponenteConverter.sealing_services.SealingServices.Seal(SealRequest请求),位于HTMLToPDFComponenteConverter.sealing_services.SealingServicesClient.Seal(Byte [] stream,String mimeType,SealingOptions选项)HTMLToPDFComponenteConverter.ConvertToPDF.Page_Load(Object sender,EventArgs e)

异常数据:

System.Collections.ListDictionaryInternal

异常来源:

mscorlib程序


Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.ContentType = "application/vnd.sealedmedia.softseal.pdf";
Response.AddHeader("Content-Disposition", "attachment; filename=Relatorio.spdf");


SealingServicesClient sealingServicesClient =
    new SealingServicesClient("SealingServices");


sealingServicesClient.ClientCredentials.UserName.UserName =
    ConfigurationManager.AppSettings["Irm-user"];
sealingServicesClient.ClientCredentials.UserName.Password =
    ConfigurationManager.AppSettings["Irm-password"];


// Create the classification details used in the sealing options
SealingOptions sealingOptions = new SealingOptions();
// This just set several parameters which the WebService validates. (They're all okay) 
sealingOptions.classification = GetClassificationSetUp();
String mimeType = "application/pdf";
// Here is where everything goes wrong. I keep getting an error message.
byte[] sealedFile = sealingServicesClient.Seal(file, mimeType, sealingOptions);


if (sealedFile != null && sealedFile.Length > 0)
{
    Response.AddHeader("Content-Length", sealedFile.Length.ToString());
    Response.BinaryWrite(sealedFile);
    Response.Flush();
    Response.End();
}

MeuWebConfigestádessejeito:


<system.serviceModel>
        <client>
                <endpoint address="https://url:porta/irm_sealing/sealing_services"
                        binding="basicHttpBinding" bindingConfiguration="SealingServicesBinding"
                        contract="sealing_services.SealingServices" name="SealingServices"
                        behaviorConfiguration="IrmSealingAbril">
                        <identity>
                                <dns value="localhost" />
                        </identity>
                </endpoint>
        </client>
        <behaviors>
                <endpointBehaviors>
                        <behavior name="IrmSealingAbril">
                                <clientCredentials>
                                        <clientCertificate storeLocation="LocalMachine"
                                                                           storeName="Root"
                                                                           x509FindType="FindByThumbprint"
                                                                           findValue="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX">
                                        </clientCertificate>
                                </clientCredentials>
                        </behavior>
      </endpointBehaviors>
    </behaviors>
        <bindings>
                <basicHttpBinding>
                        <binding name="SealingServicesBinding" closeTimeout="00:05:00"
                     openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:05:00"
                                         allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                     maxBufferSize="2097152" maxBufferPoolSize="524288" maxReceivedMessageSize="2097152"
                     messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                     useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                                <security mode="Transport">
                                        <transport clientCredentialType="Basic" realm="weblogic" />
                                </security>
                        </binding>
                </basicHttpBinding>
    </bindings>
  </system.serviceModel>

我哪里错了?

其他信息:oracle支持确认请求显然是正确的。但是,我无法得到回复的回复。我认为它可能与IIS有关,但我没有配置它的技巧。

提前致谢。

1 个答案:

答案 0 :(得分:0)