Отсутствуетв заголовке SOAP - PullRequest
1 голос
/ 12 декабря 2011

Proxy, сгенерированный с помощью следующей команды


svcutil.exe / language: cs /out:generatedProxy.cs /config:app.config http://sewsr2.sewinfra.com:8002/webservices/SOAProvider/plsql/fnd_user_pkg/?wsdl

Это код, который я создал:


    BasicHttpBinding basicHttpBinding = new BasicHttpBinding();           
    basicHttpBinding.Security.Mode = BasicHttpSecurityMode.None;
    basicHttpBinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
    EndpointAddress epa = new EndpointAddress("http://sewsr2.sewinfra.com:8002/webservices/SOAProvider/plsql/fnd_user_pkg/");
    FND_USER_PKG_PortTypeClient port = new FND_USER_PKG_PortTypeClient(basicHttpBinding,epa);
    port.ClientCredentials.UserName.UserName ="asadmin";
    port.ClientCredentials.UserName.Password = "welcome";
    SOAHeader header = new SOAHeader();
    InputParameters10 input = new InputParameters10();
    header.RespApplication = "FND";
    header.Responsibility = "FND_REP_APP";
    header.SecurityGroup = "STANDARD";
    header.NLSLanguage = "AMERICAN";
    header.Org_Id = "115";
    input.X_USER_NAME = "sysadmin";
    OutputParameters4 ouput = port.TESTUSERNAME(header, input);
    int value = ouput.TESTUSERNAME.Value;

Я получаю Missing <wsse:Security> in SOAP Исключение.

Пожалуйста, помогите мне, я новый Би в .net

Это мой файл app.config

<system.serviceModel>

    <bindings>

        <basicHttpBinding>

            <binding name="FND_USER_PKG_Binding" closeTimeout="00:01:00"

                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"

                allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"

                maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"

                messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"

                useDefaultWebProxy="true">

                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"

                    maxBytesPerRead="4096" maxNameTableCharCount="16384" />

                <security mode="None">

                    <transport clientCredentialType="None" proxyCredentialType="None"

                        realm="" />

                    <message clientCredentialType="UserName" algorithmSuite="Default" />

                </security>

            </binding>

        </basicHttpBinding>

    </bindings>

    <client>

        <endpoint address="http://sewsr2.sewinfra.com:8002/webservices/SOAProvider/plsql/fnd_user_pkg/"

            binding="basicHttpBinding" bindingConfiguration="FND_USER_PKG_Binding"

            contract="FND_USER_PKG_PortType" name="FND_USER_PKG_Port" />

    </client>

</system.serviceModel>

...